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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 */ | 102 */ |
103 void resetColorFilter() { | 103 void resetColorFilter() { |
104 fColorFilterXfermode = SkXfermode::kDst_Mode; | 104 fColorFilterXfermode = SkXfermode::kDst_Mode; |
105 fColorFilterColor = GrColorPackRGBA(0xff, 0xff, 0xff, 0xff); | 105 fColorFilterColor = GrColorPackRGBA(0xff, 0xff, 0xff, 0xff); |
106 } | 106 } |
107 | 107 |
108 /** | 108 /** |
109 * Appends an additional color effect to the color computation. | 109 * Appends an additional color effect to the color computation. |
110 */ | 110 */ |
111 const GrEffectRef* addColorEffect(const GrEffectRef* effect, int attr0 = -1,
int attr1 = -1) { | 111 const GrEffectRef* addColorEffect(const GrEffectRef* effect, int attr0 = -1,
int attr1 = -1) { |
112 GrAssert(NULL != effect); | 112 SkASSERT(NULL != effect); |
113 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrEffectStage, (effect, attr0, att
r1)); | 113 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrEffectStage, (effect, attr0, att
r1)); |
114 return effect; | 114 return effect; |
115 } | 115 } |
116 | 116 |
117 /** | 117 /** |
118 * Appends an additional coverage effect to the coverage computation. | 118 * Appends an additional coverage effect to the coverage computation. |
119 */ | 119 */ |
120 const GrEffectRef* addCoverageEffect(const GrEffectRef* effect, int attr0 =
-1, int attr1 = -1) { | 120 const GrEffectRef* addCoverageEffect(const GrEffectRef* effect, int attr0 =
-1, int attr1 = -1) { |
121 GrAssert(NULL != effect); | 121 SkASSERT(NULL != effect); |
122 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrEffectStage, (effect, attr0,
attr1)); | 122 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrEffectStage, (effect, attr0,
attr1)); |
123 return effect; | 123 return effect; |
124 } | 124 } |
125 | 125 |
126 /** | 126 /** |
127 * Helpers for adding color or coverage effects that sample a texture. The m
atrix is applied | 127 * Helpers for adding color or coverage effects that sample a texture. The m
atrix is applied |
128 * to the src space position to compute texture coordinates. | 128 * to the src space position to compute texture coordinates. |
129 */ | 129 */ |
130 void addColorTextureEffect(GrTexture* texture, const SkMatrix& matrix); | 130 void addColorTextureEffect(GrTexture* texture, const SkMatrix& matrix); |
131 void addCoverageTextureEffect(GrTexture* texture, const SkMatrix& matrix); | 131 void addCoverageTextureEffect(GrTexture* texture, const SkMatrix& matrix); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 fCoverage = 0xff; | 266 fCoverage = 0xff; |
267 } | 267 } |
268 | 268 |
269 void resetStages() { | 269 void resetStages() { |
270 fColorStages.reset(); | 270 fColorStages.reset(); |
271 fCoverageStages.reset(); | 271 fCoverageStages.reset(); |
272 } | 272 } |
273 }; | 273 }; |
274 | 274 |
275 #endif | 275 #endif |
OLD | NEW |