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

Unified Diff: src/gpu/GrDrawingManager.cpp

Issue 2307053002: Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache. (Closed)
Patch Set: Fix uninit vars Created 4 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/GrDrawingManager.h ('k') | src/gpu/GrResourceCache.h » ('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 6c75c0d1474512a7db41b860f89a7e7680f1cca7..4642e1a3fe5e491d54856c9bdf1313060482701b 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -5,8 +5,10 @@
* found in the LICENSE file.
*/
-#include "GrDrawContext.h"
#include "GrDrawingManager.h"
+
+#include "GrContext.h"
+#include "GrDrawContext.h"
#include "GrDrawTarget.h"
#include "GrPathRenderingDrawContext.h"
#include "GrResourceProvider.h"
@@ -74,9 +76,9 @@ void GrDrawingManager::reset() {
fFlushState.reset();
}
-bool GrDrawingManager::flush() {
+void GrDrawingManager::internalFlush(GrResourceCache::FlushType type) {
if (fFlushing || this->wasAbandoned()) {
- return false;
+ return;
}
fFlushing = true;
bool flushed = false;
@@ -126,8 +128,11 @@ bool GrDrawingManager::flush() {
#endif
fFlushState.reset();
+ // We always have to notify the cache when it requested a flush so it can reset its state.
+ if (flushed || type == GrResourceCache::FlushType::kCacheRequested) {
+ fContext->getResourceCache()->notifyFlushOccurred(type);
+ }
fFlushing = false;
- return flushed;
}
GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) {
« no previous file with comments | « src/gpu/GrDrawingManager.h ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698