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

Unified Diff: src/gpu/GrSurface.cpp

Issue 586073002: Don't flush on read/write pixels unless necessary (Closed) Base URL: https://skia.googlesource.com/skia.git@iotype
Patch Set: Flush when drawing direct to GrGpu in GrContext 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
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSurface.cpp
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index 52ab4fd11dc2963fa3612b482d84ea8f33eafea7..d15cbdf6e26ccc7fd3b3745cb9ced18747132395 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -44,3 +44,39 @@ 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;
+}
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698