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

Unified Diff: src/gpu/effects/GrDistanceFieldTextureEffect.h

Issue 589103004: Add GrAASmallPathRenderer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address nits Created 6 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDistanceFieldTextureEffect.h
diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.h b/src/gpu/effects/GrDistanceFieldTextureEffect.h
index efd622ea727ef8b4c54fa1600afae54560c3508f..a49102d12ac4993a0af12223eb1ee4d1af9955ef 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 {
@@ -89,7 +90,49 @@ private:
GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
- typedef GrFragmentProcessor INHERITED;
+ typedef GrGeometryProcessor 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,
+ uint32_t flags) {
+ return SkNEW_ARGS(GrDistanceFieldNoGammaTextureEffect, (tex, params, flags));
+ }
+
+ virtual ~GrDistanceFieldNoGammaTextureEffect() {}
+
+ static const char* Name() { return "DistanceFieldTexture"; }
+
+ const GrShaderVar& inTextureCoords() const { return fInTextureCoords; }
+ uint32_t getFlags() const { return fFlags; }
+
+ typedef GrGLDistanceFieldNoGammaTextureEffect GLProcessor;
+
+ virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERRIDE;
+
+private:
+ GrDistanceFieldNoGammaTextureEffect(GrTexture* texture, const GrTextureParams& params,
+ uint32_t flags);
+
+ virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE;
+
+ virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE;
+
+ GrTextureAccess fTextureAccess;
+ uint32_t fFlags;
+ const GrShaderVar& fInTextureCoords;
+
+ GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
+
+ typedef GrGeometryProcessor INHERITED;
};
/**
@@ -137,7 +180,7 @@ private:
GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
- typedef GrFragmentProcessor INHERITED;
+ typedef GrGeometryProcessor INHERITED;
};
#endif
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698