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

Unified Diff: src/gpu/GrAALinearizingConvexPathRenderer.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/GrAALinearizingConvexPathRenderer.h ('k') | src/gpu/GrAddPathRenderers_default.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAALinearizingConvexPathRenderer.cpp
diff --git a/src/gpu/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/GrAALinearizingConvexPathRenderer.cpp
index d899e7d0841425dd598ebe0f4c48b0aa47551bf7..69f9d1cca10f41a55462c2f12f0b26932db9f6d8 100644
--- a/src/gpu/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/GrAALinearizingConvexPathRenderer.cpp
@@ -39,27 +39,23 @@ GrAALinearizingConvexPathRenderer::GrAALinearizingConvexPathRenderer() {
///////////////////////////////////////////////////////////////////////////////
-bool GrAALinearizingConvexPathRenderer::canDrawPath(const GrDrawTarget* target,
- const GrPipelineBuilder*,
- const SkMatrix& viewMatrix,
- const SkPath& path,
- const GrStrokeInfo& stroke,
- bool antiAlias) const {
- if (!antiAlias) {
+bool GrAALinearizingConvexPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+ if (!args.fAntiAlias) {
return false;
}
- if (path.isInverseFillType()) {
+ if (args.fPath->isInverseFillType()) {
return false;
}
- if (!path.isConvex()) {
+ if (!args.fPath->isConvex()) {
return false;
}
- if (stroke.getStyle() == SkStrokeRec::kStroke_Style) {
- return viewMatrix.isSimilarity() && stroke.getWidth() >= 1.0f &&
- stroke.getWidth() <= kMaxStrokeWidth && !stroke.isDashed() &&
- SkPathPriv::LastVerbIsClose(path) && stroke.getJoin() != SkPaint::Join::kRound_Join;
+ if (args.fStroke->getStyle() == SkStrokeRec::kStroke_Style) {
+ return args.fViewMatrix->isSimilarity() && args.fStroke->getWidth() >= 1.0f &&
+ args.fStroke->getWidth() <= kMaxStrokeWidth && !args.fStroke->isDashed() &&
+ SkPathPriv::LastVerbIsClose(*args.fPath) &&
+ args.fStroke->getJoin() != SkPaint::Join::kRound_Join;
}
- return stroke.getStyle() == SkStrokeRec::kFill_Style;
+ return args.fStroke->getStyle() == SkStrokeRec::kFill_Style;
}
// extract the result vertices and indices from the GrAAConvexTessellator
@@ -303,26 +299,21 @@ private:
SkSTArray<1, Geometry, true> fGeoData;
};
-bool GrAALinearizingConvexPathRenderer::onDrawPath(GrDrawTarget* target,
- GrPipelineBuilder* pipelineBuilder,
- GrColor color,
- const SkMatrix& vm,
- const SkPath& path,
- const GrStrokeInfo& stroke,
- bool antiAlias) {
- if (path.isEmpty()) {
+bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
+ if (args.fPath->isEmpty()) {
return true;
}
AAFlatteningConvexPathBatch::Geometry geometry;
- geometry.fColor = color;
- geometry.fViewMatrix = vm;
- geometry.fPath = path;
- geometry.fStrokeWidth = stroke.isFillStyle() ? -1.0f : stroke.getWidth();
- geometry.fJoin = stroke.isFillStyle() ? SkPaint::Join::kMiter_Join : stroke.getJoin();
- geometry.fMiterLimit = stroke.getMiter();
+ geometry.fColor = args.fColor;
+ geometry.fViewMatrix = *args.fViewMatrix;
+ geometry.fPath = *args.fPath;
+ geometry.fStrokeWidth = args.fStroke->isFillStyle() ? -1.0f : args.fStroke->getWidth();
+ geometry.fJoin = args.fStroke->isFillStyle() ? SkPaint::Join::kMiter_Join :
+ args.fStroke->getJoin();
+ geometry.fMiterLimit = args.fStroke->getMiter();
SkAutoTUnref<GrBatch> batch(AAFlatteningConvexPathBatch::Create(geometry));
- target->drawBatch(*pipelineBuilder, batch);
+ args.fTarget->drawBatch(*args.fPipelineBuilder, batch);
return true;
}
« no previous file with comments | « src/gpu/GrAALinearizingConvexPathRenderer.h ('k') | src/gpu/GrAddPathRenderers_default.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698