Index: src/gpu/GrDrawingManager.cpp |
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp |
index df6bffdaa005926b70770ab0e3ef8a7a6f62d0ed..6c75c0d1474512a7db41b860f89a7e7680f1cca7 100644 |
--- a/src/gpu/GrDrawingManager.cpp |
+++ b/src/gpu/GrDrawingManager.cpp |
@@ -74,12 +74,12 @@ void GrDrawingManager::reset() { |
fFlushState.reset(); |
} |
-void GrDrawingManager::flush() { |
+bool GrDrawingManager::flush() { |
if (fFlushing || this->wasAbandoned()) { |
- return; |
+ return false; |
} |
fFlushing = true; |
- |
+ bool flushed = false; |
SkDEBUGCODE(bool result =) |
SkTTopoSort<GrDrawTarget, GrDrawTarget::TopoSortTraits>(&fDrawTargets); |
SkASSERT(result); |
@@ -99,7 +99,9 @@ void GrDrawingManager::flush() { |
fFlushState.preIssueDraws(); |
for (int i = 0; i < fDrawTargets.count(); ++i) { |
- fDrawTargets[i]->drawBatches(&fFlushState); |
+ if (fDrawTargets[i]->drawBatches(&fFlushState)) { |
+ flushed = true; |
+ } |
} |
SkASSERT(fFlushState.nextDrawToken() == fFlushState.nextTokenToFlush()); |
@@ -125,6 +127,7 @@ void GrDrawingManager::flush() { |
fFlushState.reset(); |
fFlushing = false; |
+ return flushed; |
} |
GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) { |