OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkTwoPointConicalGradient_DEFINED | 9 #ifndef SkTwoPointConicalGradient_DEFINED |
10 #define SkTwoPointConicalGradient_DEFINED | 10 #define SkTwoPointConicalGradient_DEFINED |
(...skipping 27 matching lines...) Expand all Loading... |
38 }; | 38 }; |
39 | 39 |
40 | 40 |
41 class SkTwoPointConicalGradient : public SkGradientShaderBase { | 41 class SkTwoPointConicalGradient : public SkGradientShaderBase { |
42 TwoPtRadial fRec; | 42 TwoPtRadial fRec; |
43 public: | 43 public: |
44 SkTwoPointConicalGradient(const SkPoint& start, SkScalar startRadius, | 44 SkTwoPointConicalGradient(const SkPoint& start, SkScalar startRadius, |
45 const SkPoint& end, SkScalar endRadius, | 45 const SkPoint& end, SkScalar endRadius, |
46 bool flippedGrad, const Descriptor&); | 46 bool flippedGrad, const Descriptor&); |
47 | 47 |
| 48 |
| 49 size_t contextSize(const ContextRec&) const override; |
| 50 |
48 class TwoPointConicalGradientContext : public SkGradientShaderBase::Gradient
ShaderBaseContext { | 51 class TwoPointConicalGradientContext : public SkGradientShaderBase::Gradient
ShaderBaseContext { |
49 public: | 52 public: |
50 TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const C
ontextRec&); | 53 TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const C
ontextRec&); |
51 ~TwoPointConicalGradientContext() {} | 54 ~TwoPointConicalGradientContext() {} |
52 | 55 |
53 void shadeSpan(int x, int y, SkPMColor dstC[], int count) override; | 56 void shadeSpan(int x, int y, SkPMColor dstC[], int count) override; |
54 | 57 |
55 private: | 58 private: |
56 typedef SkGradientShaderBase::GradientShaderBaseContext INHERITED; | 59 typedef SkGradientShaderBase::GradientShaderBaseContext INHERITED; |
57 }; | 60 }; |
(...skipping 14 matching lines...) Expand all Loading... |
72 const SkPoint& getEndCenter() const { return fCenter2; } | 75 const SkPoint& getEndCenter() const { return fCenter2; } |
73 SkScalar getEndRadius() const { return fRadius2; } | 76 SkScalar getEndRadius() const { return fRadius2; } |
74 bool isFlippedGrad() const { return fFlippedGrad; } | 77 bool isFlippedGrad() const { return fFlippedGrad; } |
75 | 78 |
76 SK_TO_STRING_OVERRIDE() | 79 SK_TO_STRING_OVERRIDE() |
77 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien
t) | 80 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien
t) |
78 | 81 |
79 protected: | 82 protected: |
80 SkTwoPointConicalGradient(SkReadBuffer& buffer); | 83 SkTwoPointConicalGradient(SkReadBuffer& buffer); |
81 void flatten(SkWriteBuffer& buffer) const override; | 84 void flatten(SkWriteBuffer& buffer) const override; |
82 size_t onContextSize(const ContextRec&) const override; | |
83 Context* onCreateContext(const ContextRec&, void* storage) const override; | 85 Context* onCreateContext(const ContextRec&, void* storage) const override; |
84 | 86 |
85 private: | 87 private: |
86 SkPoint fCenter1; | 88 SkPoint fCenter1; |
87 SkPoint fCenter2; | 89 SkPoint fCenter2; |
88 SkScalar fRadius1; | 90 SkScalar fRadius1; |
89 SkScalar fRadius2; | 91 SkScalar fRadius2; |
90 bool fFlippedGrad; | 92 bool fFlippedGrad; |
91 | 93 |
92 friend class SkGradientShader; | 94 friend class SkGradientShader; |
93 typedef SkGradientShaderBase INHERITED; | 95 typedef SkGradientShaderBase INHERITED; |
94 }; | 96 }; |
95 | 97 |
96 #endif | 98 #endif |
OLD | NEW |