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 GrDistanceFieldTextureEffect_DEFINED | 8 #ifndef GrDistanceFieldTextureEffect_DEFINED |
9 #define GrDistanceFieldTextureEffect_DEFINED | 9 #define GrDistanceFieldTextureEffect_DEFINED |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix
, GrTexture* tex, | 59 static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix
, GrTexture* tex, |
60 const GrTextureParams& params, | 60 const GrTextureParams& params, |
61 uint32_t flags, bool opaqueVertexColors)
{ | 61 uint32_t flags, bool opaqueVertexColors)
{ |
62 return SkNEW_ARGS(GrDistanceFieldTextureEffect, (color, viewMatrix, tex
, params, flags, | 62 return SkNEW_ARGS(GrDistanceFieldTextureEffect, (color, viewMatrix, tex
, params, flags, |
63 opaqueVertexColors)); | 63 opaqueVertexColors)); |
64 } | 64 } |
65 #endif | 65 #endif |
66 | 66 |
67 virtual ~GrDistanceFieldTextureEffect() {} | 67 virtual ~GrDistanceFieldTextureEffect() {} |
68 | 68 |
69 const char* name() const SK_OVERRIDE { return "DistanceFieldTexture"; } | 69 const char* name() const override { return "DistanceFieldTexture"; } |
70 | 70 |
71 const Attribute* inPosition() const { return fInPosition; } | 71 const Attribute* inPosition() const { return fInPosition; } |
72 const Attribute* inColor() const { return fInColor; } | 72 const Attribute* inColor() const { return fInColor; } |
73 const Attribute* inTextureCoords() const { return fInTextureCoords; } | 73 const Attribute* inTextureCoords() const { return fInTextureCoords; } |
74 #ifdef SK_GAMMA_APPLY_TO_A8 | 74 #ifdef SK_GAMMA_APPLY_TO_A8 |
75 float getLuminance() const { return fLuminance; } | 75 float getLuminance() const { return fLuminance; } |
76 #endif | 76 #endif |
77 uint32_t getFlags() const { return fFlags; } | 77 uint32_t getFlags() const { return fFlags; } |
78 | 78 |
79 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 79 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
80 const GrGLCaps& caps, | 80 const GrGLCaps& caps, |
81 GrProcessorKeyBuilder* b) const SK_OVERRIDE; | 81 GrProcessorKeyBuilder* b) const override; |
82 | 82 |
83 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 83 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
84 const GrGLCaps&) const SK_O
VERRIDE; | 84 const GrGLCaps&) const over
ride; |
85 | 85 |
86 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
SK_OVERRIDE; | 86 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
override; |
87 | 87 |
88 bool onCanMakeEqual(const GrBatchTracker&, | 88 bool onCanMakeEqual(const GrBatchTracker&, |
89 const GrGeometryProcessor&, | 89 const GrGeometryProcessor&, |
90 const GrBatchTracker&) const SK_OVERRIDE; | 90 const GrBatchTracker&) const override; |
91 | 91 |
92 private: | 92 private: |
93 GrDistanceFieldTextureEffect(GrColor, const SkMatrix& viewMatrix, GrTexture*
texture, | 93 GrDistanceFieldTextureEffect(GrColor, const SkMatrix& viewMatrix, GrTexture*
texture, |
94 const GrTextureParams& params, | 94 const GrTextureParams& params, |
95 #ifdef SK_GAMMA_APPLY_TO_A8 | 95 #ifdef SK_GAMMA_APPLY_TO_A8 |
96 GrTexture* gamma, const GrTextureParams& gammaP
arams, float lum, | 96 GrTexture* gamma, const GrTextureParams& gammaP
arams, float lum, |
97 #endif | 97 #endif |
98 uint32_t flags, bool opaqueVertexColors); | 98 uint32_t flags, bool opaqueVertexColors); |
99 | 99 |
100 bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; | 100 bool onIsEqual(const GrGeometryProcessor& other) const override; |
101 | 101 |
102 void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const SK_OVERRIDE; | 102 void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const override; |
103 | 103 |
104 GrTextureAccess fTextureAccess; | 104 GrTextureAccess fTextureAccess; |
105 #ifdef SK_GAMMA_APPLY_TO_A8 | 105 #ifdef SK_GAMMA_APPLY_TO_A8 |
106 GrTextureAccess fGammaTextureAccess; | 106 GrTextureAccess fGammaTextureAccess; |
107 float fLuminance; | 107 float fLuminance; |
108 #endif | 108 #endif |
109 uint32_t fFlags; | 109 uint32_t fFlags; |
110 const Attribute* fInPosition; | 110 const Attribute* fInPosition; |
111 const Attribute* fInColor; | 111 const Attribute* fInColor; |
112 const Attribute* fInTextureCoords; | 112 const Attribute* fInTextureCoords; |
(...skipping 14 matching lines...) Expand all Loading... |
127 public: | 127 public: |
128 static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix
, GrTexture* tex, | 128 static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix
, GrTexture* tex, |
129 const GrTextureParams& params, | 129 const GrTextureParams& params, |
130 uint32_t flags, bool opaqueVertexColors)
{ | 130 uint32_t flags, bool opaqueVertexColors)
{ |
131 return SkNEW_ARGS(GrDistanceFieldNoGammaTextureEffect, (color, viewMatri
x, tex, params, | 131 return SkNEW_ARGS(GrDistanceFieldNoGammaTextureEffect, (color, viewMatri
x, tex, params, |
132 flags, opaqueVer
texColors)); | 132 flags, opaqueVer
texColors)); |
133 } | 133 } |
134 | 134 |
135 virtual ~GrDistanceFieldNoGammaTextureEffect() {} | 135 virtual ~GrDistanceFieldNoGammaTextureEffect() {} |
136 | 136 |
137 const char* name() const SK_OVERRIDE { return "DistanceFieldTexture"; } | 137 const char* name() const override { return "DistanceFieldTexture"; } |
138 | 138 |
139 const Attribute* inPosition() const { return fInPosition; } | 139 const Attribute* inPosition() const { return fInPosition; } |
140 const Attribute* inColor() const { return fInColor; } | 140 const Attribute* inColor() const { return fInColor; } |
141 const Attribute* inTextureCoords() const { return fInTextureCoords; } | 141 const Attribute* inTextureCoords() const { return fInTextureCoords; } |
142 uint32_t getFlags() const { return fFlags; } | 142 uint32_t getFlags() const { return fFlags; } |
143 | 143 |
144 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 144 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
145 const GrGLCaps& caps, | 145 const GrGLCaps& caps, |
146 GrProcessorKeyBuilder* b) const SK_OVERRIDE; | 146 GrProcessorKeyBuilder* b) const override; |
147 | 147 |
148 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 148 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
149 const GrGLCaps&) const SK_O
VERRIDE; | 149 const GrGLCaps&) const over
ride; |
150 | 150 |
151 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
SK_OVERRIDE; | 151 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
override; |
152 | 152 |
153 bool onCanMakeEqual(const GrBatchTracker&, | 153 bool onCanMakeEqual(const GrBatchTracker&, |
154 const GrGeometryProcessor&, | 154 const GrGeometryProcessor&, |
155 const GrBatchTracker&) const SK_OVERRIDE; | 155 const GrBatchTracker&) const override; |
156 | 156 |
157 private: | 157 private: |
158 GrDistanceFieldNoGammaTextureEffect(GrColor, const SkMatrix& viewMatrix, GrT
exture* texture, | 158 GrDistanceFieldNoGammaTextureEffect(GrColor, const SkMatrix& viewMatrix, GrT
exture* texture, |
159 const GrTextureParams& params, uint32_t
flags, | 159 const GrTextureParams& params, uint32_t
flags, |
160 bool opaqueVertexColors); | 160 bool opaqueVertexColors); |
161 | 161 |
162 bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; | 162 bool onIsEqual(const GrGeometryProcessor& other) const override; |
163 | 163 |
164 void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const SK_OVERRIDE; | 164 void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const override; |
165 | 165 |
166 GrTextureAccess fTextureAccess; | 166 GrTextureAccess fTextureAccess; |
167 uint32_t fFlags; | 167 uint32_t fFlags; |
168 const Attribute* fInPosition; | 168 const Attribute* fInPosition; |
169 const Attribute* fInColor; | 169 const Attribute* fInColor; |
170 const Attribute* fInTextureCoords; | 170 const Attribute* fInTextureCoords; |
171 | 171 |
172 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 172 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
173 | 173 |
174 typedef GrGeometryProcessor INHERITED; | 174 typedef GrGeometryProcessor INHERITED; |
(...skipping 10 matching lines...) Expand all Loading... |
185 static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix
, GrTexture* tex, | 185 static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix
, GrTexture* tex, |
186 const GrTextureParams& params, GrTexture*
gamma, | 186 const GrTextureParams& params, GrTexture*
gamma, |
187 const GrTextureParams& gammaParams, | 187 const GrTextureParams& gammaParams, |
188 SkColor textColor, uint32_t flags) { | 188 SkColor textColor, uint32_t flags) { |
189 return SkNEW_ARGS(GrDistanceFieldLCDTextureEffect, | 189 return SkNEW_ARGS(GrDistanceFieldLCDTextureEffect, |
190 (color, viewMatrix, tex, params, gamma, gammaParams, t
extColor, flags)); | 190 (color, viewMatrix, tex, params, gamma, gammaParams, t
extColor, flags)); |
191 } | 191 } |
192 | 192 |
193 virtual ~GrDistanceFieldLCDTextureEffect() {} | 193 virtual ~GrDistanceFieldLCDTextureEffect() {} |
194 | 194 |
195 const char* name() const SK_OVERRIDE { return "DistanceFieldLCDTexture"; } | 195 const char* name() const override { return "DistanceFieldLCDTexture"; } |
196 | 196 |
197 const Attribute* inPosition() const { return fInPosition; } | 197 const Attribute* inPosition() const { return fInPosition; } |
198 const Attribute* inTextureCoords() const { return fInTextureCoords; } | 198 const Attribute* inTextureCoords() const { return fInTextureCoords; } |
199 GrColor getTextColor() const { return fTextColor; } | 199 GrColor getTextColor() const { return fTextColor; } |
200 uint32_t getFlags() const { return fFlags; } | 200 uint32_t getFlags() const { return fFlags; } |
201 | 201 |
202 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 202 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
203 const GrGLCaps& caps, | 203 const GrGLCaps& caps, |
204 GrProcessorKeyBuilder* b) const SK_OVERRIDE; | 204 GrProcessorKeyBuilder* b) const override; |
205 | 205 |
206 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 206 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
207 const GrGLCaps&) const SK_O
VERRIDE; | 207 const GrGLCaps&) const over
ride; |
208 | 208 |
209 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
SK_OVERRIDE; | 209 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
override; |
210 | 210 |
211 bool onCanMakeEqual(const GrBatchTracker&, | 211 bool onCanMakeEqual(const GrBatchTracker&, |
212 const GrGeometryProcessor&, | 212 const GrGeometryProcessor&, |
213 const GrBatchTracker&) const SK_OVERRIDE; | 213 const GrBatchTracker&) const override; |
214 | 214 |
215 private: | 215 private: |
216 GrDistanceFieldLCDTextureEffect(GrColor, const SkMatrix& viewMatrix, GrTextu
re* texture, | 216 GrDistanceFieldLCDTextureEffect(GrColor, const SkMatrix& viewMatrix, GrTextu
re* texture, |
217 const GrTextureParams& params, | 217 const GrTextureParams& params, |
218 GrTexture* gamma, const GrTextureParams& gam
maParams, | 218 GrTexture* gamma, const GrTextureParams& gam
maParams, |
219 SkColor textColor, uint32_t flags); | 219 SkColor textColor, uint32_t flags); |
220 | 220 |
221 bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; | 221 bool onIsEqual(const GrGeometryProcessor& other) const override; |
222 | 222 |
223 void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const SK_OVERRIDE; | 223 void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const override; |
224 | 224 |
225 GrTextureAccess fTextureAccess; | 225 GrTextureAccess fTextureAccess; |
226 GrTextureAccess fGammaTextureAccess; | 226 GrTextureAccess fGammaTextureAccess; |
227 GrColor fTextColor; | 227 GrColor fTextColor; |
228 uint32_t fFlags; | 228 uint32_t fFlags; |
229 const Attribute* fInPosition; | 229 const Attribute* fInPosition; |
230 const Attribute* fInTextureCoords; | 230 const Attribute* fInTextureCoords; |
231 | 231 |
232 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 232 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
233 | 233 |
234 typedef GrGeometryProcessor INHERITED; | 234 typedef GrGeometryProcessor INHERITED; |
235 }; | 235 }; |
236 | 236 |
237 #endif | 237 #endif |
OLD | NEW |