OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef Sk4fGradientBase_DEFINED | 8 #ifndef Sk4fGradientBase_DEFINED |
9 #define Sk4fGradientBase_DEFINED | 9 #define Sk4fGradientBase_DEFINED |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 GradientShaderBase4fContext(const SkGradientShaderBase&, | 22 GradientShaderBase4fContext(const SkGradientShaderBase&, |
23 const ContextRec&); | 23 const ContextRec&); |
24 | 24 |
25 uint32_t getFlags() const override { return fFlags; } | 25 uint32_t getFlags() const override { return fFlags; } |
26 | 26 |
27 protected: | 27 protected: |
28 struct Interval { | 28 struct Interval { |
29 Interval(SkPMColor c0, SkScalar p0, | 29 Interval(SkPMColor c0, SkScalar p0, |
30 SkPMColor c1, SkScalar p1, | 30 SkPMColor c1, SkScalar p1, |
31 const Sk4f& componentScale); | 31 const Sk4f& componentScale); |
32 Interval(const Sk4f& c0, const Sk4f& dc, | |
33 SkScalar p0, SkScalar p1); | |
34 | 32 |
35 bool isZeroRamp() const { return fZeroRamp; } | 33 bool isZeroRamp() const { return fZeroRamp; } |
36 | 34 |
37 // true when fx is in [p0,p1) | 35 // true when fx is in [p0,p1) |
38 bool contains(SkScalar fx) const; | 36 bool contains(SkScalar fx) const; |
39 | 37 |
40 SkPM4f fC0, fDc; | 38 SkPM4f fC0, fDc; |
41 SkScalar fP0, fP1; | 39 SkScalar fP0, fP1; |
42 bool fZeroRamp; | 40 bool fZeroRamp; |
43 }; | 41 }; |
44 | 42 |
45 SkSTArray<8, Interval, true> fIntervals; | 43 SkSTArray<8, Interval, true> fIntervals; |
46 SkMatrix fDstToPos; | 44 SkMatrix fDstToPos; |
47 SkMatrix::MapXYProc fDstToPosProc; | 45 SkMatrix::MapXYProc fDstToPosProc; |
48 uint8_t fDstToPosClass; | 46 uint8_t fDstToPosClass; |
49 uint8_t fFlags; | 47 uint8_t fFlags; |
50 bool fDither; | 48 bool fDither; |
51 bool fColorsArePremul; | 49 bool fColorsArePremul; |
52 | 50 |
53 private: | 51 private: |
54 using INHERITED = SkShader::Context; | 52 using INHERITED = SkShader::Context; |
55 }; | 53 }; |
56 | 54 |
57 #endif // Sk4fGradientBase_DEFINED | 55 #endif // Sk4fGradientBase_DEFINED |
OLD | NEW |