OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrTextureDomainEffect_DEFINED | 8 #ifndef GrTextureDomainEffect_DEFINED |
9 #define GrTextureDomainEffect_DEFINED | 9 #define GrTextureDomainEffect_DEFINED |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 }; | 131 }; |
132 | 132 |
133 protected: | 133 protected: |
134 Mode fMode; | 134 Mode fMode; |
135 SkRect fDomain; | 135 SkRect fDomain; |
136 int fIndex; | 136 int fIndex; |
137 | 137 |
138 typedef GrSingleTextureEffect INHERITED; | 138 typedef GrSingleTextureEffect INHERITED; |
139 }; | 139 }; |
140 | 140 |
141 class GrGLTextureDomainEffect; | |
142 | |
143 /** | 141 /** |
144 * A basic texture effect that uses GrTextureDomain. | 142 * A basic texture effect that uses GrTextureDomain. |
145 */ | 143 */ |
146 class GrTextureDomainEffect : public GrSingleTextureEffect { | 144 class GrTextureDomainEffect : public GrSingleTextureEffect { |
147 | 145 |
148 public: | 146 public: |
149 static GrFragmentProcessor* Create(GrTexture*, | 147 static GrFragmentProcessor* Create(GrTexture*, |
150 const SkMatrix&, | 148 const SkMatrix&, |
151 const SkRect& domain, | 149 const SkRect& domain, |
152 GrTextureDomain::Mode, | 150 GrTextureDomain::Mode, |
153 GrTextureParams::FilterMode filterMode, | 151 GrTextureParams::FilterMode filterMode, |
154 GrCoordSet = kLocal_GrCoordSet); | 152 GrCoordSet = kLocal_GrCoordSet); |
155 | 153 |
156 virtual ~GrTextureDomainEffect(); | 154 virtual ~GrTextureDomainEffect(); |
157 | 155 |
158 static const char* Name() { return "TextureDomain"; } | 156 virtual const char* name() const SK_OVERRIDE { return "TextureDomain"; } |
159 | 157 |
160 typedef GrGLTextureDomainEffect GLProcessor; | 158 virtual void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) cons
t SK_OVERRIDE; |
161 | 159 |
162 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
IDE; | 160 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE; |
163 | 161 |
164 const GrTextureDomain& textureDomain() const { return fTextureDomain; } | 162 const GrTextureDomain& textureDomain() const { return fTextureDomain; } |
165 | 163 |
166 protected: | 164 protected: |
167 GrTextureDomain fTextureDomain; | 165 GrTextureDomain fTextureDomain; |
168 | 166 |
169 private: | 167 private: |
170 GrTextureDomainEffect(GrTexture*, | 168 GrTextureDomainEffect(GrTexture*, |
171 const SkMatrix&, | 169 const SkMatrix&, |
172 const SkRect& domain, | 170 const SkRect& domain, |
173 GrTextureDomain::Mode, | 171 GrTextureDomain::Mode, |
174 GrTextureParams::FilterMode, | 172 GrTextureParams::FilterMode, |
175 GrCoordSet); | 173 GrCoordSet); |
176 | 174 |
177 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; | 175 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; |
178 | 176 |
179 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE; | 177 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE; |
180 | 178 |
181 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 179 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
182 | 180 |
183 typedef GrSingleTextureEffect INHERITED; | 181 typedef GrSingleTextureEffect INHERITED; |
184 }; | 182 }; |
185 | 183 |
186 #endif | 184 #endif |
OLD | NEW |