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

Unified Diff: src/gpu/batches/GrAAHairLinePathRenderer.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
Index: src/gpu/batches/GrAAHairLinePathRenderer.cpp
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index db4bbdfdb3a1923549428105a79f278ae051331b..effd8c3b0ff935a6ba067b1efd1c2045fe9dc4c4 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -618,12 +618,7 @@
return false;
}
- if (!IsStrokeHairlineOrEquivalent(*args.fStyle, *args.fViewMatrix, nullptr)) {
- return false;
- }
-
- // We don't currently handle dashing in this class though perhaps we should.
- if (args.fStyle->pathEffect()) {
+ if (!IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix, nullptr)) {
return false;
}
@@ -944,11 +939,11 @@
static GrDrawBatch* create_hairline_batch(GrColor color,
const SkMatrix& viewMatrix,
const SkPath& path,
- const GrStyle& style,
+ const GrStrokeInfo& stroke,
const SkIRect& devClipBounds) {
SkScalar hairlineCoverage;
uint8_t newCoverage = 0xff;
- if (GrPathRenderer::IsStrokeHairlineOrEquivalent(style, viewMatrix, &hairlineCoverage)) {
+ if (GrPathRenderer::IsStrokeHairlineOrEquivalent(stroke, viewMatrix, &hairlineCoverage)) {
newCoverage = SkScalarRoundToInt(hairlineCoverage * 0xff);
}
@@ -969,7 +964,7 @@
args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(), &devClipBounds);
SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fViewMatrix, *args.fPath,
- *args.fStyle, devClipBounds));
+ *args.fStroke, devClipBounds));
args.fTarget->drawBatch(*args.fPipelineBuilder, batch);
return true;
@@ -982,10 +977,11 @@
DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) {
GrColor color = GrRandomColor(random);
SkMatrix viewMatrix = GrTest::TestMatrix(random);
+ GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle);
SkPath path = GrTest::TestPath(random);
SkIRect devClipBounds;
devClipBounds.setEmpty();
- return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairline(), devClipBounds);
+ return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds);
}
#endif
« no previous file with comments | « src/gpu/batches/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698