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

Unified Diff: src/gpu/GrAAConvexTessellator.cpp

Issue 1302503003: Fix transformed stroke width in GrAALinearizingConvexPathRenderer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « gm/scaledstrokes.cpp ('k') | src/gpu/GrAALinearizingConvexPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAConvexTessellator.cpp
diff --git a/src/gpu/GrAAConvexTessellator.cpp b/src/gpu/GrAAConvexTessellator.cpp
index e38ba3c3aed8c96a63ab83f70abb55c192e6ea79..db10086741fb4281c1b5ac376aef2f95af126cf4 100644
--- a/src/gpu/GrAAConvexTessellator.cpp
+++ b/src/gpu/GrAAConvexTessellator.cpp
@@ -201,10 +201,14 @@ bool GrAAConvexTessellator::tessellate(const SkMatrix& m, const SkPath& path) {
}
SkScalar coverage = 1.0f;
+ SkScalar scaleFactor = 0.0f;
if (fStrokeWidth >= 0.0f) {
+ SkASSERT(m.isSimilarity());
+ scaleFactor = m.getMaxScale(); // x and y scale are the same
+ SkScalar effectiveStrokeWidth = scaleFactor * fStrokeWidth;
Ring outerStrokeRing;
- this->createOuterRing(fInitialRing, fStrokeWidth / 2 - kAntialiasingRadius, coverage,
- &outerStrokeRing);
+ this->createOuterRing(fInitialRing, effectiveStrokeWidth / 2 - kAntialiasingRadius,
+ coverage, &outerStrokeRing);
outerStrokeRing.init(*this);
Ring outerAARing;
this->createOuterRing(outerStrokeRing, kAntialiasingRadius * 2, 0.0f, &outerAARing);
@@ -216,8 +220,9 @@ bool GrAAConvexTessellator::tessellate(const SkMatrix& m, const SkPath& path) {
// the bisectors are only needed for the computation of the outer ring
fBisectors.rewind();
if (fStrokeWidth >= 0.0f && fInitialRing.numPts() > 2) {
+ SkScalar effectiveStrokeWidth = scaleFactor * fStrokeWidth;
Ring* insetStrokeRing;
- SkScalar strokeDepth = fStrokeWidth / 2 - kAntialiasingRadius;
+ SkScalar strokeDepth = effectiveStrokeWidth / 2 - kAntialiasingRadius;
if (this->createInsetRings(fInitialRing, 0.0f, coverage, strokeDepth, coverage,
&insetStrokeRing)) {
Ring* insetAARing;
« no previous file with comments | « gm/scaledstrokes.cpp ('k') | src/gpu/GrAALinearizingConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698