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

Unified Diff: src/gpu/GrTessellatingPathRenderer.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/GrTessellatingPathRenderer.h ('k') | src/gpu/GrTest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTessellatingPathRenderer.cpp
diff --git a/src/gpu/GrTessellatingPathRenderer.cpp b/src/gpu/GrTessellatingPathRenderer.cpp
index f420372ca516c708c89d1ea6152ea02b94903f11..6abfc4538f37461b7581e10ac64a754ab15e26fb 100644
--- a/src/gpu/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/GrTessellatingPathRenderer.cpp
@@ -1342,15 +1342,10 @@ GrPathRenderer::StencilSupport GrTessellatingPathRenderer::onGetStencilSupport(
return GrPathRenderer::kNoSupport_StencilSupport;
}
-bool GrTessellatingPathRenderer::canDrawPath(const GrDrawTarget* target,
- const GrPipelineBuilder* pipelineBuilder,
- const SkMatrix& viewMatrix,
- const SkPath& path,
- const GrStrokeInfo& stroke,
- bool antiAlias) const {
+bool GrTessellatingPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
// This path renderer can draw all fill styles, but does not do antialiasing. It can do convex
// and concave paths, but we'll leave the convex ones to simpler algorithms.
- return stroke.isFillStyle() && !antiAlias && !path.isConvex();
+ return args.fStroke->isFillStyle() && !args.fAntiAlias && !args.fPath->isConvex();
}
class TessellatingPathBatch : public GrBatch {
@@ -1489,29 +1484,24 @@ private:
GrPipelineInfo fPipelineInfo;
};
-bool GrTessellatingPathRenderer::onDrawPath(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
- GrColor color,
- const SkMatrix& viewM,
- const SkPath& path,
- const GrStrokeInfo&,
- bool antiAlias) {
- SkASSERT(!antiAlias);
- const GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
+bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) {
+ SkASSERT(!args.fAntiAlias);
+ const GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget();
if (NULL == rt) {
return false;
}
SkIRect clipBoundsI;
- pipelineBuilder->clip().getConservativeBounds(rt, &clipBoundsI);
+ args.fPipelineBuilder->clip().getConservativeBounds(rt, &clipBoundsI);
SkRect clipBounds = SkRect::Make(clipBoundsI);
SkMatrix vmi;
- if (!viewM.invert(&vmi)) {
+ if (!args.fViewMatrix->invert(&vmi)) {
return false;
}
vmi.mapRect(&clipBounds);
- SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM, clipBounds));
- target->drawBatch(*pipelineBuilder, batch);
+ SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(args.fColor, *args.fPath,
+ *args.fViewMatrix, clipBounds));
+ args.fTarget->drawBatch(*args.fPipelineBuilder, batch);
return true;
}
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.h ('k') | src/gpu/GrTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698