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

Unified Diff: src/gpu/batches/GrAAHairLinePathRenderer.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
Index: src/gpu/batches/GrAAHairLinePathRenderer.cpp
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index f44c454bb5fff2d2b691c506e47600f2d05dc736..1f7407c5f633dc4731b10cf304051830c7524c0d 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -618,19 +618,20 @@ bool GrAAHairLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const
return false;
}
- if (!IsStrokeHairlineOrEquivalent(*args.fStyle, *args.fViewMatrix, nullptr)) {
+ if (!IsStrokeHairlineOrEquivalent(args.fShape->style(), *args.fViewMatrix, nullptr)) {
return false;
}
// We don't currently handle dashing in this class though perhaps we should.
- if (args.fStyle->pathEffect()) {
+ if (args.fShape->style().pathEffect()) {
return false;
}
- if (SkPath::kLine_SegmentMask == args.fPath->getSegmentMasks() ||
+ if (SkPath::kLine_SegmentMask == args.fShape->segmentMask() ||
args.fShaderCaps->shaderDerivativeSupport()) {
return true;
}
+
return false;
}
@@ -971,12 +972,13 @@ bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawContext->height(),
&devClipBounds);
- SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fViewMatrix, *args.fPath,
- *args.fStyle, devClipBounds));
+ SkPath path;
+ args.fShape->asPath(&path);
+ SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fViewMatrix, path,
+ args.fShape->style(), devClipBounds));
GrPipelineBuilder pipelineBuilder(*args.fPaint);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
-
args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
return true;
« no previous file with comments | « src/gpu/batches/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698