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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 enum CoordsType { | 80 enum CoordsType { |
81 kLocal_CoordsType, | 81 kLocal_CoordsType, |
82 kPosition_CoordsType, | 82 kPosition_CoordsType, |
83 | 83 |
84 kCustom_CoordsType, | 84 kCustom_CoordsType, |
85 }; | 85 }; |
86 | 86 |
87 virtual ~GrEffect(); | 87 virtual ~GrEffect(); |
88 | 88 |
89 /** | 89 /** |
90 * Flags for getConstantColorComponents. They are defined so that the bit or
der reflects the | |
91 * GrColor shift order. | |
92 */ | |
93 enum ValidComponentFlags { | |
94 kR_ValidComponentFlag = 1 << (GrColor_SHIFT_R / 8), | |
95 kG_ValidComponentFlag = 1 << (GrColor_SHIFT_G / 8), | |
96 kB_ValidComponentFlag = 1 << (GrColor_SHIFT_B / 8), | |
97 kA_ValidComponentFlag = 1 << (GrColor_SHIFT_A / 8), | |
98 | |
99 kAll_ValidComponentFlags = (kR_ValidComponentFlag | kG_ValidComponentFla
g | | |
100 kB_ValidComponentFlag | kA_ValidComponentFla
g) | |
101 }; | |
102 | |
103 /** | |
104 * This function is used to perform optimizations. When called the color and
validFlags params | 90 * This function is used to perform optimizations. When called the color and
validFlags params |
105 * indicate whether the input components to this effect in the FS will have
known values. The | 91 * indicate whether the input components to this effect in the FS will have
known values. |
106 * function updates both params to indicate known values of its output. A co
mponent of the color | 92 * validFlags is a bitfield of GrColorComponentFlags. The function updates b
oth params to |
107 * param only has meaning if the corresponding bit in validFlags is set. | 93 * indicate known values of its output. A component of the color param only
has meaning if the |
| 94 * corresponding bit in validFlags is set. |
108 */ | 95 */ |
109 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags
) const = 0; | 96 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags
) const = 0; |
110 | 97 |
111 /** This object, besides creating back-end-specific helper objects, is used
for run-time-type- | 98 /** This object, besides creating back-end-specific helper objects, is used
for run-time-type- |
112 identification. The factory should be an instance of templated class, | 99 identification. The factory should be an instance of templated class, |
113 GrTBackendEffectFactory. It is templated on the subclass of GrEffect. Th
e subclass must have | 100 GrTBackendEffectFactory. It is templated on the subclass of GrEffect. Th
e subclass must have |
114 a nested type (or typedef) named GLEffect which will be the subclass of
GrGLEffect created | 101 a nested type (or typedef) named GLEffect which will be the subclass of
GrGLEffect created |
115 by the factory. | 102 by the factory. |
116 | 103 |
117 Example: | 104 Example: |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 typedef GrRefCnt INHERITED; | 270 typedef GrRefCnt INHERITED; |
284 }; | 271 }; |
285 | 272 |
286 inline GrEffectRef::GrEffectRef(GrEffect* effect) { | 273 inline GrEffectRef::GrEffectRef(GrEffect* effect) { |
287 GrAssert(NULL != effect); | 274 GrAssert(NULL != effect); |
288 effect->ref(); | 275 effect->ref(); |
289 fEffect = effect; | 276 fEffect = effect; |
290 } | 277 } |
291 | 278 |
292 #endif | 279 #endif |
OLD | NEW |