OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrEffect_DEFINED | 8 #ifndef GrEffect_DEFINED |
9 #define GrEffect_DEFINED | 9 #define GrEffect_DEFINED |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 There is no public way to wrap a GrEffect in a GrEffectRef. Thus, a factory
should be a static | 63 There is no public way to wrap a GrEffect in a GrEffectRef. Thus, a factory
should be a static |
64 member function of a GrEffect subclass. | 64 member function of a GrEffect subclass. |
65 | 65 |
66 Because almost no code should ever handle a GrEffect outside of a GrEffectRe
f, we privately | 66 Because almost no code should ever handle a GrEffect outside of a GrEffectRe
f, we privately |
67 inherit from GrRefCnt to help prevent accidental direct ref'ing/unref'ing of
effects. | 67 inherit from GrRefCnt to help prevent accidental direct ref'ing/unref'ing of
effects. |
68 */ | 68 */ |
69 class GrEffect : private GrRefCnt { | 69 class GrEffect : private GrRefCnt { |
70 public: | 70 public: |
71 SK_DECLARE_INST_COUNT(GrEffect) | 71 SK_DECLARE_INST_COUNT(GrEffect) |
72 | 72 |
| 73 /** |
| 74 * The types of vertex coordinates available to an effect in the vertex shad
er. Effects can |
| 75 * require their own vertex attribute but these coordinates are made availab
le by the framework |
| 76 * in all programs. kCustom_CoordsType is provided to signify that an altern
ative set of coords |
| 77 * is used (usually an explicit vertex attribute) but its meaning is determi
ned by the effect |
| 78 * subclass. |
| 79 */ |
| 80 enum CoordsType { |
| 81 kLocal_CoordsType, |
| 82 kPosition_CoordsType, |
| 83 |
| 84 kCustom_CoordsType, |
| 85 }; |
| 86 |
73 virtual ~GrEffect(); | 87 virtual ~GrEffect(); |
74 | 88 |
75 /** | 89 /** |
76 * Flags for getConstantColorComponents. They are defined so that the bit or
der reflects the | 90 * Flags for getConstantColorComponents. They are defined so that the bit or
der reflects the |
77 * GrColor shift order. | 91 * GrColor shift order. |
78 */ | 92 */ |
79 enum ValidComponentFlags { | 93 enum ValidComponentFlags { |
80 kR_ValidComponentFlag = 1 << (GrColor_SHIFT_R / 8), | 94 kR_ValidComponentFlag = 1 << (GrColor_SHIFT_R / 8), |
81 kG_ValidComponentFlag = 1 << (GrColor_SHIFT_G / 8), | 95 kG_ValidComponentFlag = 1 << (GrColor_SHIFT_G / 8), |
82 kB_ValidComponentFlag = 1 << (GrColor_SHIFT_B / 8), | 96 kB_ValidComponentFlag = 1 << (GrColor_SHIFT_B / 8), |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 typedef GrRefCnt INHERITED; | 283 typedef GrRefCnt INHERITED; |
270 }; | 284 }; |
271 | 285 |
272 inline GrEffectRef::GrEffectRef(GrEffect* effect) { | 286 inline GrEffectRef::GrEffectRef(GrEffect* effect) { |
273 GrAssert(NULL != effect); | 287 GrAssert(NULL != effect); |
274 effect->ref(); | 288 effect->ref(); |
275 fEffect = effect; | 289 fEffect = effect; |
276 } | 290 } |
277 | 291 |
278 #endif | 292 #endif |
OLD | NEW |