Have DDLs honor the reduceOpsTaskSplittingFlag

Especially while I'm fiddling with the implementation, we don't
want the user to be surprised when using DDLs also triggers
this other codepath.

Bug: skia:10877
Change-Id: I660ea08189fff45acd7a45df12e15c45f607758a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332720
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
This commit is contained in:
Adlai Holler 2020-11-06 13:45:50 -05:00 committed by Skia Commit-Bot
parent e886b8e8b1
commit d7b59c091d
5 changed files with 15 additions and 29 deletions

View File

@ -128,7 +128,8 @@ protected:
};
GrRecordingContext(sk_sp<GrContextThreadSafeProxy>);
void setupDrawingManager(bool reduceOpsTaskSplitting);
bool init() override;
void abandonContext() override;

View File

@ -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) {

View File

@ -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

View File

@ -221,7 +221,7 @@ private:
GrTokenTracker fTokenTracker;
bool fFlushing;
bool fReduceOpsTaskSplitting;
const bool fReduceOpsTaskSplitting;
SkTArray<GrOnFlushCallbackObject*> fOnFlushCBObjects;

View File

@ -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() {