Revert of Don't flush on read/write pixels unless necessary (patchset #2 id:20001 of https://codereview.chromium.org/586073002/)
Reason for revert: Breaking the tree Original issue's description: > Don't flush on read/write pixels unless necessary > > BUG=skia:2889 > > Committed: https://skia.googlesource.com/skia/+/150723b9298772a5096bec7acd2999c5c9d66239 R=robertphillips@google.com TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2889 Author: bsalomon@google.com Review URL: https://codereview.chromium.org/594543004
This commit is contained in:
parent
150723b929
commit
4401a1f7d6
@ -80,14 +80,9 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) {}
|
||||
|
||||
bool internalHasPendingRead() const { return SkToBool(fPendingReads); }
|
||||
bool internalHasPendingWrite() const { return SkToBool(fPendingWrites); }
|
||||
bool internalHasPendingIO() const { return SkToBool(fPendingWrites | fPendingReads); }
|
||||
|
||||
private:
|
||||
void addPendingRead() const {
|
||||
this->validate();
|
||||
|
@ -135,10 +135,6 @@ public:
|
||||
*/
|
||||
bool savePixels(const char* filename);
|
||||
|
||||
bool hasPendingRead() const;
|
||||
bool hasPendingWrite() const;
|
||||
bool hasPendingIO() const;
|
||||
|
||||
protected:
|
||||
GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc)
|
||||
: INHERITED(gpu, isWrapped)
|
||||
|
@ -1347,7 +1347,7 @@ bool GrContext::writeTexturePixels(GrTexture* texture,
|
||||
}
|
||||
}
|
||||
|
||||
if (!(kDontFlush_PixelOpsFlag & flags) && texture->hasPendingIO()) {
|
||||
if (!(kDontFlush_PixelOpsFlag & flags)) {
|
||||
this->flush();
|
||||
}
|
||||
|
||||
@ -1418,7 +1418,7 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
|
||||
}
|
||||
}
|
||||
|
||||
if (!(kDontFlush_PixelOpsFlag & flags) && target->hasPendingWrite()) {
|
||||
if (!(kDontFlush_PixelOpsFlag & flags)) {
|
||||
this->flush();
|
||||
}
|
||||
|
||||
|
@ -833,7 +833,7 @@ void GrInOrderDrawBuffer::geometrySourceWillPop(const GeometrySrcState& restored
|
||||
|
||||
void GrInOrderDrawBuffer::recordStateIfNecessary() {
|
||||
if (fStates.empty()) {
|
||||
this->convertDrawStateToPendingExec(&fStates.push_back(this->getDrawState()));
|
||||
fStates.push_back() = this->getDrawState();
|
||||
this->addToCmdBuffer(kSetState_Cmd);
|
||||
return;
|
||||
}
|
||||
|
@ -44,39 +44,3 @@ bool GrSurface::savePixels(const char* filename) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GrSurface::hasPendingRead() const {
|
||||
const GrTexture* thisTex = this->asTexture();
|
||||
if (thisTex && thisTex->internalHasPendingRead()) {
|
||||
return true;
|
||||
}
|
||||
const GrRenderTarget* thisRT = this->asRenderTarget();
|
||||
if (thisRT && thisRT->internalHasPendingRead()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GrSurface::hasPendingWrite() const {
|
||||
const GrTexture* thisTex = this->asTexture();
|
||||
if (thisTex && thisTex->internalHasPendingWrite()) {
|
||||
return true;
|
||||
}
|
||||
const GrRenderTarget* thisRT = this->asRenderTarget();
|
||||
if (thisRT && thisRT->internalHasPendingWrite()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GrSurface::hasPendingIO() const {
|
||||
const GrTexture* thisTex = this->asTexture();
|
||||
if (thisTex && thisTex->internalHasPendingIO()) {
|
||||
return true;
|
||||
}
|
||||
const GrRenderTarget* thisRT = this->asRenderTarget();
|
||||
if (thisRT && thisRT->internalHasPendingIO()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user