aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrDefaultPathRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/ops/GrDefaultPathRenderer.cpp')
-rw-r--r--src/gpu/ops/GrDefaultPathRenderer.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index e3b48a8db9..9741781013 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -609,15 +609,20 @@ bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTarget
return true;
}
-bool GrDefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+GrPathRenderer::CanDrawPath
+GrDefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
bool isHairline = IsStrokeHairlineOrEquivalent(args.fShape->style(), *args.fViewMatrix, nullptr);
// If we aren't a single_pass_shape or hairline, we require stencil buffers.
if (!(single_pass_shape(*args.fShape) || isHairline) && args.fCaps->avoidStencilBuffers()) {
- return false;
+ return CanDrawPath::kNo;
}
// This can draw any path with any simple fill style but doesn't do coverage-based antialiasing.
- return GrAAType::kCoverage != args.fAAType &&
- (args.fShape->style().isSimpleFill() || isHairline);
+ if (GrAAType::kCoverage == args.fAAType ||
+ (!args.fShape->style().isSimpleFill() && !isHairline)) {
+ return CanDrawPath::kNo;
+ }
+ // This is the fallback renderer for when a path is too complicated for the others to draw.
+ return CanDrawPath::kAsBackup;
}
bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) {