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

Unified Diff: src/gpu/GrStyle.h

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/GrStyle.h
diff --git a/src/gpu/GrStyle.h b/src/gpu/GrStyle.h
index 6166b56fb707eafffcc013b160b71dc0c1478247..07efb40866b91df4f9fbbfd9bef3763c0712d3e2 100644
--- a/src/gpu/GrStyle.h
+++ b/src/gpu/GrStyle.h
@@ -85,6 +85,11 @@ public:
this->initPathEffect(paint.getPathEffect());
}
+ explicit GrStyle(const SkPaint& paint, SkPaint::Style overrideStyle)
+ : fStrokeRec(paint, overrideStyle) {
+ this->initPathEffect(paint.getPathEffect());
+ }
+
GrStyle& operator=(const GrStyle& that) {
fPathEffect = that.fPathEffect;
fDashInfo = that.fDashInfo;
@@ -133,6 +138,12 @@ public:
return this->pathEffect() || (!fStrokeRec.isFillStyle() && !fStrokeRec.isHairlineStyle());
}
+ static SkScalar MatrixToScaleFactor(const SkMatrix& matrix) {
+ // getMaxScale will return -1 if the matrix has perspective. In that case we can use a scale
+ // factor of 1. This isn't necessarily a good choice and in the future we might consider
+ // taking a bounds here for the perspective case.
+ return SkScalarAbs(matrix.getMaxScale());
+ }
/**
* Applies just the path effect and returns remaining stroke information. This will fail if
* there is no path effect. dst may or may not have been overwritten on failure. Scale controls

Powered by Google App Engine
This is Rietveld 408576698