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

Unified Diff: src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp

Issue 2081383006: Use GrShape in GrPathRenderer. (Closed) Base URL: https://chromium.googlesource.com/skia.git@shapemembers
Patch Set: Address comments Created 4 years, 6 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/batches/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/batches/GrDashLinePathRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
index 1847a673e2abda0beb5d4bb7ce5ea444c6409e97..97488293862dc0cb3bff0269581127707ce957a3 100644
--- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
@@ -40,23 +40,23 @@ bool GrAALinearizingConvexPathRenderer::onCanDrawPath(const CanDrawPathArgs& arg
if (!args.fAntiAlias) {
return false;
}
- if (args.fPath->isInverseFillType()) {
+ if (!args.fShape->knownToBeConvex()) {
return false;
}
- if (!args.fPath->isConvex()) {
+ if (args.fShape->style().pathEffect()) {
return false;
}
- if (args.fStyle->pathEffect()) {
+ if (args.fShape->inverseFilled()) {
return false;
}
- const SkStrokeRec& stroke = args.fStyle->strokeRec();
+ const SkStrokeRec& stroke = args.fShape->style().strokeRec();
if (stroke.getStyle() == SkStrokeRec::kStroke_Style) {
if (!args.fViewMatrix->isSimilarity()) {
return false;
}
SkScalar strokeWidth = args.fViewMatrix->getMaxScale() * stroke.getWidth();
return strokeWidth >= 1.0f && strokeWidth <= kMaxStrokeWidth &&
- SkPathPriv::IsClosedSingleContour(*args.fPath) &&
+ args.fShape->knownToBeClosed() &&
stroke.getJoin() != SkPaint::Join::kRound_Join;
}
return stroke.getStyle() == SkStrokeRec::kFill_Style;
@@ -324,18 +324,17 @@ bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
"GrAALinearizingConvexPathRenderer::onDrawPath");
SkASSERT(!args.fDrawContext->isUnifiedMultisampled());
+ SkASSERT(!args.fShape->isEmpty());
- if (args.fPath->isEmpty()) {
- return true;
- }
AAFlatteningConvexPathBatch::Geometry geometry;
geometry.fColor = args.fColor;
geometry.fViewMatrix = *args.fViewMatrix;
- geometry.fPath = *args.fPath;
- bool fill = args.fStyle->isSimpleFill();
- geometry.fStrokeWidth = fill ? -1.0f : args.fStyle->strokeRec().getWidth();
- geometry.fJoin = fill ? SkPaint::Join::kMiter_Join : args.fStyle->strokeRec().getJoin();
- geometry.fMiterLimit = args.fStyle->strokeRec().getMiter();
+ args.fShape->asPath(&geometry.fPath);
+ bool fill = args.fShape->style().isSimpleFill();
+ const SkStrokeRec& stroke = args.fShape->style().strokeRec();
+ geometry.fStrokeWidth = fill ? -1.0f : stroke.getWidth();
+ geometry.fJoin = fill ? SkPaint::Join::kMiter_Join : stroke.getJoin();
+ geometry.fMiterLimit = stroke.getMiter();
SkAutoTUnref<GrDrawBatch> batch(AAFlatteningConvexPathBatch::Create(geometry));
« no previous file with comments | « src/gpu/batches/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/batches/GrDashLinePathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698