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

Unified Diff: src/gpu/GrSoftwarePathRenderer.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/GrSoftwarePathRenderer.h ('k') | src/gpu/GrStencilAndCoverPathRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSoftwarePathRenderer.cpp
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 5389a9bcb6b21921d6b7d0183567567d3910c341..401246ea5c6f7e0c3afb1f3298124d2d46a5061e 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -12,16 +12,11 @@
#include "GrVertexBuffer.h"
////////////////////////////////////////////////////////////////////////////////
-bool GrSoftwarePathRenderer::canDrawPath(const GrDrawTarget*,
- const GrPipelineBuilder*,
- const SkMatrix& viewMatrix,
- const SkPath&,
- const GrStrokeInfo& stroke,
- bool antiAlias) const {
+bool GrSoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
if (NULL == fContext) {
return false;
}
- if (stroke.isDashed()) {
+ if (args.fStroke->isDashed()) {
return false;
}
return true;
@@ -117,41 +112,35 @@ void draw_around_inv_path(GrDrawTarget* target,
////////////////////////////////////////////////////////////////////////////////
// return true on success; false on failure
-bool GrSoftwarePathRenderer::onDrawPath(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
- GrColor color,
- const SkMatrix& viewMatrix,
- const SkPath& path,
- const GrStrokeInfo& stroke,
- bool antiAlias) {
+bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
if (NULL == fContext) {
return false;
}
SkIRect devPathBounds, devClipBounds;
- if (!get_path_and_clip_bounds(target, pipelineBuilder, path, viewMatrix, &devPathBounds,
- &devClipBounds)) {
- if (path.isInverseFillType()) {
- draw_around_inv_path(target, pipelineBuilder, color, viewMatrix, devClipBounds,
- devPathBounds);
+ if (!get_path_and_clip_bounds(args.fTarget, args.fPipelineBuilder, *args.fPath,
+ *args.fViewMatrix, &devPathBounds, &devClipBounds)) {
+ if (args.fPath->isInverseFillType()) {
+ draw_around_inv_path(args.fTarget, args.fPipelineBuilder, args.fColor,
+ *args.fViewMatrix, devClipBounds, devPathBounds);
}
return true;
}
SkAutoTUnref<GrTexture> texture(
- GrSWMaskHelper::DrawPathMaskToTexture(fContext, path, stroke,
+ GrSWMaskHelper::DrawPathMaskToTexture(fContext, *args.fPath, *args.fStroke,
devPathBounds,
- antiAlias, &viewMatrix));
+ args.fAntiAlias, args.fViewMatrix));
if (NULL == texture) {
return false;
}
- GrSWMaskHelper::DrawToTargetWithPathMask(texture, target, pipelineBuilder, color, viewMatrix,
- devPathBounds);
+ GrSWMaskHelper::DrawToTargetWithPathMask(texture, args.fTarget, args.fPipelineBuilder,
+ args.fColor, *args.fViewMatrix, devPathBounds);
- if (path.isInverseFillType()) {
- draw_around_inv_path(target, pipelineBuilder, color, viewMatrix, devClipBounds,
- devPathBounds);
+ if (args.fPath->isInverseFillType()) {
+ draw_around_inv_path(args.fTarget, args.fPipelineBuilder, args.fColor, *args.fViewMatrix,
+ devClipBounds, devPathBounds);
}
return true;
« no previous file with comments | « src/gpu/GrSoftwarePathRenderer.h ('k') | src/gpu/GrStencilAndCoverPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698