| 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 30 matching lines...) Expand all Loading... |
| 41 TwoPtRadial fRec; | 41 TwoPtRadial fRec; |
| 42 void init(); | 42 void init(); |
| 43 | 43 |
| 44 public: | 44 public: |
| 45 SkTwoPointConicalGradient(const SkPoint& start, SkScalar startRadius, | 45 SkTwoPointConicalGradient(const SkPoint& start, SkScalar startRadius, |
| 46 const SkPoint& end, SkScalar endRadius, | 46 const SkPoint& end, SkScalar endRadius, |
| 47 bool flippedGrad, const Descriptor&, | 47 bool flippedGrad, const Descriptor&, |
| 48 const SkMatrix* localMatrix); | 48 const SkMatrix* localMatrix); |
| 49 | 49 |
| 50 | 50 |
| 51 virtual SkShader::Context* createContext(const ContextRec&, void* storage) c
onst SK_OVERRIDE; | |
| 52 virtual size_t contextSize() const SK_OVERRIDE; | 51 virtual size_t contextSize() const SK_OVERRIDE; |
| 53 | 52 |
| 54 class TwoPointConicalGradientContext : public SkGradientShaderBase::Gradient
ShaderBaseContext { | 53 class TwoPointConicalGradientContext : public SkGradientShaderBase::Gradient
ShaderBaseContext { |
| 55 public: | 54 public: |
| 56 TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const C
ontextRec&); | 55 TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const C
ontextRec&); |
| 57 ~TwoPointConicalGradientContext() {} | 56 ~TwoPointConicalGradientContext() {} |
| 58 | 57 |
| 59 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVE
RRIDE; | 58 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVE
RRIDE; |
| 60 | 59 |
| 61 private: | 60 private: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 76 const SkPoint& getEndCenter() const { return fCenter2; } | 75 const SkPoint& getEndCenter() const { return fCenter2; } |
| 77 SkScalar getEndRadius() const { return fRadius2; } | 76 SkScalar getEndRadius() const { return fRadius2; } |
| 78 bool isFlippedGrad() const { return fFlippedGrad; } | 77 bool isFlippedGrad() const { return fFlippedGrad; } |
| 79 | 78 |
| 80 SK_TO_STRING_OVERRIDE() | 79 SK_TO_STRING_OVERRIDE() |
| 81 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien
t) | 80 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien
t) |
| 82 | 81 |
| 83 protected: | 82 protected: |
| 84 SkTwoPointConicalGradient(SkReadBuffer& buffer); | 83 SkTwoPointConicalGradient(SkReadBuffer& buffer); |
| 85 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; | 84 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; |
| 85 virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_
OVERRIDE; |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 SkPoint fCenter1; | 88 SkPoint fCenter1; |
| 89 SkPoint fCenter2; | 89 SkPoint fCenter2; |
| 90 SkScalar fRadius1; | 90 SkScalar fRadius1; |
| 91 SkScalar fRadius2; | 91 SkScalar fRadius2; |
| 92 bool fFlippedGrad; | 92 bool fFlippedGrad; |
| 93 | 93 |
| 94 typedef SkGradientShaderBase INHERITED; | 94 typedef SkGradientShaderBase INHERITED; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 #endif | 97 #endif |
| OLD | NEW |