| 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 | |
| 51 class TwoPointConicalGradientContext : public SkGradientShaderBase::Gradient
ShaderBaseContext { | 48 class TwoPointConicalGradientContext : public SkGradientShaderBase::Gradient
ShaderBaseContext { |
| 52 public: | 49 public: |
| 53 TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const C
ontextRec&); | 50 TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const C
ontextRec&); |
| 54 ~TwoPointConicalGradientContext() {} | 51 ~TwoPointConicalGradientContext() {} |
| 55 | 52 |
| 56 void shadeSpan(int x, int y, SkPMColor dstC[], int count) override; | 53 void shadeSpan(int x, int y, SkPMColor dstC[], int count) override; |
| 57 | 54 |
| 58 private: | 55 private: |
| 59 typedef SkGradientShaderBase::GradientShaderBaseContext INHERITED; | 56 typedef SkGradientShaderBase::GradientShaderBaseContext INHERITED; |
| 60 }; | 57 }; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 75 const SkPoint& getEndCenter() const { return fCenter2; } | 72 const SkPoint& getEndCenter() const { return fCenter2; } |
| 76 SkScalar getEndRadius() const { return fRadius2; } | 73 SkScalar getEndRadius() const { return fRadius2; } |
| 77 bool isFlippedGrad() const { return fFlippedGrad; } | 74 bool isFlippedGrad() const { return fFlippedGrad; } |
| 78 | 75 |
| 79 SK_TO_STRING_OVERRIDE() | 76 SK_TO_STRING_OVERRIDE() |
| 80 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien
t) | 77 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien
t) |
| 81 | 78 |
| 82 protected: | 79 protected: |
| 83 SkTwoPointConicalGradient(SkReadBuffer& buffer); | 80 SkTwoPointConicalGradient(SkReadBuffer& buffer); |
| 84 void flatten(SkWriteBuffer& buffer) const override; | 81 void flatten(SkWriteBuffer& buffer) const override; |
| 82 size_t onContextSize(const ContextRec&) const override; |
| 85 Context* onCreateContext(const ContextRec&, void* storage) const override; | 83 Context* onCreateContext(const ContextRec&, void* storage) const override; |
| 86 | 84 |
| 87 private: | 85 private: |
| 88 SkPoint fCenter1; | 86 SkPoint fCenter1; |
| 89 SkPoint fCenter2; | 87 SkPoint fCenter2; |
| 90 SkScalar fRadius1; | 88 SkScalar fRadius1; |
| 91 SkScalar fRadius2; | 89 SkScalar fRadius2; |
| 92 bool fFlippedGrad; | 90 bool fFlippedGrad; |
| 93 | 91 |
| 94 friend class SkGradientShader; | 92 friend class SkGradientShader; |
| 95 typedef SkGradientShaderBase INHERITED; | 93 typedef SkGradientShaderBase INHERITED; |
| 96 }; | 94 }; |
| 97 | 95 |
| 98 #endif | 96 #endif |
| OLD | NEW |