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/GrDrawingManager.cpp

Issue 2298003003: Don't purge resources for trivial GrContext flushes (Closed)
Patch Set: Fix speeling Created 4 years, 4 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/GrDrawingManager.h ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/gpu/GrDrawingManager.h ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698