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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 GrDistanceFieldTextureEffect_DEFINED 8 #ifndef GrDistanceFieldTextureEffect_DEFINED
9 #define GrDistanceFieldTextureEffect_DEFINED 9 #define GrDistanceFieldTextureEffect_DEFINED
10 10
11 #include "GrProcessor.h" 11 #include "GrProcessor.h"
12 #include "GrGeometryProcessor.h" 12 #include "GrGeometryProcessor.h"
13 13
14 class GrGLDistanceFieldTextureEffect; 14 class GrGLDistanceFieldTextureEffect;
15 class GrGLDistanceFieldNoGammaTextureEffect;
15 class GrGLDistanceFieldLCDTextureEffect; 16 class GrGLDistanceFieldLCDTextureEffect;
16 17
17 enum GrDistanceFieldEffectFlags { 18 enum GrDistanceFieldEffectFlags {
18 kSimilarity_DistanceFieldEffectFlag = 0x01, // ctm is similarity matrix 19 kSimilarity_DistanceFieldEffectFlag = 0x01, // ctm is similarity matrix
19 kRectToRect_DistanceFieldEffectFlag = 0x02, // ctm maps rects to rects 20 kRectToRect_DistanceFieldEffectFlag = 0x02, // ctm maps rects to rects
20 kUseLCD_DistanceFieldEffectFlag = 0x04, // use lcd text 21 kUseLCD_DistanceFieldEffectFlag = 0x04, // use lcd text
21 kBGR_DistanceFieldEffectFlag = 0x08, // lcd display has bgr order 22 kBGR_DistanceFieldEffectFlag = 0x08, // lcd display has bgr order
22 kPortrait_DistanceFieldEffectFlag = 0x10, // lcd display is in portrait mode (not used yet) 23 kPortrait_DistanceFieldEffectFlag = 0x10, // lcd display is in portrait mode (not used yet)
23 24
24 kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag | 25 kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 GrTextureAccess fTextureAccess; 83 GrTextureAccess fTextureAccess;
83 #ifdef SK_GAMMA_APPLY_TO_A8 84 #ifdef SK_GAMMA_APPLY_TO_A8
84 GrTextureAccess fGammaTextureAccess; 85 GrTextureAccess fGammaTextureAccess;
85 float fLuminance; 86 float fLuminance;
86 #endif 87 #endif
87 uint32_t fFlags; 88 uint32_t fFlags;
88 const GrShaderVar& fInTextureCoords; 89 const GrShaderVar& fInTextureCoords;
89 90
90 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 91 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
91 92
92 typedef GrFragmentProcessor INHERITED; 93 typedef GrGeometryProcessor INHERITED;
94 };
95
96
97 /**
98 * The output color of this effect is a modulation of the input color and a sampl e from a
99 * distance field texture (using a smoothed step function near 0.5).
100 * It allows explicit specification of the filtering and wrap modes (GrTexturePar ams). The input
101 * coords are a custom attribute. No gamma correct blending is applied.
102 */
103 class GrDistanceFieldNoGammaTextureEffect : public GrGeometryProcessor {
104 public:
105 static GrGeometryProcessor* Create(GrTexture* tex, const GrTextureParams& pa rams,
106 uint32_t flags) {
107 return SkNEW_ARGS(GrDistanceFieldNoGammaTextureEffect, (tex, params, fla gs));
108 }
109
110 virtual ~GrDistanceFieldNoGammaTextureEffect() {}
111
112 static const char* Name() { return "DistanceFieldTexture"; }
113
114 const GrShaderVar& inTextureCoords() const { return fInTextureCoords; }
115 uint32_t getFlags() const { return fFlags; }
116
117 typedef GrGLDistanceFieldNoGammaTextureEffect GLProcessor;
118
119 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR IDE;
120
121 private:
122 GrDistanceFieldNoGammaTextureEffect(GrTexture* texture, const GrTextureParam s& params,
123 uint32_t flags);
124
125 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE;
126
127 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE;
128
129 GrTextureAccess fTextureAccess;
130 uint32_t fFlags;
131 const GrShaderVar& fInTextureCoords;
132
133 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
134
135 typedef GrGeometryProcessor INHERITED;
93 }; 136 };
94 137
95 /** 138 /**
96 * The output color of this effect is a modulation of the input color and sample s from a 139 * The output color of this effect is a modulation of the input color and sample s from a
97 * distance field texture (using a smoothed step function near 0.5), adjusted fo r LCD displays. 140 * distance field texture (using a smoothed step function near 0.5), adjusted fo r LCD displays.
98 * It allows explicit specification of the filtering and wrap modes (GrTexturePa rams). The input 141 * It allows explicit specification of the filtering and wrap modes (GrTexturePa rams). The input
99 * coords are a custom attribute. Gamma correction is handled via a texture LUT. 142 * coords are a custom attribute. Gamma correction is handled via a texture LUT.
100 */ 143 */
101 class GrDistanceFieldLCDTextureEffect : public GrGeometryProcessor { 144 class GrDistanceFieldLCDTextureEffect : public GrGeometryProcessor {
102 public: 145 public:
(...skipping 27 matching lines...) Expand all
130 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE; 173 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE;
131 174
132 GrTextureAccess fTextureAccess; 175 GrTextureAccess fTextureAccess;
133 GrTextureAccess fGammaTextureAccess; 176 GrTextureAccess fGammaTextureAccess;
134 GrColor fTextColor; 177 GrColor fTextColor;
135 uint32_t fFlags; 178 uint32_t fFlags;
136 const GrShaderVar& fInTextureCoords; 179 const GrShaderVar& fInTextureCoords;
137 180
138 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 181 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
139 182
140 typedef GrFragmentProcessor INHERITED; 183 typedef GrGeometryProcessor INHERITED;
141 }; 184 };
142 185
143 #endif 186 #endif
OLDNEW
« 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