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

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

Issue 1967513002: Revert of Replace GrStrokeInfo with GrStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@resscale
Patch Set: 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
« no previous file with comments | « src/gpu/batches/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/batches/GrDashLinePathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
index 91d3338c32481fa41803f6d934604f0c2322dc6d..446f67f1c01a36f09595ce051580ac08640ba9a8 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 "GrStyle.h"
+#include "GrStrokeInfo.h"
#include "SkGeometry.h"
#include "SkString.h"
#include "SkTraceEvent.h"
@@ -46,20 +46,16 @@
if (!args.fPath->isConvex()) {
return false;
}
- if (args.fStyle->pathEffect()) {
- return false;
- }
- const SkStrokeRec& stroke = args.fStyle->strokeRec();
- if (stroke.getStyle() == SkStrokeRec::kStroke_Style) {
+ if (args.fStroke->getStyle() == SkStrokeRec::kStroke_Style) {
if (!args.fViewMatrix->isSimilarity()) {
return false;
}
- SkScalar strokeWidth = args.fViewMatrix->getMaxScale() * stroke.getWidth();
- return strokeWidth >= 1.0f && strokeWidth <= kMaxStrokeWidth &&
- SkPathPriv::IsClosedSingleContour(*args.fPath) &&
- stroke.getJoin() != SkPaint::Join::kRound_Join;
- }
- return stroke.getStyle() == SkStrokeRec::kFill_Style;
+ 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;
+ }
+ return args.fStroke->getStyle() == SkStrokeRec::kFill_Style;
}
// extract the result vertices and indices from the GrAAConvexTessellator
@@ -329,10 +325,10 @@
geometry.fColor = args.fColor;
geometry.fViewMatrix = *args.fViewMatrix;
geometry.fPath = *args.fPath;
- 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();
+ 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<GrDrawBatch> batch(AAFlatteningConvexPathBatch::Create(geometry));
args.fTarget->drawBatch(*args.fPipelineBuilder, batch);
« no previous file with comments | « src/gpu/batches/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/batches/GrDashLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698