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

Unified Diff: src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp

Issue 1957363002: Replace GrStrokeInfo with GrStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@resscale
Patch Set: Fix issue where hairlines were going to MSAAPathRenderer Created 4 years, 7 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/GrAALinearizingConvexPathRenderer.cpp
diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
index 446f67f1c01a36f09595ce051580ac08640ba9a8..91d3338c32481fa41803f6d934604f0c2322dc6d 100644
--- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
@@ -17,7 +17,7 @@
#include "GrPathUtils.h"
#include "GrProcessor.h"
#include "GrPipelineBuilder.h"
-#include "GrStrokeInfo.h"
+#include "GrStyle.h"
#include "SkGeometry.h"
#include "SkString.h"
#include "SkTraceEvent.h"
@@ -46,16 +46,20 @@ bool GrAALinearizingConvexPathRenderer::onCanDrawPath(const CanDrawPathArgs& arg
if (!args.fPath->isConvex()) {
return false;
}
- if (args.fStroke->getStyle() == SkStrokeRec::kStroke_Style) {
+ if (args.fStyle->pathEffect()) {
+ return false;
+ }
+ const SkStrokeRec& stroke = args.fStyle->strokeRec();
+ if (stroke.getStyle() == SkStrokeRec::kStroke_Style) {
if (!args.fViewMatrix->isSimilarity()) {
return false;
}
- SkScalar strokeWidth = args.fViewMatrix->getMaxScale() * args.fStroke->getWidth();
- return strokeWidth >= 1.0f && strokeWidth <= kMaxStrokeWidth && !args.fStroke->isDashed() &&
- SkPathPriv::IsClosedSingleContour(*args.fPath) &&
- args.fStroke->getJoin() != SkPaint::Join::kRound_Join;
+ SkScalar strokeWidth = args.fViewMatrix->getMaxScale() * stroke.getWidth();
+ return strokeWidth >= 1.0f && strokeWidth <= kMaxStrokeWidth &&
+ SkPathPriv::IsClosedSingleContour(*args.fPath) &&
+ stroke.getJoin() != SkPaint::Join::kRound_Join;
}
- return args.fStroke->getStyle() == SkStrokeRec::kFill_Style;
+ return stroke.getStyle() == SkStrokeRec::kFill_Style;
}
// extract the result vertices and indices from the GrAAConvexTessellator
@@ -325,10 +329,10 @@ bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
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();
+ bool fill = args.fStyle->isSimpleFill();
+ geometry.fStrokeWidth = fill ? -1.0f : args.fStyle->strokeRec().getWidth();
+ geometry.fJoin = fill ? SkPaint::Join::kMiter_Join : args.fStyle->strokeRec().getJoin();
+ geometry.fMiterLimit = args.fStyle->strokeRec().getMiter();
SkAutoTUnref<GrDrawBatch> batch(AAFlatteningConvexPathBatch::Create(geometry));
args.fTarget->drawBatch(*args.fPipelineBuilder, batch);

Powered by Google App Engine
This is Rietveld 408576698