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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 private: | 60 private: |
61 typedef SkGradientShaderBase::GradientShaderBaseContext INHERITED; | 61 typedef SkGradientShaderBase::GradientShaderBaseContext INHERITED; |
62 }; | 62 }; |
63 | 63 |
64 virtual BitmapType asABitmap(SkBitmap* bitmap, | 64 virtual BitmapType asABitmap(SkBitmap* bitmap, |
65 SkMatrix* matrix, | 65 SkMatrix* matrix, |
66 TileMode* xy) const; | 66 TileMode* xy) const; |
67 virtual SkShader::GradientType asAGradient(GradientInfo* info) const SK_OVE
RRIDE; | 67 virtual SkShader::GradientType asAGradient(GradientInfo* info) const SK_OVE
RRIDE; |
68 virtual bool asNewEffect(GrContext*, const SkPaint&, const SkMatrix*, GrColo
r* grColor, | 68 virtual bool asNewEffect(GrContext*, const SkPaint&, const SkMatrix*, GrColo
r* grColor, |
69 GrEffect**) const SK_OVERRIDE; | 69 GrEffectRef**) const SK_OVERRIDE; |
70 virtual bool isOpaque() const SK_OVERRIDE; | 70 virtual bool isOpaque() const SK_OVERRIDE; |
71 | 71 |
72 SkScalar getCenterX1() const { return SkPoint::Distance(fCenter1, fCenter2);
} | 72 SkScalar getCenterX1() const { return SkPoint::Distance(fCenter1, fCenter2);
} |
73 SkScalar getStartRadius() const { return fRadius1; } | 73 SkScalar getStartRadius() const { return fRadius1; } |
74 SkScalar getDiffRadius() const { return fRadius2 - fRadius1; } | 74 SkScalar getDiffRadius() const { return fRadius2 - fRadius1; } |
75 const SkPoint& getStartCenter() const { return fCenter1; } | 75 const SkPoint& getStartCenter() const { return fCenter1; } |
76 const SkPoint& getEndCenter() const { return fCenter2; } | 76 const SkPoint& getEndCenter() const { return fCenter2; } |
77 SkScalar getEndRadius() const { return fRadius2; } | 77 SkScalar getEndRadius() const { return fRadius2; } |
78 bool isFlippedGrad() const { return fFlippedGrad; } | 78 bool isFlippedGrad() const { return fFlippedGrad; } |
79 | 79 |
80 SK_TO_STRING_OVERRIDE() | 80 SK_TO_STRING_OVERRIDE() |
81 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien
t) | 81 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradien
t) |
82 | 82 |
83 protected: | 83 protected: |
84 SkTwoPointConicalGradient(SkReadBuffer& buffer); | 84 SkTwoPointConicalGradient(SkReadBuffer& buffer); |
85 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; | 85 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; |
86 virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_
OVERRIDE; | 86 virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_
OVERRIDE; |
87 | 87 |
88 private: | 88 private: |
89 SkPoint fCenter1; | 89 SkPoint fCenter1; |
90 SkPoint fCenter2; | 90 SkPoint fCenter2; |
91 SkScalar fRadius1; | 91 SkScalar fRadius1; |
92 SkScalar fRadius2; | 92 SkScalar fRadius2; |
93 bool fFlippedGrad; | 93 bool fFlippedGrad; |
94 | 94 |
95 typedef SkGradientShaderBase INHERITED; | 95 typedef SkGradientShaderBase INHERITED; |
96 }; | 96 }; |
97 | 97 |
98 #endif | 98 #endif |
OLD | NEW |