Chromium Code Reviews| Index: src/gpu/effects/GrDistanceFieldTextureEffect.h |
| diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.h b/src/gpu/effects/GrDistanceFieldTextureEffect.h |
| index b8d774d6101dde312c2a80e1b9f0e9b8ab1b321a..220a22aa8cb28d322b7893899728f6a0fdf31b9b 100644 |
| --- a/src/gpu/effects/GrDistanceFieldTextureEffect.h |
| +++ b/src/gpu/effects/GrDistanceFieldTextureEffect.h |
| @@ -12,6 +12,7 @@ |
| #include "GrGeometryProcessor.h" |
| class GrGLDistanceFieldTextureEffect; |
| +class GrGLDistanceFieldNoGammaTextureEffect; |
| class GrGLDistanceFieldLCDTextureEffect; |
| enum GrDistanceFieldEffectFlags { |
| @@ -92,6 +93,48 @@ private: |
| typedef GrFragmentProcessor INHERITED; |
| }; |
| + |
| +/** |
| +* The output color of this effect is a modulation of the input color and a sample from a |
| +* distance field texture (using a smoothed step function near 0.5). |
| +* It allows explicit specification of the filtering and wrap modes (GrTextureParams). The input |
| +* coords are a custom attribute. No gamma correct blending is applied. |
| +*/ |
| +class GrDistanceFieldNoGammaTextureEffect : public GrGeometryProcessor { |
| +public: |
| + static GrGeometryProcessor* Create(GrTexture* tex, const GrTextureParams& params, |
|
robertphillips
2014/09/26 14:00:31
line this up ?
jvanverth1
2014/10/03 17:28:24
Done.
|
| + uint32_t flags) { |
| + return SkNEW_ARGS(GrDistanceFieldNoGammaTextureEffect, (tex, params, flags)); |
| + } |
| + |
| + virtual ~GrDistanceFieldNoGammaTextureEffect() {} |
| + |
| + static const char* Name() { return "DistanceFieldTexture"; } |
| + |
| + virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE; |
| + |
| + const GrShaderVar& inTextureCoords() const { return fInTextureCoords; } |
| + uint32_t getFlags() const { return fFlags; } |
| + |
|
robertphillips
2014/09/26 14:00:31
Where is this used ?
jvanverth1
2014/10/03 17:28:24
In GrTBackendProcessorFactory.
|
| + typedef GrGLDistanceFieldNoGammaTextureEffect GLProcessor; |
| + |
| + virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERRIDE; |
| + |
| +private: |
| + GrDistanceFieldNoGammaTextureEffect(GrTexture* texture, const GrTextureParams& params, |
|
robertphillips
2014/09/26 14:00:31
line this up ?
jvanverth1
2014/10/03 17:28:24
Done.
|
| + uint32_t flags); |
| + |
| + virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE; |
| + |
| + GrTextureAccess fTextureAccess; |
| + uint32_t fFlags; |
| + const GrShaderVar& fInTextureCoords; |
| + |
| + GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
| + |
|
robertphillips
2014/09/26 14:00:31
GrGeometryProcessor ?
jvanverth1
2014/10/03 17:28:24
Done.
|
| + typedef GrFragmentProcessor INHERITED; |
| +}; |
| + |
| /** |
| * The output color of this effect is a modulation of the input color and samples from a |
| * distance field texture (using a smoothed step function near 0.5), adjusted for LCD displays. |