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

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

Issue 424173002: Revert of Add effect caching to distance field text. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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/GrDistanceFieldTextContext.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 ab84753fff85642eaa2e3920a81d7716b6d0c695..38e41e5590d6d801304cdc3d5d37a6895b8907e6 100644
--- a/src/gpu/effects/GrDistanceFieldTextureEffect.h
+++ b/src/gpu/effects/GrDistanceFieldTextureEffect.h
@@ -14,24 +14,6 @@
class GrGLDistanceFieldTextureEffect;
class GrGLDistanceFieldLCDTextureEffect;
-enum GrDistanceFieldEffectFlags {
- kSimilarity_DistanceFieldEffectFlag = 0x01, // ctm is similarity matrix
- kRectToRect_DistanceFieldEffectFlag = 0x02, // ctm maps rects to rects
- kUseLCD_DistanceFieldEffectFlag = 0x04, // use lcd text
- kBGR_DistanceFieldEffectFlag = 0x08, // lcd display has bgr order
- kPortrait_DistanceFieldEffectFlag = 0x10, // lcd display is in portrait mode (not used yet)
-
- kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
- kRectToRect_DistanceFieldEffectFlag,
- // The subset of the flags relevant to GrDistanceFieldTextureEffect
- kNonLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag,
- // The subset of the flags relevant to GrDistanceFieldLCDTextureEffect
- kLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
- kRectToRect_DistanceFieldEffectFlag |
- kUseLCD_DistanceFieldEffectFlag |
- kBGR_DistanceFieldEffectFlag,
-};
-
/**
* 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).
@@ -43,14 +25,14 @@
#ifdef SK_GAMMA_APPLY_TO_A8
static GrEffect* Create(GrTexture* tex, const GrTextureParams& params,
GrTexture* gamma, const GrTextureParams& gammaParams, float lum,
- uint32_t flags) {
+ bool similarity) {
return SkNEW_ARGS(GrDistanceFieldTextureEffect, (tex, params, gamma, gammaParams, lum,
- flags));
+ similarity));
}
#else
static GrEffect* Create(GrTexture* tex, const GrTextureParams& params,
- uint32_t flags) {
- return SkNEW_ARGS(GrDistanceFieldTextureEffect, (tex, params, flags));
+ bool similarity) {
+ return SkNEW_ARGS(GrDistanceFieldTextureEffect, (tex, params, similarity));
}
#endif
@@ -62,7 +44,7 @@
#ifdef SK_GAMMA_APPLY_TO_A8
float getLuminance() const { return fLuminance; }
#endif
- uint32_t getFlags() const { return fFlags; }
+ bool isSimilarity() const { return fIsSimilarity; }
typedef GrGLDistanceFieldTextureEffect GLEffect;
@@ -73,7 +55,7 @@
#ifdef SK_GAMMA_APPLY_TO_A8
GrTexture* gamma, const GrTextureParams& gammaParams, float lum,
#endif
- uint32_t flags);
+ bool uniformScale);
virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE;
@@ -82,7 +64,7 @@
GrTextureAccess fGammaTextureAccess;
float fLuminance;
#endif
- uint32_t fFlags;
+ bool fIsSimilarity;
GR_DECLARE_EFFECT_TEST;
@@ -99,9 +81,9 @@
public:
static GrEffect* Create(GrTexture* tex, const GrTextureParams& params,
GrTexture* gamma, const GrTextureParams& gammaParams,
- SkColor textColor, uint32_t flags) {
+ SkColor textColor, bool uniformScale, bool useBGR) {
return SkNEW_ARGS(GrDistanceFieldLCDTextureEffect,
- (tex, params, gamma, gammaParams, textColor, flags));
+ (tex, params, gamma, gammaParams, textColor, uniformScale, useBGR));
}
virtual ~GrDistanceFieldLCDTextureEffect() {}
@@ -110,7 +92,8 @@
virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE;
GrColor getTextColor() const { return fTextColor; }
- uint32_t getFlags() const { return fFlags; }
+ bool isUniformScale() const { return fUniformScale; }
+ bool useBGR() const { return fUseBGR; }
typedef GrGLDistanceFieldLCDTextureEffect GLEffect;
@@ -120,14 +103,15 @@
GrDistanceFieldLCDTextureEffect(GrTexture* texture, const GrTextureParams& params,
GrTexture* gamma, const GrTextureParams& gammaParams,
SkColor textColor,
- uint32_t flags);
+ bool uniformScale, bool useBGR);
virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE;
GrTextureAccess fTextureAccess;
GrTextureAccess fGammaTextureAccess;
GrColor fTextColor;
- uint32_t fFlags;
+ bool fUniformScale;
+ bool fUseBGR;
GR_DECLARE_EFFECT_TEST;
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698