Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: src/gpu/GrPathRendererChain.cpp

Issue 1950893002: Make GrPathRenderer only support fills for path stenciling (Closed) Base URL: https://skia.googlesource.com/skia.git@styleiface
Patch Set: Set draw params to fill in default impl of GrPR::onStencilPath Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrPathRenderer.h ('k') | src/gpu/GrSoftwarePathRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathRendererChain.cpp
diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp
index e19a134467a869311902fc31eec50574c38f9df0..c9e21ad60cd90f830be10bb6e7b0338d69819114 100644
--- a/src/gpu/GrPathRendererChain.cpp
+++ b/src/gpu/GrPathRendererChain.cpp
@@ -60,9 +60,10 @@ GrPathRenderer* GrPathRendererChain::addPathRenderer(GrPathRenderer* pr) {
return pr;
}
-GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrPathRenderer::CanDrawPathArgs& args,
- DrawType drawType,
- GrPathRenderer::StencilSupport* stencilSupport) {
+GrPathRenderer* GrPathRendererChain::getPathRenderer(
+ const GrPathRenderer::CanDrawPathArgs& args,
+ DrawType drawType,
+ GrPathRenderer::StencilSupport* stencilSupport) {
GR_STATIC_ASSERT(GrPathRenderer::kNoSupport_StencilSupport <
GrPathRenderer::kStencilOnly_StencilSupport);
GR_STATIC_ASSERT(GrPathRenderer::kStencilOnly_StencilSupport <
@@ -76,12 +77,18 @@ GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrPathRenderer::CanDr
} else {
minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport;
}
+ if (minStencilSupport != GrPathRenderer::kNoSupport_StencilSupport) {
+ // We don't support (and shouldn't need) stenciling of non-fill paths.
+ if (!args.fStroke->isFillStyle() || args.fStroke->isDashed()) {
+ return nullptr;
+ }
+ }
for (int i = 0; i < fChain.count(); ++i) {
if (fChain[i]->canDrawPath(args)) {
if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport) {
GrPathRenderer::StencilSupport support =
- fChain[i]->getStencilSupport(*args.fPath, *args.fStroke);
+ fChain[i]->getStencilSupport(*args.fPath);
if (support < minStencilSupport) {
continue;
} else if (stencilSupport) {
« no previous file with comments | « src/gpu/GrPathRenderer.h ('k') | src/gpu/GrSoftwarePathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698