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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 /** | 81 /** |
82 * Should dithering be applied. Defaults to false. | 82 * Should dithering be applied. Defaults to false. |
83 */ | 83 */ |
84 void setDither(bool dither) { fDither = dither; } | 84 void setDither(bool dither) { fDither = dither; } |
85 bool isDither() const { return fDither; } | 85 bool isDither() const { return fDither; } |
86 | 86 |
87 /** | 87 /** |
88 * Appends an additional color effect to the color computation. | 88 * Appends an additional color effect to the color computation. |
89 */ | 89 */ |
90 const GrEffect* addColorEffect(const GrEffect* effect, int attr0 = -1, int a
ttr1 = -1) { | 90 const GrEffect* addColorEffect(const GrEffect* effect) { |
91 SkASSERT(effect); | 91 SkASSERT(effect); |
| 92 SkASSERT(!effect->requiresVertexShader()); |
92 if (!effect->willUseInputColor()) { | 93 if (!effect->willUseInputColor()) { |
93 fColorStages.reset(); | 94 fColorStages.reset(); |
94 } | 95 } |
95 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrEffectStage, (effect, attr0, att
r1)); | 96 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrEffectStage, (effect)); |
96 return effect; | 97 return effect; |
97 } | 98 } |
98 | 99 |
99 /** | 100 /** |
100 * Appends an additional coverage effect to the coverage computation. | 101 * Appends an additional coverage effect to the coverage computation. |
101 */ | 102 */ |
102 const GrEffect* addCoverageEffect(const GrEffect* effect, int attr0 = -1, in
t attr1 = -1) { | 103 const GrEffect* addCoverageEffect(const GrEffect* effect) { |
103 SkASSERT(effect); | 104 SkASSERT(effect); |
| 105 SkASSERT(!effect->requiresVertexShader()); |
104 if (!effect->willUseInputColor()) { | 106 if (!effect->willUseInputColor()) { |
105 fCoverageStages.reset(); | 107 fCoverageStages.reset(); |
106 } | 108 } |
107 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrEffectStage, (effect, attr0,
attr1)); | 109 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrEffectStage, (effect)); |
108 return effect; | 110 return effect; |
109 } | 111 } |
110 | 112 |
111 /** | 113 /** |
112 * Helpers for adding color or coverage effects that sample a texture. The m
atrix is applied | 114 * Helpers for adding color or coverage effects that sample a texture. The m
atrix is applied |
113 * to the src space position to compute texture coordinates. | 115 * to the src space position to compute texture coordinates. |
114 */ | 116 */ |
115 void addColorTextureEffect(GrTexture* texture, const SkMatrix& matrix); | 117 void addColorTextureEffect(GrTexture* texture, const SkMatrix& matrix); |
116 void addCoverageTextureEffect(GrTexture* texture, const SkMatrix& matrix); | 118 void addCoverageTextureEffect(GrTexture* texture, const SkMatrix& matrix); |
117 | 119 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 fCoverage = 0xff; | 247 fCoverage = 0xff; |
246 } | 248 } |
247 | 249 |
248 void resetStages() { | 250 void resetStages() { |
249 fColorStages.reset(); | 251 fColorStages.reset(); |
250 fCoverageStages.reset(); | 252 fCoverageStages.reset(); |
251 } | 253 } |
252 }; | 254 }; |
253 | 255 |
254 #endif | 256 #endif |
OLD | NEW |