diff options
author | bsalomon <bsalomon@google.com> | 2016-09-06 12:38:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-06 12:38:00 -0700 |
commit | 1dbb207babecdae8f1f74ed9d9900c73064df744 (patch) | |
tree | 179554685d20ab291fe8ecfb89b4e2b8f98c44c7 /include/gpu/GrContext.h | |
parent | 0a441077dccd8b33ed1af3193b9d5df5143d4861 (diff) |
Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache.
Consolidates all flush actions into GrDrawingManager and makes GrContext::flush a passthrough.
Removes the unused and untested discard flush variation.
Replaces the indirect overbudget callback mechanism of GrResourceCache with a flag set by resource cache when it wants to flush that is checked after each draw by GrDrawContext.
Modifies GrResourceCache::notifyFlushOccurred() to take a param indicating whether it triggered the
flush that just occurred.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2307053002
Review-Url: https://codereview.chromium.org/2307053002
Diffstat (limited to 'include/gpu/GrContext.h')
-rw-r--r-- | include/gpu/GrContext.h | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index f14c36e35c..996b77f2db 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -214,31 +214,10 @@ public: // Misc. /** - * Flags that affect flush() behavior. - */ - enum FlushBits { - /** - * A client may reach a point where it has partially rendered a frame - * through a GrContext that it knows the user will never see. This flag - * causes the flush to skip submission of deferred content to the 3D API - * during the flush. - */ - kDiscard_FlushBit = 0x2, - }; - - /** * Call to ensure all drawing to the context has been issued to the * underlying 3D API. - * @param flagsBitfield flags that control the flushing behavior. See - * FlushBits. */ - void flush(int flagsBitfield = 0); - - void flushIfNecessary() { - if (fFlushToReduceCacheSize || this->caps()->immediateFlush()) { - this->flush(); - } - } + void flush(); /** * These flags can be used with the read/write pixels functions below. @@ -409,8 +388,6 @@ private: GrBatchFontCache* fBatchFontCache; SkAutoTDelete<GrTextBlobCache> fTextBlobCache; - // Set by OverbudgetCB() to request that GrContext flush before exiting a draw. - bool fFlushToReduceCacheSize; bool fDidTestPMConversions; int fPMToUPMConversion; int fUPMToPMConversion; @@ -472,12 +449,6 @@ private: bool didFailPMUPMConversionTest() const; /** - * This callback allows the resource cache to callback into the GrContext - * when the cache is still over budget after a purge. - */ - static void OverBudgetCB(void* data); - - /** * A callback similar to the above for use by the TextBlobCache * TODO move textblob draw calls below context so we can use the call above. */ |