Remove style application from GrPathRenderer subclasses
Now that GrPathRenderer is using GrShape it is possible to get a key for a path that was computed by applying style to an original path.
This improves path renderer subclass selection, particularly when a post-styled path happens to work with a simpler path renderer (e.g. it is convex). Previously a more expensive path renderer may have applied the style and rendered it (e.g. the distance field PR)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2064753003
Review-Url: https://codereview.chromium.org/2064753003
diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp
index 31b9ebf..c4b8835 100644
--- a/src/gpu/batches/GrMSAAPathRenderer.cpp
+++ b/src/gpu/batches/GrMSAAPathRenderer.cpp
@@ -709,11 +709,10 @@
}
bool GrMSAAPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
- // This path renderer does not support hairlines. We defer on anything that could be handled
- // as a hairline by another path renderer. Also, arbitrary path effects could produce
- // a hairline result.
- return !IsStrokeHairlineOrEquivalent(args.fShape->style(), *args.fViewMatrix, nullptr) &&
- !args.fShape->style().couldBeHairline() && !args.fAntiAlias;
+ // This path renderer only fills and relies on MSAA for antialiasing. Stroked shapes are
+ // handled by passing on the original shape and letting the caller compute the stroked shape
+ // which will have a fill style.
+ return args.fShape->style().isSimpleFill() && !args.fAntiAlias;
}
bool GrMSAAPathRenderer::onDrawPath(const DrawPathArgs& args) {