OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrDistanceFieldGeoProc_DEFINED | 8 #ifndef GrDistanceFieldGeoProc_DEFINED |
9 #define GrDistanceFieldGeoProc_DEFINED | 9 #define GrDistanceFieldGeoProc_DEFINED |
10 | 10 |
11 #include "GrProcessor.h" | 11 #include "GrProcessor.h" |
12 #include "GrGeometryProcessor.h" | 12 #include "GrGeometryProcessor.h" |
13 | 13 |
14 class GrGLDistanceFieldA8TextGeoProc; | 14 class GrGLDistanceFieldA8TextGeoProc; |
15 class GrGLDistanceFieldPathGeoProc; | 15 class GrGLDistanceFieldPathGeoProc; |
16 class GrGLDistanceFieldLCDTextGeoProc; | 16 class GrGLDistanceFieldLCDTextGeoProc; |
17 class GrInvariantOutput; | 17 class GrInvariantOutput; |
18 | 18 |
19 enum GrDistanceFieldEffectFlags { | 19 enum GrDistanceFieldEffectFlags { |
20 kSimilarity_DistanceFieldEffectFlag = 0x01, // ctm is similarity matrix | 20 kSimilarity_DistanceFieldEffectFlag = 0x01, // ctm is similarity matrix |
21 kScaleOnly_DistanceFieldEffectFlag = 0x02, // ctm has only scale and tran
slate | 21 kScaleOnly_DistanceFieldEffectFlag = 0x02, // ctm has only scale and tran
slate |
22 kUseLCD_DistanceFieldEffectFlag = 0x04, // use lcd text | 22 kUseLCD_DistanceFieldEffectFlag = 0x04, // use lcd text |
23 kBGR_DistanceFieldEffectFlag = 0x08, // lcd display has bgr order | 23 kBGR_DistanceFieldEffectFlag = 0x08, // lcd display has bgr order |
24 kPortrait_DistanceFieldEffectFlag = 0x10, // lcd display is in portrait
mode (not used yet) | 24 kPortrait_DistanceFieldEffectFlag = 0x10, // lcd display is in portrait
mode (not used yet) |
| 25 kSRGB_DistanceFieldEffectFlag = 0x20, // assume sRGB dest (use linst
ep, not smoothstep) |
25 | 26 |
26 kInvalid_DistanceFieldEffectFlag = 0x80, // invalid state (for initiali
zation) | 27 kInvalid_DistanceFieldEffectFlag = 0x80, // invalid state (for initiali
zation) |
27 | 28 |
28 kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag
| | 29 kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag
| |
29 kScaleOnly_DistanceFieldEffectFlag, | 30 kScaleOnly_DistanceFieldEffectFlag, |
30 // The subset of the flags relevant to GrDistanceFieldA8TextGeoProc | 31 // The subset of the flags relevant to GrDistanceFieldA8TextGeoProc |
31 kNonLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag
| | 32 kNonLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag
| |
32 kScaleOnly_DistanceFieldEffectFlag, | 33 kScaleOnly_DistanceFieldEffectFlag | |
| 34 kSRGB_DistanceFieldEffectFlag, |
33 // The subset of the flags relevant to GrDistanceFieldLCDTextGeoProc | 35 // The subset of the flags relevant to GrDistanceFieldLCDTextGeoProc |
34 kLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag
| | 36 kLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag
| |
35 kScaleOnly_DistanceFieldEffectFlag | | 37 kScaleOnly_DistanceFieldEffectFlag | |
36 kUseLCD_DistanceFieldEffectFlag | | 38 kUseLCD_DistanceFieldEffectFlag | |
37 kBGR_DistanceFieldEffectFlag, | 39 kBGR_DistanceFieldEffectFlag | |
| 40 kSRGB_DistanceFieldEffectFlag, |
38 }; | 41 }; |
39 | 42 |
40 /** | 43 /** |
41 * The output color of this effect is a modulation of the input color and a samp
le from a | 44 * The output color of this effect is a modulation of the input color and a samp
le from a |
42 * distance field texture (using a smoothed step function near 0.5). | 45 * distance field texture (using a smoothed step function near 0.5). |
43 * It allows explicit specification of the filtering and wrap modes (GrTexturePa
rams). The input | 46 * It allows explicit specification of the filtering and wrap modes (GrTexturePa
rams). The input |
44 * coords are a custom attribute. Gamma correction is handled via a texture LUT. | 47 * coords are a custom attribute. Gamma correction is handled via a texture LUT. |
45 */ | 48 */ |
46 class GrDistanceFieldA8TextGeoProc : public GrGeometryProcessor { | 49 class GrDistanceFieldA8TextGeoProc : public GrGeometryProcessor { |
47 public: | 50 public: |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 const Attribute* fInColor; | 225 const Attribute* fInColor; |
223 const Attribute* fInTextureCoords; | 226 const Attribute* fInTextureCoords; |
224 bool fUsesLocalCoords; | 227 bool fUsesLocalCoords; |
225 | 228 |
226 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 229 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
227 | 230 |
228 typedef GrGeometryProcessor INHERITED; | 231 typedef GrGeometryProcessor INHERITED; |
229 }; | 232 }; |
230 | 233 |
231 #endif | 234 #endif |
OLD | NEW |