| 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 24 matching lines...) Expand all Loading... |
| 35 bool isZeroRamp() const { return fZeroRamp; } | 35 bool isZeroRamp() const { return fZeroRamp; } |
| 36 | 36 |
| 37 // true when fx is in [p0,p1) | 37 // true when fx is in [p0,p1) |
| 38 bool contains(SkScalar fx) const; | 38 bool contains(SkScalar fx) const; |
| 39 | 39 |
| 40 SkPM4f fC0, fDc; | 40 SkPM4f fC0, fDc; |
| 41 SkScalar fP0, fP1; | 41 SkScalar fP0, fP1; |
| 42 bool fZeroRamp; | 42 bool fZeroRamp; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 const Interval* findInterval(SkScalar fx) const; | |
| 46 | |
| 47 SkSTArray<8, Interval, true> fIntervals; | 45 SkSTArray<8, Interval, true> fIntervals; |
| 48 SkMatrix fDstToPos; | 46 SkMatrix fDstToPos; |
| 49 SkMatrix::MapXYProc fDstToPosProc; | 47 SkMatrix::MapXYProc fDstToPosProc; |
| 50 uint8_t fDstToPosClass; | 48 uint8_t fDstToPosClass; |
| 51 uint8_t fFlags; | 49 uint8_t fFlags; |
| 52 bool fDither; | 50 bool fDither; |
| 53 bool fColorsArePremul; | 51 bool fColorsArePremul; |
| 54 | 52 |
| 55 private: | 53 private: |
| 56 using INHERITED = SkShader::Context; | 54 using INHERITED = SkShader::Context; |
| 57 | |
| 58 void addMirrorIntervals(const SkGradientShaderBase&, const Sk4f& componentSc
ale, | |
| 59 bool dx_is_pos); | |
| 60 | |
| 61 mutable const Interval* fCachedInterval; | |
| 62 }; | 55 }; |
| 63 | 56 |
| 64 #endif // Sk4fGradientBase_DEFINED | 57 #endif // Sk4fGradientBase_DEFINED |
| OLD | NEW |