Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/Gradient.h |
| diff --git a/third_party/WebKit/Source/platform/graphics/Gradient.h b/third_party/WebKit/Source/platform/graphics/Gradient.h |
| index 0b024d933687ceda6a650646070a41e4ef4f6963..85740d4636e3d8251bc575fae4b68490d3f4ef4a 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/Gradient.h |
| +++ b/third_party/WebKit/Source/platform/graphics/Gradient.h |
| @@ -33,13 +33,13 @@ |
| #include "platform/geometry/FloatPoint.h" |
| #include "platform/graphics/Color.h" |
| #include "platform/graphics/GraphicsTypes.h" |
| -#include "platform/transforms/AffineTransform.h" |
| #include "third_party/skia/include/core/SkRefCnt.h" |
| #include "wtf/Noncopyable.h" |
| #include "wtf/PassRefPtr.h" |
| #include "wtf/RefCounted.h" |
| #include "wtf/Vector.h" |
| +class SkMatrix; |
| class SkPaint; |
| class SkShader; |
| @@ -109,22 +109,18 @@ public: |
| m_r1 = r; |
| } |
| - float aspectRatio() const { return m_aspectRatio; } |
| - |
| - void applyToPaint(SkPaint&); |
| + void applyToPaint(SkPaint&, const SkMatrix* localMatrix = nullptr); |
| void setDrawsInPMColorSpace(bool drawInPMColorSpace); |
| void setSpreadMethod(GradientSpreadMethod); |
| GradientSpreadMethod spreadMethod() const { return m_spreadMethod; } |
| - void setGradientSpaceTransform(const AffineTransform& gradientSpaceTransformation); |
| - AffineTransform gradientSpaceTransform() { return m_gradientSpaceTransformation; } |
| private: |
| Gradient(const FloatPoint& p0, const FloatPoint& p1); |
| Gradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1, float aspectRatio); |
| - sk_sp<SkShader> createShader(); |
| + sk_sp<SkShader> createShader(const SkMatrix* localMatrix); |
|
Stephen White
2016/05/26 20:36:26
I'm be tempted to say, just make this a const SkMa
f(malita)
2016/05/27 15:18:40
Thanks, that actually gets rid of quite a bit of b
|
| void sortStopsIfNecessary(); |
| @@ -138,9 +134,8 @@ private: |
| bool m_stopsSorted; |
| bool m_drawInPMColorSpace; |
| GradientSpreadMethod m_spreadMethod; |
| - AffineTransform m_gradientSpaceTransformation; |
| - sk_sp<SkShader> m_gradient; |
| + mutable sk_sp<SkShader> m_cachedShader; |
| }; |
| } // namespace blink |