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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 1265763002: Args structs to GrPathRenderer functions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 years, 5 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/GrAAHairLinePathRenderer.h ('k') | src/gpu/GrAALinearizingConvexPathRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAHairLinePathRenderer.cpp
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 6b1f8a41f770cc1823e61fe2c46c0516f3de052b..ca83f6acc291d954f8b45f50d945ae261e971bb1 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -616,22 +616,17 @@ static void add_line(const SkPoint p[2],
///////////////////////////////////////////////////////////////////////////////
-bool GrAAHairLinePathRenderer::canDrawPath(const GrDrawTarget* target,
- const GrPipelineBuilder* pipelineBuilder,
- const SkMatrix& viewMatrix,
- const SkPath& path,
- const GrStrokeInfo& stroke,
- bool antiAlias) const {
- if (!antiAlias) {
+bool GrAAHairLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+ if (!args.fAntiAlias) {
return false;
}
- if (!IsStrokeHairlineOrEquivalent(stroke, viewMatrix, NULL)) {
+ if (!IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix, NULL)) {
return false;
}
- if (SkPath::kLine_SegmentMask == path.getSegmentMasks() ||
- target->caps()->shaderCaps()->shaderDerivativeSupport()) {
+ if (SkPath::kLine_SegmentMask == args.fPath->getSegmentMasks() ||
+ args.fTarget->caps()->shaderCaps()->shaderDerivativeSupport()) {
return true;
}
return false;
@@ -974,20 +969,14 @@ static GrBatch* create_hairline_batch(GrColor color,
return AAHairlineBatch::Create(geometry);
}
-bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
- GrColor color,
- const SkMatrix& viewMatrix,
- const SkPath& path,
- const GrStrokeInfo& stroke,
- bool) {
+bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
SkIRect devClipBounds;
- pipelineBuilder->clip().getConservativeBounds(pipelineBuilder->getRenderTarget(),
- &devClipBounds);
+ args.fPipelineBuilder->clip().getConservativeBounds(args.fPipelineBuilder->getRenderTarget(),
+ &devClipBounds);
- SkAutoTUnref<GrBatch> batch(create_hairline_batch(color, viewMatrix, path, stroke,
- devClipBounds));
- target->drawBatch(*pipelineBuilder, batch);
+ SkAutoTUnref<GrBatch> batch(create_hairline_batch(args.fColor, *args.fViewMatrix, *args.fPath,
+ *args.fStroke, devClipBounds));
+ args.fTarget->drawBatch(*args.fPipelineBuilder, batch);
return true;
}
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.h ('k') | src/gpu/GrAALinearizingConvexPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698