OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 | 9 |
10 #ifndef GrPaint_DEFINED | 10 #ifndef GrPaint_DEFINED |
(...skipping 30 matching lines...) Expand all Loading... |
41 public: | 41 public: |
42 GrPaint(); | 42 GrPaint(); |
43 | 43 |
44 GrPaint(const GrPaint& paint) { *this = paint; } | 44 GrPaint(const GrPaint& paint) { *this = paint; } |
45 | 45 |
46 ~GrPaint() { } | 46 ~GrPaint() { } |
47 | 47 |
48 /** | 48 /** |
49 * The initial color of the drawn primitive. Defaults to solid white. | 49 * The initial color of the drawn primitive. Defaults to solid white. |
50 */ | 50 */ |
51 void setColor(GrColor color) { fColor = color; } | 51 void setColor4f(const GrColor4f& color) { fColor = color; } |
52 GrColor getColor() const { return fColor; } | 52 const GrColor4f& getColor4f() const { return fColor; } |
| 53 |
| 54 /** |
| 55 * Legacy getter, until all code handles 4f directly. |
| 56 */ |
| 57 GrColor getColor() const { return fColor.toGrColor(); } |
53 | 58 |
54 /** | 59 /** |
55 * Should primitives be anti-aliased or not. Defaults to false. | 60 * Should primitives be anti-aliased or not. Defaults to false. |
56 */ | 61 */ |
57 void setAntiAlias(bool aa) { fAntiAlias = aa; } | 62 void setAntiAlias(bool aa) { fAntiAlias = aa; } |
58 bool isAntiAlias() const { return fAntiAlias; } | 63 bool isAntiAlias() const { return fAntiAlias; } |
59 | 64 |
60 /** | 65 /** |
61 * Should shader output conversion from linear to sRGB be disabled. | 66 * Should shader output conversion from linear to sRGB be disabled. |
62 * Only relevant if the destination is sRGB. Defaults to false. | 67 * Only relevant if the destination is sRGB. Defaults to false. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 160 |
156 private: | 161 private: |
157 mutable sk_sp<GrXPFactory> fXPFactory; | 162 mutable sk_sp<GrXPFactory> fXPFactory; |
158 SkSTArray<4, sk_sp<GrFragmentProcessor>> fColorFragmentProcessors; | 163 SkSTArray<4, sk_sp<GrFragmentProcessor>> fColorFragmentProcessors; |
159 SkSTArray<2, sk_sp<GrFragmentProcessor>> fCoverageFragmentProcessors; | 164 SkSTArray<2, sk_sp<GrFragmentProcessor>> fCoverageFragmentProcessors; |
160 | 165 |
161 bool fAntiAlias; | 166 bool fAntiAlias; |
162 bool fDisableOutputConversionToSRGB; | 167 bool fDisableOutputConversionToSRGB; |
163 bool fAllowSRGBInputs; | 168 bool fAllowSRGBInputs; |
164 | 169 |
165 GrColor fColor; | 170 GrColor4f fColor; |
166 }; | 171 }; |
167 | 172 |
168 #endif | 173 #endif |
OLD | NEW |