| 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 GrEffectRef* addColorEffect(const GrEffectRef* effect, int attr0 = -1,
int attr1 = -1) { |
| 91 SkASSERT(NULL != effect); | 91 SkASSERT(NULL != effect); |
| 92 if (!effect->willUseInputColor()) { | 92 if (!(*effect)->willUseInputColor()) { |
| 93 fColorStages.reset(); | 93 fColorStages.reset(); |
| 94 } | 94 } |
| 95 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrEffectStage, (effect, attr0, att
r1)); | 95 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrEffectStage, (effect, attr0, att
r1)); |
| 96 return effect; | 96 return effect; |
| 97 } | 97 } |
| 98 | 98 |
| 99 /** | 99 /** |
| 100 * Appends an additional coverage effect to the coverage computation. | 100 * Appends an additional coverage effect to the coverage computation. |
| 101 */ | 101 */ |
| 102 const GrEffect* addCoverageEffect(const GrEffect* effect, int attr0 = -1, in
t attr1 = -1) { | 102 const GrEffectRef* addCoverageEffect(const GrEffectRef* effect, int attr0 =
-1, int attr1 = -1) { |
| 103 SkASSERT(NULL != effect); | 103 SkASSERT(NULL != effect); |
| 104 if (!effect->willUseInputColor()) { | 104 if (!(*effect)->willUseInputColor()) { |
| 105 fCoverageStages.reset(); | 105 fCoverageStages.reset(); |
| 106 } | 106 } |
| 107 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrEffectStage, (effect, attr0,
attr1)); | 107 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrEffectStage, (effect, attr0,
attr1)); |
| 108 return effect; | 108 return effect; |
| 109 } | 109 } |
| 110 | 110 |
| 111 /** | 111 /** |
| 112 * Helpers for adding color or coverage effects that sample a texture. The m
atrix is applied | 112 * 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. | 113 * to the src space position to compute texture coordinates. |
| 114 */ | 114 */ |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 fCoverage = 0xff; | 245 fCoverage = 0xff; |
| 246 } | 246 } |
| 247 | 247 |
| 248 void resetStages() { | 248 void resetStages() { |
| 249 fColorStages.reset(); | 249 fColorStages.reset(); |
| 250 fCoverageStages.reset(); | 250 fCoverageStages.reset(); |
| 251 } | 251 } |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 #endif | 254 #endif |
| OLD | NEW |