diff options
author | Robert Phillips <robertphillips@google.com> | 2018-02-08 10:59:38 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-08 16:28:30 +0000 |
commit | a3f70261ccf4c14648505fed8bdc517ceb1b925e (patch) | |
tree | 8cff94fc78cf47d242abbf39b426195dc56c3178 /src/gpu/GrDrawingManager.cpp | |
parent | f8cac792274b01901899a4fa6e4d571d218a3e05 (diff) |
Switch MDB GrContextOptions over to Enable style
Change-Id: Id6541c346a13649c89ca3b9ccb13972976f9b973
Reviewed-on: https://skia-review.googlesource.com/105603
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrDrawingManager.cpp')
-rw-r--r-- | src/gpu/GrDrawingManager.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index 703bc0a92d..cba23b4539 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -31,6 +31,41 @@ #include "GrTracing.h" #include "text/GrAtlasTextContext.h" +// Turn on/off the sorting of opLists at flush time +#ifndef SK_DISABLE_RENDER_TARGET_SORTING + #define SK_DISABLE_RENDER_TARGET_SORTING +#endif + +#ifdef SK_DISABLE_RENDER_TARGET_SORTING +static const bool kDefaultSortRenderTargets = false; +#else +static const bool kDefaultSortRenderTargets = true; +#endif + +GrDrawingManager::GrDrawingManager(GrContext* context, + const GrPathRendererChain::Options& optionsForPathRendererChain, + const GrAtlasTextContext::Options& optionsForAtlasTextContext, + GrSingleOwner* singleOwner, + GrContextOptions::Enable sortRenderTargets) + : fContext(context) + , fOptionsForPathRendererChain(optionsForPathRendererChain) + , fOptionsForAtlasTextContext(optionsForAtlasTextContext) + , fSingleOwner(singleOwner) + , fAbandoned(false) + , fAtlasTextContext(nullptr) + , fPathRendererChain(nullptr) + , fSoftwarePathRenderer(nullptr) + , fFlushing(false) { + + if (GrContextOptions::Enable::kNo == sortRenderTargets) { + fSortRenderTargets = false; + } else if (GrContextOptions::Enable::kYes == sortRenderTargets) { + fSortRenderTargets = true; + } else { + fSortRenderTargets = kDefaultSortRenderTargets; + } +} + void GrDrawingManager::cleanup() { for (int i = 0; i < fOpLists.count(); ++i) { // no opList should receive a new command after this |