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

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

Issue 2318183002: Revert of Make AALinearizingConvexPathRenderer able to handle stroke and fill (Closed)
Patch Set: Created 4 years, 3 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/GrAAConvexTessellator.cpp ('k') | no next file » | 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 c2873b6a404b4bf0dc52872ddbde41b0c5a4da6f..20d93d8e9009935e7e8c70aee1559b3e5b26610e 100644
--- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
@@ -50,17 +50,12 @@
return false;
}
const SkStrokeRec& stroke = args.fShape->style().strokeRec();
-
- if (stroke.getStyle() == SkStrokeRec::kStroke_Style ||
- stroke.getStyle() == SkStrokeRec::kStrokeAndFill_Style) {
+ if (stroke.getStyle() == SkStrokeRec::kStroke_Style) {
if (!args.fViewMatrix->isSimilarity()) {
return false;
}
SkScalar strokeWidth = args.fViewMatrix->getMaxScale() * stroke.getWidth();
- if (strokeWidth < 1.0f && stroke.getStyle() == SkStrokeRec::kStroke_Style) {
- return false;
- }
- return strokeWidth <= kMaxStrokeWidth &&
+ return strokeWidth >= 1.0f && strokeWidth <= kMaxStrokeWidth &&
args.fShape->knownToBeClosed() &&
stroke.getJoin() != SkPaint::Join::kRound_Join;
}
@@ -131,11 +126,9 @@
const SkMatrix& viewMatrix,
const SkPath& path,
SkScalar strokeWidth,
- SkStrokeRec::Style style,
SkPaint::Join join,
SkScalar miterLimit) : INHERITED(ClassID()) {
- fGeoData.emplace_back(Geometry{ color, viewMatrix, path,
- strokeWidth, style, join, miterLimit });
+ fGeoData.emplace_back(Geometry{color, viewMatrix, path, strokeWidth, join, miterLimit});
// compute bounds
SkRect bounds = path.getBounds();
@@ -236,8 +229,7 @@
uint16_t* indices = (uint16_t*) sk_malloc_throw(maxIndices * sizeof(uint16_t));
for (int i = 0; i < instanceCount; i++) {
const Geometry& args = fGeoData[i];
- GrAAConvexTessellator tess(args.fStyle, args.fStrokeWidth,
- args.fJoin, args.fMiterLimit);
+ GrAAConvexTessellator tess(args.fStrokeWidth, args.fJoin, args.fMiterLimit);
if (!tess.tessellate(args.fViewMatrix, args.fPath)) {
continue;
@@ -317,7 +309,6 @@
SkMatrix fViewMatrix;
SkPath fPath;
SkScalar fStrokeWidth;
- SkStrokeRec::Style fStyle;
SkPaint::Join fJoin;
SkScalar fMiterLimit;
};
@@ -333,7 +324,6 @@
"GrAALinearizingConvexPathRenderer::onDrawPath");
SkASSERT(!args.fDrawContext->isUnifiedMultisampled());
SkASSERT(!args.fShape->isEmpty());
- SkASSERT(!args.fShape->style().pathEffect());
SkPath path;
args.fShape->asPath(&path);
@@ -345,9 +335,8 @@
SkAutoTUnref<GrDrawBatch> batch(new AAFlatteningConvexPathBatch(args.fPaint->getColor(),
*args.fViewMatrix,
- path, strokeWidth,
- stroke.getStyle(),
- join, miterLimit));
+ path, strokeWidth, join,
+ miterLimit));
GrPipelineBuilder pipelineBuilder(*args.fPaint);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
@@ -365,29 +354,10 @@
GrColor color = GrRandomColor(random);
SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random);
SkPath path = GrTest::TestPathConvex(random);
-
- SkStrokeRec::Style styles[3] = { SkStrokeRec::kFill_Style,
- SkStrokeRec::kStroke_Style,
- SkStrokeRec::kStrokeAndFill_Style };
-
- SkStrokeRec::Style style = styles[random->nextU() % 3];
-
- SkScalar strokeWidth = -1.f;
+ SkScalar strokeWidth = random->nextBool() ? -1.f : 2.f;
SkPaint::Join join = SkPaint::kMiter_Join;
SkScalar miterLimit = 0.5f;
-
- if (SkStrokeRec::kFill_Style != style) {
- strokeWidth = random->nextRangeF(1.0f, 10.0f);
- if (random->nextBool()) {
- join = SkPaint::kMiter_Join;
- } else {
- join = SkPaint::kBevel_Join;
- }
- miterLimit = random->nextRangeF(0.5f, 2.0f);
- }
-
- return new AAFlatteningConvexPathBatch(color, viewMatrix, path, strokeWidth,
- style, join, miterLimit);
+ return new AAFlatteningConvexPathBatch(color, viewMatrix, path, strokeWidth, join, miterLimit);
}
#endif
« no previous file with comments | « src/gpu/batches/GrAAConvexTessellator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698