Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: src/gpu/GrContext.cpp

Issue 586073002: Don't flush on read/write pixels unless necessary (Closed) Base URL: https://skia.googlesource.com/skia.git@iotype
Patch Set: working Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index eb8455adbbae89355d4521fbbbeb140ede4643f7..afe396d6536f8c02c3a08f83923f559846213075 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1347,7 +1347,7 @@ bool GrContext::writeTexturePixels(GrTexture* texture,
}
}
- if (!(kDontFlush_PixelOpsFlag & flags)) {
+ if (!(kDontFlush_PixelOpsFlag & flags) && texture->hasPendingIO()) {
this->flush();
}
@@ -1418,7 +1418,7 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
}
}
- if (!(kDontFlush_PixelOpsFlag & flags)) {
+ if (!(kDontFlush_PixelOpsFlag & flags) && target->hasPendingWrite()) {
this->flush();
}

Powered by Google App Engine
This is Rietveld 408576698