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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 typedef GrSingleTextureEffect INHERITED; | 151 typedef GrSingleTextureEffect INHERITED; |
152 }; | 152 }; |
153 | 153 |
154 /** | 154 /** |
155 * A basic texture effect that uses GrTextureDomain. | 155 * A basic texture effect that uses GrTextureDomain. |
156 */ | 156 */ |
157 class GrTextureDomainEffect : public GrSingleTextureEffect { | 157 class GrTextureDomainEffect : public GrSingleTextureEffect { |
158 | 158 |
159 public: | 159 public: |
160 static GrFragmentProcessor* Create(GrTexture*, | 160 static GrFragmentProcessor* Create(GrProcessorDataManager*, |
| 161 GrTexture*, |
161 const SkMatrix&, | 162 const SkMatrix&, |
162 const SkRect& domain, | 163 const SkRect& domain, |
163 GrTextureDomain::Mode, | 164 GrTextureDomain::Mode, |
164 GrTextureParams::FilterMode filterMode, | 165 GrTextureParams::FilterMode filterMode, |
165 GrCoordSet = kLocal_GrCoordSet); | 166 GrCoordSet = kLocal_GrCoordSet); |
166 | 167 |
167 virtual ~GrTextureDomainEffect(); | 168 virtual ~GrTextureDomainEffect(); |
168 | 169 |
169 const char* name() const override { return "TextureDomain"; } | 170 const char* name() const override { return "TextureDomain"; } |
170 | 171 |
171 void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const over
ride; | 172 void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const over
ride; |
172 | 173 |
173 GrGLFragmentProcessor* createGLInstance() const override; | 174 GrGLFragmentProcessor* createGLInstance() const override; |
174 | 175 |
175 const GrTextureDomain& textureDomain() const { return fTextureDomain; } | 176 const GrTextureDomain& textureDomain() const { return fTextureDomain; } |
176 | 177 |
177 protected: | 178 protected: |
178 GrTextureDomain fTextureDomain; | 179 GrTextureDomain fTextureDomain; |
179 | 180 |
180 private: | 181 private: |
181 GrTextureDomainEffect(GrTexture*, | 182 GrTextureDomainEffect(GrProcessorDataManager*, |
| 183 GrTexture*, |
182 const SkMatrix&, | 184 const SkMatrix&, |
183 const SkRect& domain, | 185 const SkRect& domain, |
184 GrTextureDomain::Mode, | 186 GrTextureDomain::Mode, |
185 GrTextureParams::FilterMode, | 187 GrTextureParams::FilterMode, |
186 GrCoordSet); | 188 GrCoordSet); |
187 | 189 |
188 bool onIsEqual(const GrFragmentProcessor&) const override; | 190 bool onIsEqual(const GrFragmentProcessor&) const override; |
189 | 191 |
190 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 192 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
191 | 193 |
192 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 194 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
193 | 195 |
194 typedef GrSingleTextureEffect INHERITED; | 196 typedef GrSingleTextureEffect INHERITED; |
195 }; | 197 }; |
196 | 198 |
197 #endif | 199 #endif |
OLD | NEW |