Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: src/gpu/effects/GrDistanceFieldGeoProc.h

Issue 1514563002: Revert of Allow LCD text to batch across colorchanges. This will always use (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 17 matching lines...) Expand all
28 28
29 kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag | 29 kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
30 kRectToRect_DistanceFieldEffectFlag, 30 kRectToRect_DistanceFieldEffectFlag,
31 // The subset of the flags relevant to GrDistanceFieldA8TextGeoProc 31 // The subset of the flags relevant to GrDistanceFieldA8TextGeoProc
32 kNonLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag | 32 kNonLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
33 kColorAttr_DistanceFieldEffectFlag, 33 kColorAttr_DistanceFieldEffectFlag,
34 // The subset of the flags relevant to GrDistanceFieldLCDTextGeoProc 34 // The subset of the flags relevant to GrDistanceFieldLCDTextGeoProc
35 kLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag | 35 kLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
36 kRectToRect_DistanceFieldEffectFlag | 36 kRectToRect_DistanceFieldEffectFlag |
37 kUseLCD_DistanceFieldEffectFlag | 37 kUseLCD_DistanceFieldEffectFlag |
38 kBGR_DistanceFieldEffectFlag | 38 kBGR_DistanceFieldEffectFlag,
39 kColorAttr_DistanceFieldEffectFlag,
40 }; 39 };
41 40
42 /** 41 /**
43 * The output color of this effect is a modulation of the input color and a samp le from a 42 * The output color of this effect is a modulation of the input color and a samp le from a
44 * distance field texture (using a smoothed step function near 0.5). 43 * distance field texture (using a smoothed step function near 0.5).
45 * It allows explicit specification of the filtering and wrap modes (GrTexturePa rams). The input 44 * It allows explicit specification of the filtering and wrap modes (GrTexturePa rams). The input
46 * coords are a custom attribute. Gamma correction is handled via a texture LUT. 45 * coords are a custom attribute. Gamma correction is handled via a texture LUT.
47 */ 46 */
48 class GrDistanceFieldA8TextGeoProc : public GrGeometryProcessor { 47 class GrDistanceFieldA8TextGeoProc : public GrGeometryProcessor {
49 public: 48 public:
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 bool usesLocalCoords) { 190 bool usesLocalCoords) {
192 return new GrDistanceFieldLCDTextGeoProc(color, viewMatrix, tex, params, distanceAdjust, 191 return new GrDistanceFieldLCDTextGeoProc(color, viewMatrix, tex, params, distanceAdjust,
193 flags, usesLocalCoords); 192 flags, usesLocalCoords);
194 } 193 }
195 194
196 virtual ~GrDistanceFieldLCDTextGeoProc() {} 195 virtual ~GrDistanceFieldLCDTextGeoProc() {}
197 196
198 const char* name() const override { return "DistanceFieldLCDTexture"; } 197 const char* name() const override { return "DistanceFieldLCDTexture"; }
199 198
200 const Attribute* inPosition() const { return fInPosition; } 199 const Attribute* inPosition() const { return fInPosition; }
201 const Attribute* inColor() const { return fInColor; }
202 const Attribute* inTextureCoords() const { return fInTextureCoords; } 200 const Attribute* inTextureCoords() const { return fInTextureCoords; }
203 DistanceAdjust getDistanceAdjust() const { return fDistanceAdjust; } 201 DistanceAdjust getDistanceAdjust() const { return fDistanceAdjust; }
204 GrColor color() const { return fColor; } 202 GrColor color() const { return fColor; }
205 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } 203 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; }
206 bool hasVertexColor() const { return SkToBool(fInColor); }
207 const SkMatrix& viewMatrix() const { return fViewMatrix; } 204 const SkMatrix& viewMatrix() const { return fViewMatrix; }
208 uint32_t getFlags() const { return fFlags; } 205 uint32_t getFlags() const { return fFlags; }
209 bool usesLocalCoords() const { return fUsesLocalCoords; } 206 bool usesLocalCoords() const { return fUsesLocalCoords; }
210 207
211 void getGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c onst override; 208 void getGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c onst override;
212 209
213 GrGLSLPrimitiveProcessor* createGLSLInstance(const GrGLSLCaps&) const overri de; 210 GrGLSLPrimitiveProcessor* createGLSLInstance(const GrGLSLCaps&) const overri de;
214 211
215 private: 212 private:
216 GrDistanceFieldLCDTextGeoProc(GrColor, const SkMatrix& viewMatrix, 213 GrDistanceFieldLCDTextGeoProc(GrColor, const SkMatrix& viewMatrix,
217 GrTexture* texture, const GrTextureParams& par ams, 214 GrTexture* texture, const GrTextureParams& par ams,
218 DistanceAdjust wa, uint32_t flags, 215 DistanceAdjust wa, uint32_t flags,
219 bool usesLocalCoords); 216 bool usesLocalCoords);
220 217
221 GrColor fColor; 218 GrColor fColor;
222 SkMatrix fViewMatrix; 219 SkMatrix fViewMatrix;
223 GrTextureAccess fTextureAccess; 220 GrTextureAccess fTextureAccess;
224 DistanceAdjust fDistanceAdjust; 221 DistanceAdjust fDistanceAdjust;
225 uint32_t fFlags; 222 uint32_t fFlags;
226 const Attribute* fInPosition; 223 const Attribute* fInPosition;
227 const Attribute* fInColor;
228 const Attribute* fInTextureCoords; 224 const Attribute* fInTextureCoords;
229 bool fUsesLocalCoords; 225 bool fUsesLocalCoords;
230 226
231 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 227 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
232 228
233 typedef GrGeometryProcessor INHERITED; 229 typedef GrGeometryProcessor INHERITED;
234 }; 230 };
235 231
236 #endif 232 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698