| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 bool isDither() const { return fDither; } | 85 bool isDither() const { return fDither; } |
| 86 | 86 |
| 87 /** | 87 /** |
| 88 * Appends an additional color processor to the color computation. | 88 * Appends an additional color processor to the color computation. |
| 89 */ | 89 */ |
| 90 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* fp)
{ | 90 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* fp)
{ |
| 91 SkASSERT(fp); | 91 SkASSERT(fp); |
| 92 if (!fp->willUseInputColor()) { | 92 if (!fp->willUseInputColor()) { |
| 93 fColorStages.reset(); | 93 fColorStages.reset(); |
| 94 } | 94 } |
| 95 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrFragmentStage, (fp)); | 95 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrProcessorStage, (fp)); |
| 96 return fp; | 96 return fp; |
| 97 } | 97 } |
| 98 | 98 |
| 99 /** | 99 /** |
| 100 * Appends an additional coverage processor to the coverage computation. | 100 * Appends an additional coverage processor to the coverage computation. |
| 101 */ | 101 */ |
| 102 const GrFragmentProcessor* addCoverageProcessor(const GrFragmentProcessor* f
p) { | 102 const GrFragmentProcessor* addCoverageProcessor(const GrFragmentProcessor* f
p) { |
| 103 SkASSERT(fp); | 103 SkASSERT(fp); |
| 104 if (!fp->willUseInputColor()) { | 104 if (!fp->willUseInputColor()) { |
| 105 fCoverageStages.reset(); | 105 fCoverageStages.reset(); |
| 106 } | 106 } |
| 107 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrFragmentStage, (fp)); | 107 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrProcessorStage, (fp)); |
| 108 return fp; | 108 return fp; |
| 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 */ |
| 115 void addColorTextureProcessor(GrTexture*, const SkMatrix&); | 115 void addColorTextureProcessor(GrTexture*, const SkMatrix&); |
| 116 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&); | 116 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&); |
| 117 void addColorTextureProcessor(GrTexture*, const SkMatrix&, const GrTexturePa
rams&); | 117 void addColorTextureProcessor(GrTexture*, const SkMatrix&, const GrTexturePa
rams&); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 fCoverage = 0xff; | 240 fCoverage = 0xff; |
| 241 } | 241 } |
| 242 | 242 |
| 243 void resetStages() { | 243 void resetStages() { |
| 244 fColorStages.reset(); | 244 fColorStages.reset(); |
| 245 fCoverageStages.reset(); | 245 fCoverageStages.reset(); |
| 246 } | 246 } |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 #endif | 249 #endif |
| OLD | NEW |