Chromium Code Reviews| Index: src/gpu/GrStyle.h |
| diff --git a/src/gpu/GrStyle.h b/src/gpu/GrStyle.h |
| index 6166b56fb707eafffcc013b160b71dc0c1478247..92f884011dfb740768e6edef8cdb89a513022c19 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) { |
|
robertphillips
2016/05/09 20:05:28
we us -> we use ?
bsalomon
2016/05/09 20:38:55
Done.
|
| + // getMaxScale will return -1 if the matrix has perspective. In that case we us 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 |