diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-09-07 13:22:46 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-07 22:18:53 +0000 |
commit | 5ed4423090e63e4c7888d6dd44fde177adea13f3 (patch) | |
tree | 83a3f92bc0630a8777d08bd9da1a097c82943b14 /src/gpu/GrSoftwarePathRenderer.cpp | |
parent | 2199e0bc7cbd2c834a93ab2cc83ee1bfdd79a0ed (diff) |
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: Ia339567800a3127e61b9beaed19504cd504f18af
Reviewed-on: https://skia-review.googlesource.com/43761
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrSoftwarePathRenderer.cpp')
-rw-r--r-- | src/gpu/GrSoftwarePathRenderer.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index 5780cee4e8..37433ff0c4 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -22,11 +22,16 @@ #include "ops/GrRectOpFactory.h" //////////////////////////////////////////////////////////////////////////////// -bool GrSoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { +GrPathRenderer::CanDrawPath +GrSoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { // Pass on any style that applies. The caller will apply the style if a suitable renderer is // not found and try again with the new GrShape. - return !args.fShape->style().applies() && SkToBool(fResourceProvider) && - (args.fAAType == GrAAType::kCoverage || args.fAAType == GrAAType::kNone); + if (!args.fShape->style().applies() && SkToBool(fResourceProvider) && + (args.fAAType == GrAAType::kCoverage || args.fAAType == GrAAType::kNone)) { + // This is the fallback renderer for when a path is too complicated for the GPU ones. + return CanDrawPath::kAsBackup; + } + return CanDrawPath::kNo; } //////////////////////////////////////////////////////////////////////////////// |