Chromium Code Reviews| Index: src/effects/gradients/Sk4fGradientBase.h |
| diff --git a/src/effects/gradients/Sk4fGradientBase.h b/src/effects/gradients/Sk4fGradientBase.h |
| index 1fece72b520fd327c3607bb24218cd4b3178aaec..706e0b7b185e75b173b68ccb5df28088ab92ae2c 100644 |
| --- a/src/effects/gradients/Sk4fGradientBase.h |
| +++ b/src/effects/gradients/Sk4fGradientBase.h |
| @@ -24,6 +24,9 @@ public: |
| uint32_t getFlags() const override { return fFlags; } |
| + void shadeSpan(int x, int y, SkPMColor dst[], int count) override; |
| + void shadeSpan4f(int x, int y, SkPM4f dst[], int count) override; |
| + |
| protected: |
| struct Interval { |
| Interval(SkPMColor c0, SkScalar p0, |
| @@ -32,14 +35,15 @@ protected: |
| bool isZeroRamp() const { return fZeroRamp; } |
| - // true when fx is in [p0,p1) |
| - bool contains(SkScalar fx) const; |
| - |
| SkPM4f fC0, fDc; |
| SkScalar fP0, fP1; |
| bool fZeroRamp; |
| }; |
| + virtual void mapTs(int x, int y, SkScalar ts[], int count) const = 0; |
| + |
| + void buildIntervals(const SkGradientShaderBase&, const ContextRec&, bool reverse); |
| + |
| SkSTArray<8, Interval, true> fIntervals; |
| SkMatrix fDstToPos; |
| SkMatrix::MapXYProc fDstToPosProc; |
| @@ -50,6 +54,18 @@ protected: |
| private: |
| using INHERITED = SkShader::Context; |
| + |
| + void addMirrorIntervals(const SkGradientShaderBase&, |
| + const Sk4f& componentScale, bool reverse); |
| + |
| + template<typename DstType, SkShader::TileMode tileMode> |
| + class TSampler; |
| + |
| + template <typename DstType, bool premul> |
|
reed1
2016/03/10 17:49:37
does this mean you will apply alpha to the colors
f(malita)
2016/03/10 18:46:10
The former: interval colors are in unpremul format
|
| + void shadePremulSpan(int x, int y, DstType[], int count) const; |
| + |
| + template <typename DstType, bool premul, SkShader::TileMode tileMode> |
| + void shadeSpanInternal(int x, int y, DstType[], int count) const; |
| }; |
| #endif // Sk4fGradientBase_DEFINED |