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 |
11 #define GrPaint_DEFINED | 11 #define GrPaint_DEFINED |
12 | 12 |
13 #include "GrColor.h" | 13 #include "GrColor.h" |
14 #include "GrColorSpaceXform.h" | 14 #include "GrColorSpaceXform.h" |
15 #include "GrXferProcessor.h" | 15 #include "GrXferProcessor.h" |
16 #include "effects/GrPorterDuffXferProcessor.h" | 16 #include "effects/GrPorterDuffXferProcessor.h" |
17 #include "GrFragmentProcessor.h" | 17 #include "GrFragmentProcessor.h" |
18 | 18 |
19 #include "SkBlendMode.h" | 19 #include "SkBlendMode.h" |
20 #include "SkRefCnt.h" | 20 #include "SkRefCnt.h" |
21 #include "SkRegion.h" | 21 #include "SkRegion.h" |
22 | 22 |
| 23 class GrTextureProxy; |
| 24 |
23 /** | 25 /** |
24 * The paint describes how color and coverage are computed at each pixel by GrCo
ntext draw | 26 * The paint describes how color and coverage are computed at each pixel by GrCo
ntext draw |
25 * functions and the how color is blended with the destination pixel. | 27 * functions and the how color is blended with the destination pixel. |
26 * | 28 * |
27 * The paint allows installation of custom color and coverage stages. New types
of stages are | 29 * The paint allows installation of custom color and coverage stages. New types
of stages are |
28 * created by subclassing GrProcessor. | 30 * created by subclassing GrProcessor. |
29 * | 31 * |
30 * The primitive color computation starts with the color specified by setColor()
. This color is the | 32 * The primitive color computation starts with the color specified by setColor()
. This color is the |
31 * input to the first color stage. Each color stage feeds its output to the next
color stage. | 33 * input to the first color stage. Each color stage feeds its output to the next
color stage. |
32 * | 34 * |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 /** | 124 /** |
123 * Helpers for adding color or coverage effects that sample a texture. The m
atrix is applied | 125 * Helpers for adding color or coverage effects that sample a texture. The m
atrix is applied |
124 * to the src space position to compute texture coordinates. | 126 * to the src space position to compute texture coordinates. |
125 */ | 127 */ |
126 void addColorTextureProcessor(GrTexture*, sk_sp<GrColorSpaceXform>, const Sk
Matrix&); | 128 void addColorTextureProcessor(GrTexture*, sk_sp<GrColorSpaceXform>, const Sk
Matrix&); |
127 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&); | 129 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&); |
128 void addColorTextureProcessor(GrTexture*, sk_sp<GrColorSpaceXform>, const Sk
Matrix&, | 130 void addColorTextureProcessor(GrTexture*, sk_sp<GrColorSpaceXform>, const Sk
Matrix&, |
129 const GrTextureParams&); | 131 const GrTextureParams&); |
130 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&, const GrTextur
eParams&); | 132 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&, const GrTextur
eParams&); |
131 | 133 |
| 134 //-- |
| 135 void addColorTextureProcessor(GrTextureProxy*, sk_sp<GrColorSpaceXform>, con
st SkMatrix&); |
| 136 void addCoverageTextureProcessor(GrTextureProxy*, const SkMatrix&); |
| 137 void addColorTextureProcessor(GrTextureProxy*, sk_sp<GrColorSpaceXform>, con
st SkMatrix&, |
| 138 const GrTextureParams&); |
| 139 void addCoverageTextureProcessor(GrTextureProxy*, const SkMatrix&, const GrT
extureParams&); |
| 140 //-- |
| 141 |
132 int numColorFragmentProcessors() const { return fColorFragmentProcessors.cou
nt(); } | 142 int numColorFragmentProcessors() const { return fColorFragmentProcessors.cou
nt(); } |
133 int numCoverageFragmentProcessors() const { return fCoverageFragmentProcesso
rs.count(); } | 143 int numCoverageFragmentProcessors() const { return fCoverageFragmentProcesso
rs.count(); } |
134 int numTotalFragmentProcessors() const { return this->numColorFragmentProces
sors() + | 144 int numTotalFragmentProcessors() const { return this->numColorFragmentProces
sors() + |
135 this->numCoverageFragmentProcessor
s(); } | 145 this->numCoverageFragmentProcessor
s(); } |
136 | 146 |
137 GrXPFactory* getXPFactory() const { | 147 GrXPFactory* getXPFactory() const { |
138 return fXPFactory.get(); | 148 return fXPFactory.get(); |
139 } | 149 } |
140 | 150 |
141 GrFragmentProcessor* getColorFragmentProcessor(int i) const { | 151 GrFragmentProcessor* getColorFragmentProcessor(int i) const { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 197 |
188 bool fAntiAlias; | 198 bool fAntiAlias; |
189 bool fDisableOutputConversionToSRGB; | 199 bool fDisableOutputConversionToSRGB; |
190 bool fAllowSRGBInputs; | 200 bool fAllowSRGBInputs; |
191 bool fUsesDistanceVectorField; | 201 bool fUsesDistanceVectorField; |
192 | 202 |
193 GrColor4f fColor; | 203 GrColor4f fColor; |
194 }; | 204 }; |
195 | 205 |
196 #endif | 206 #endif |
OLD | NEW |