diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-09-07 18:33:08 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-07 18:33:22 +0000 |
commit | e5ede4b138e84d05d63c9ab7f426884dc9b4d926 (patch) | |
tree | dfbaa75e3d7d3e5e70deed7585419ce2610e9978 /src/gpu/GrPathRenderer.h | |
parent | b3e39f67599adf418215652fe714d3883dd5fd88 (diff) |
Revert "Improve GrPathRendererChain heuristics"
This reverts commit 60f42494f5d45c38e260ce089cdddfb600f799b2.
Reason for revert: breaking gold
Original change's description:
> Improve GrPathRendererChain heuristics
>
> Changes GrPathRenderer::canDrawPath to return a 'CanDrawPath' enum,
> which contains a new kAsBackup value that means "I'm better than SW,
> but give the path renderers below me a chance first."
>
> Bug: skia:
> Change-Id: I45aac5462ca1bc0bc839eb1c315db9493901a07e
> Reviewed-on: https://skia-review.googlesource.com/42222
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,brianosman@google.com,csmartdalton@google.com,senorblanco@google.com
Change-Id: I46020dbd56b6f6b88668894285b9b7b80f89b9a2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/43780
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrPathRenderer.h')
-rw-r--r-- | src/gpu/GrPathRenderer.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h index cf0ef6effc..a3cf8c6151 100644 --- a/src/gpu/GrPathRenderer.h +++ b/src/gpu/GrPathRenderer.h @@ -67,12 +67,6 @@ public: return this->onGetStencilSupport(shape); } - enum class CanDrawPath { - kNo, - kAsBackup, // i.e. This renderer is better than SW fallback if no others can draw the path. - kYes - }; - /** Args to canDrawPath() * * fCaps The context caps @@ -100,11 +94,13 @@ public: }; /** - * Returns how well this path renderer is able to render the given path. Returning kNo or - * kAsBackup allows the caller to keep searching for a better path renderer. This function is - * called when searching for the best path renderer to draw a path. + * Returns true if this path renderer is able to render the path. Returning false allows the + * caller to fallback to another path renderer This function is called when searching for a path + * renderer capable of rendering a path. + * + * @return true if the path can be drawn by this object, false otherwise. */ - CanDrawPath canDrawPath(const CanDrawPathArgs& args) const { + bool canDrawPath(const CanDrawPathArgs& args) const { SkDEBUGCODE(args.validate();) return this->onCanDrawPath(args); } @@ -162,7 +158,7 @@ public: GrFSAAType::kUnifiedMSAA != args.fRenderTargetContext->fsaaType())); SkASSERT(!(canArgs.fAAType == GrAAType::kMixedSamples && GrFSAAType::kMixedSamples != args.fRenderTargetContext->fsaaType())); - SkASSERT(CanDrawPath::kNo != this->canDrawPath(canArgs)); + SkASSERT(this->canDrawPath(canArgs)); if (!args.fUserStencilSettings->isUnused()) { SkPath path; args.fShape->asPath(&path); @@ -257,7 +253,7 @@ private: /** * Subclass implementation of canDrawPath() */ - virtual CanDrawPath onCanDrawPath(const CanDrawPathArgs& args) const = 0; + virtual bool onCanDrawPath(const CanDrawPathArgs& args) const = 0; /** * Subclass implementation of stencilPath(). Subclass must override iff it ever returns |