diff --git a/include/gpu/GrRecordingContext.h b/include/gpu/GrRecordingContext.h index a6d3c98653..218b15f613 100644 --- a/include/gpu/GrRecordingContext.h +++ b/include/gpu/GrRecordingContext.h @@ -128,7 +128,8 @@ protected: }; GrRecordingContext(sk_sp); - void setupDrawingManager(bool reduceOpsTaskSplitting); + + bool init() override; void abandonContext() override; diff --git a/src/gpu/GrDDLContext.cpp b/src/gpu/GrDDLContext.cpp index 3919df4d9a..82c547503a 100644 --- a/src/gpu/GrDDLContext.cpp +++ b/src/gpu/GrDDLContext.cpp @@ -32,17 +32,6 @@ public: } private: - bool init() override { - if (!INHERITED::init()) { - return false; - } - - // DDL contexts/drawing managers always attempt to reduce opsTask splitting. - this->setupDrawingManager(/* reduceOpsTaskSplitting */true); - - return true; - } - // Add to the set of unique program infos required by this DDL void recordProgramInfo(const GrProgramInfo* programInfo) final { if (!programInfo) { diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp index b7d440525a..324fcfdbdc 100644 --- a/src/gpu/GrDirectContext.cpp +++ b/src/gpu/GrDirectContext.cpp @@ -48,12 +48,6 @@ # endif #endif -#ifdef SK_DISABLE_REDUCE_OPLIST_SPLITTING -static const bool kDefaultReduceOpsTaskSplitting = false; -#else -static const bool kDefaultReduceOpsTaskSplitting = false; -#endif - #define ASSERT_SINGLE_OWNER GR_ASSERT_SINGLE_OWNER(this->singleOwner()) GrDirectContext::GrDirectContext(GrBackendApi backend, const GrContextOptions& options) @@ -212,15 +206,6 @@ bool GrDirectContext::init() { fShaderErrorHandler = GrShaderUtils::DefaultShaderErrorHandler(); } - bool reduceOpsTaskSplitting = kDefaultReduceOpsTaskSplitting; - if (GrContextOptions::Enable::kNo == this->options().fReduceOpsTaskSplitting) { - reduceOpsTaskSplitting = false; - } else if (GrContextOptions::Enable::kYes == this->options().fReduceOpsTaskSplitting) { - reduceOpsTaskSplitting = true; - } - - this->setupDrawingManager(reduceOpsTaskSplitting); - GrDrawOpAtlas::AllowMultitexturing allowMultitexturing; if (GrContextOptions::Enable::kNo == this->options().fAllowMultipleGlyphCacheTextures || // multitexturing supported only if range can represent the index + texcoords fully diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h index 5c842cfb54..9d94316399 100644 --- a/src/gpu/GrDrawingManager.h +++ b/src/gpu/GrDrawingManager.h @@ -221,7 +221,7 @@ private: GrTokenTracker fTokenTracker; bool fFlushing; - bool fReduceOpsTaskSplitting; + const bool fReduceOpsTaskSplitting; SkTArray fOnFlushCBObjects; diff --git a/src/gpu/GrRecordingContext.cpp b/src/gpu/GrRecordingContext.cpp index 969bc1f603..bf025c700b 100644 --- a/src/gpu/GrRecordingContext.cpp +++ b/src/gpu/GrRecordingContext.cpp @@ -50,7 +50,11 @@ int GrRecordingContext::maxSurfaceSampleCountForColorType(SkColorType colorType) return this->caps()->maxRenderTargetSampleCount(format); } -void GrRecordingContext::setupDrawingManager(bool reduceOpsTaskSplitting) { +bool GrRecordingContext::init() { + if (!INHERITED::init()) { + return false; + } + GrPathRendererChain::Options prcOptions; prcOptions.fAllowPathMaskCaching = this->options().fAllowPathMaskCaching; #if GR_TEST_UTILS @@ -64,9 +68,16 @@ void GrRecordingContext::setupDrawingManager(bool reduceOpsTaskSplitting) { prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall; } + bool reduceOpsTaskSplitting = false; + if (GrContextOptions::Enable::kYes == this->options().fReduceOpsTaskSplitting) { + reduceOpsTaskSplitting = true; + } else if (GrContextOptions::Enable::kNo == this->options().fReduceOpsTaskSplitting) { + reduceOpsTaskSplitting = false; + } fDrawingManager.reset(new GrDrawingManager(this, prcOptions, reduceOpsTaskSplitting)); + return true; } void GrRecordingContext::abandonContext() {