| 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 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 GrTexture* tex, const GrTextureParams
& params, | 61 GrTexture* tex, const GrTextureParams
& params, |
| 62 uint32_t flags, bool usesLocalCoords)
{ | 62 uint32_t flags, bool usesLocalCoords)
{ |
| 63 return sk_sp<GrGeometryProcessor>( | 63 return sk_sp<GrGeometryProcessor>( |
| 64 new GrDistanceFieldA8TextGeoProc(color, viewMatrix, tex, params, fla
gs, | 64 new GrDistanceFieldA8TextGeoProc(color, viewMatrix, tex, params, fla
gs, |
| 65 usesLocalCoords)); | 65 usesLocalCoords)); |
| 66 } | 66 } |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 virtual ~GrDistanceFieldA8TextGeoProc() {} | 69 virtual ~GrDistanceFieldA8TextGeoProc() {} |
| 70 | 70 |
| 71 const char* name() const override { return "DistanceFieldTexture"; } | 71 const char* name() const override { return "DistanceFieldA8Text"; } |
| 72 | 72 |
| 73 const Attribute* inPosition() const { return fInPosition; } | 73 const Attribute* inPosition() const { return fInPosition; } |
| 74 const Attribute* inColor() const { return fInColor; } | 74 const Attribute* inColor() const { return fInColor; } |
| 75 const Attribute* inTextureCoords() const { return fInTextureCoords; } | 75 const Attribute* inTextureCoords() const { return fInTextureCoords; } |
| 76 GrColor color() const { return fColor; } | 76 GrColor color() const { return fColor; } |
| 77 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } | 77 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } |
| 78 const SkMatrix& viewMatrix() const { return fViewMatrix; } | 78 const SkMatrix& viewMatrix() const { return fViewMatrix; } |
| 79 bool usesLocalCoords() const { return fUsesLocalCoords; } | 79 bool usesLocalCoords() const { return fUsesLocalCoords; } |
| 80 #ifdef SK_GAMMA_APPLY_TO_A8 | 80 #ifdef SK_GAMMA_APPLY_TO_A8 |
| 81 float getDistanceAdjust() const { return fDistanceAdjust; } | 81 float getDistanceAdjust() const { return fDistanceAdjust; } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 public: | 122 public: |
| 123 static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMa
trix, | 123 static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMa
trix, |
| 124 GrTexture* tex, const GrTextureParams
& params, | 124 GrTexture* tex, const GrTextureParams
& params, |
| 125 uint32_t flags, bool usesLocalCoords)
{ | 125 uint32_t flags, bool usesLocalCoords)
{ |
| 126 return sk_sp<GrGeometryProcessor>( | 126 return sk_sp<GrGeometryProcessor>( |
| 127 new GrDistanceFieldPathGeoProc(color, viewMatrix, tex, params, flags
, usesLocalCoords)); | 127 new GrDistanceFieldPathGeoProc(color, viewMatrix, tex, params, flags
, usesLocalCoords)); |
| 128 } | 128 } |
| 129 | 129 |
| 130 virtual ~GrDistanceFieldPathGeoProc() {} | 130 virtual ~GrDistanceFieldPathGeoProc() {} |
| 131 | 131 |
| 132 const char* name() const override { return "DistanceFieldTexture"; } | 132 const char* name() const override { return "DistanceFieldPath"; } |
| 133 | 133 |
| 134 const Attribute* inPosition() const { return fInPosition; } | 134 const Attribute* inPosition() const { return fInPosition; } |
| 135 const Attribute* inColor() const { return fInColor; } | 135 const Attribute* inColor() const { return fInColor; } |
| 136 const Attribute* inTextureCoords() const { return fInTextureCoords; } | 136 const Attribute* inTextureCoords() const { return fInTextureCoords; } |
| 137 GrColor color() const { return fColor; } | 137 GrColor color() const { return fColor; } |
| 138 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } | 138 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } |
| 139 const SkMatrix& viewMatrix() const { return fViewMatrix; } | 139 const SkMatrix& viewMatrix() const { return fViewMatrix; } |
| 140 uint32_t getFlags() const { return fFlags; } | 140 uint32_t getFlags() const { return fFlags; } |
| 141 bool usesLocalCoords() const { return fUsesLocalCoords; } | 141 bool usesLocalCoords() const { return fUsesLocalCoords; } |
| 142 | 142 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 GrTexture* tex, const GrTextureParams
& params, | 190 GrTexture* tex, const GrTextureParams
& params, |
| 191 DistanceAdjust distanceAdjust, uint32
_t flags, | 191 DistanceAdjust distanceAdjust, uint32
_t flags, |
| 192 bool usesLocalCoords) { | 192 bool usesLocalCoords) { |
| 193 return sk_sp<GrGeometryProcessor>( | 193 return sk_sp<GrGeometryProcessor>( |
| 194 new GrDistanceFieldLCDTextGeoProc(color, viewMatrix, tex, params, di
stanceAdjust, | 194 new GrDistanceFieldLCDTextGeoProc(color, viewMatrix, tex, params, di
stanceAdjust, |
| 195 flags, usesLocalCoords)); | 195 flags, usesLocalCoords)); |
| 196 } | 196 } |
| 197 | 197 |
| 198 virtual ~GrDistanceFieldLCDTextGeoProc() {} | 198 virtual ~GrDistanceFieldLCDTextGeoProc() {} |
| 199 | 199 |
| 200 const char* name() const override { return "DistanceFieldLCDTexture"; } | 200 const char* name() const override { return "DistanceFieldLCDText"; } |
| 201 | 201 |
| 202 const Attribute* inPosition() const { return fInPosition; } | 202 const Attribute* inPosition() const { return fInPosition; } |
| 203 const Attribute* inColor() const { return fInColor; } | 203 const Attribute* inColor() const { return fInColor; } |
| 204 const Attribute* inTextureCoords() const { return fInTextureCoords; } | 204 const Attribute* inTextureCoords() const { return fInTextureCoords; } |
| 205 DistanceAdjust getDistanceAdjust() const { return fDistanceAdjust; } | 205 DistanceAdjust getDistanceAdjust() const { return fDistanceAdjust; } |
| 206 GrColor color() const { return fColor; } | 206 GrColor color() const { return fColor; } |
| 207 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } | 207 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } |
| 208 const SkMatrix& viewMatrix() const { return fViewMatrix; } | 208 const SkMatrix& viewMatrix() const { return fViewMatrix; } |
| 209 uint32_t getFlags() const { return fFlags; } | 209 uint32_t getFlags() const { return fFlags; } |
| 210 bool usesLocalCoords() const { return fUsesLocalCoords; } | 210 bool usesLocalCoords() const { return fUsesLocalCoords; } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 228 const Attribute* fInColor; | 228 const Attribute* fInColor; |
| 229 const Attribute* fInTextureCoords; | 229 const Attribute* fInTextureCoords; |
| 230 bool fUsesLocalCoords; | 230 bool fUsesLocalCoords; |
| 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 |