aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrDistanceFieldGeoProc.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-09-07 12:36:34 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-07 16:58:31 +0000
commit2bbdcc44c63974f29f3743bb58d929601a3f65c6 (patch)
treed420f298f606b061054e56866d1930ab84f00ed5 /src/gpu/effects/GrDistanceFieldGeoProc.h
parent4df0092eac6e9bb5afc516773a0c618630193dc6 (diff)
Rework GrSamplerParams to be more compact and use its own wrap mode enum.
The main change is to make GrSamplerParams smaller by making its enums have byte-sized underlying types. The rest is cosmetic. Change-Id: Ib71ea50612d24619a85e463826c6b8dfb9b445e3 Reviewed-on: https://skia-review.googlesource.com/43200 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/effects/GrDistanceFieldGeoProc.h')
-rw-r--r--src/gpu/effects/GrDistanceFieldGeoProc.h47
1 files changed, 22 insertions, 25 deletions
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.h b/src/gpu/effects/GrDistanceFieldGeoProc.h
index 344ac4a092..b1836dd9bb 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.h
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.h
@@ -45,7 +45,7 @@ enum GrDistanceFieldEffectFlags {
/**
* 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 (GrSamplerParams). The input
+ * It allows explicit specification of the filtering and wrap modes (GrSamplerState). The input
* coords are a custom attribute. Gamma correction is handled via a texture LUT.
*/
class GrDistanceFieldA8TextGeoProc : public GrGeometryProcessor {
@@ -53,8 +53,8 @@ public:
#ifdef SK_GAMMA_APPLY_TO_A8
static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMatrix,
sk_sp<GrTextureProxy> proxy,
- const GrSamplerParams& params,
- float lum, uint32_t flags, bool usesLocalCoords) {
+ const GrSamplerState& params, float lum, uint32_t flags,
+ bool usesLocalCoords) {
return sk_sp<GrGeometryProcessor>(
new GrDistanceFieldA8TextGeoProc(color, viewMatrix, std::move(proxy),
params, lum, flags, usesLocalCoords));
@@ -62,8 +62,8 @@ public:
#else
static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMatrix,
sk_sp<GrTextureProxy> proxy,
- const GrSamplerParams& params,
- uint32_t flags, bool usesLocalCoords) {
+ const GrSamplerState& params, uint32_t flags,
+ bool usesLocalCoords) {
return sk_sp<GrGeometryProcessor>(
new GrDistanceFieldA8TextGeoProc(color, viewMatrix, std::move(proxy),
params, flags, usesLocalCoords));
@@ -90,8 +90,8 @@ public:
GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override;
private:
- GrDistanceFieldA8TextGeoProc(GrColor, const SkMatrix& viewMatrix,
- sk_sp<GrTextureProxy> proxy, const GrSamplerParams& params,
+ GrDistanceFieldA8TextGeoProc(GrColor, const SkMatrix& viewMatrix, sk_sp<GrTextureProxy> proxy,
+ const GrSamplerState& params,
#ifdef SK_GAMMA_APPLY_TO_A8
float distanceAdjust,
#endif
@@ -114,19 +114,18 @@ private:
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 (GrSamplerParams). The input
-* coords are a custom attribute. No gamma correct blending is applied. Used for paths only.
-*/
+ * 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 (GrSamplerState). The input
+ * coords are a custom attribute. No gamma correct blending is applied. Used for paths only.
+ */
class GrDistanceFieldPathGeoProc : public GrGeometryProcessor {
public:
- static sk_sp<GrGeometryProcessor> Make(GrColor color,
- const SkMatrix& viewMatrix, sk_sp<GrTextureProxy> proxy,
- const GrSamplerParams& params,
- uint32_t flags, bool usesLocalCoords) {
+ static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMatrix,
+ sk_sp<GrTextureProxy> proxy,
+ const GrSamplerState& params, uint32_t flags,
+ bool usesLocalCoords) {
return sk_sp<GrGeometryProcessor>(
new GrDistanceFieldPathGeoProc(color, viewMatrix, std::move(proxy),
params, flags, usesLocalCoords));
@@ -149,9 +148,8 @@ public:
GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override;
private:
- GrDistanceFieldPathGeoProc(GrColor, const SkMatrix& viewMatrix,
- sk_sp<GrTextureProxy>, const GrSamplerParams&, uint32_t flags,
- bool usesLocalCoords);
+ GrDistanceFieldPathGeoProc(GrColor, const SkMatrix& viewMatrix, sk_sp<GrTextureProxy>,
+ const GrSamplerState&, uint32_t flags, bool usesLocalCoords);
GrColor fColor;
SkMatrix fViewMatrix;
@@ -170,7 +168,7 @@ private:
/**
* 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.
- * It allows explicit specification of the filtering and wrap modes (GrSamplerParams). The input
+ * It allows explicit specification of the filtering and wrap modes (GrSamplerState). The input
* coords are a custom attribute. Gamma correction is handled via a texture LUT.
*/
class GrDistanceFieldLCDTextGeoProc : public GrGeometryProcessor {
@@ -193,7 +191,7 @@ public:
static sk_sp<GrGeometryProcessor> Make(GrColor color,
const SkMatrix& viewMatrix,
sk_sp<GrTextureProxy> proxy,
- const GrSamplerParams& params,
+ const GrSamplerState& params,
DistanceAdjust distanceAdjust,
uint32_t flags,
bool usesLocalCoords) {
@@ -221,9 +219,8 @@ public:
GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override;
private:
- GrDistanceFieldLCDTextGeoProc(GrColor, const SkMatrix& viewMatrix,
- sk_sp<GrTextureProxy> proxy, const GrSamplerParams& params,
- DistanceAdjust wa, uint32_t flags,
+ GrDistanceFieldLCDTextGeoProc(GrColor, const SkMatrix& viewMatrix, sk_sp<GrTextureProxy> proxy,
+ const GrSamplerState& params, DistanceAdjust wa, uint32_t flags,
bool usesLocalCoords);
GrColor fColor;