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

Unified Diff: src/gpu/GrDrawingManager.h

Issue 2307053002: Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache. (Closed)
Patch Set: cleanup 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
Index: src/gpu/GrDrawingManager.h
diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h
index 745820f439b62ff2db98a3e9d5edb4c194faba8b..5faf747f3297fa2d79f37194644e66b7c0b5938c 100644
--- a/src/gpu/GrDrawingManager.h
+++ b/src/gpu/GrDrawingManager.h
@@ -13,6 +13,7 @@
#include "GrBatchFlushState.h"
#include "GrPathRendererChain.h"
#include "GrPathRenderer.h"
+#include "GrResourceCache.h"
#include "SkTDArray.h"
class GrContext;
@@ -49,6 +50,12 @@ public:
GrPathRendererChain::DrawType drawType,
GrPathRenderer::StencilSupport* stencilSupport = NULL);
+ void flushIfNecessary() {
robertphillips 2016/09/02 16:23:06 What happened to "this->caps()->immediateFlush()"
+ if (fContext->getResourceCache()->requestsFlush()) {
+ this->internalFlush(GrResourceCache::kCacheRequested);
+ }
+ }
+
static bool ProgramUnitTest(GrContext* context, int maxStages);
private:
@@ -68,8 +75,8 @@ private:
void abandon();
void cleanup();
void reset();
- /** Returns true if there was anything to flush and false otherwise */
- bool flush();
+ void flush() { this->internalFlush(GrResourceCache::FlushType::kExternal); }
+ void internalFlush(GrResourceCache::FlushType);
friend class GrContext; // for access to: ctor, abandon, reset & flush

Powered by Google App Engine
This is Rietveld 408576698