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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 typedef GrSingleTextureEffect INHERITED; | 160 typedef GrSingleTextureEffect INHERITED; |
161 }; | 161 }; |
162 | 162 |
163 /** | 163 /** |
164 * A basic texture effect that uses GrTextureDomain. | 164 * A basic texture effect that uses GrTextureDomain. |
165 */ | 165 */ |
166 class GrTextureDomainEffect : public GrSingleTextureEffect { | 166 class GrTextureDomainEffect : public GrSingleTextureEffect { |
167 | 167 |
168 public: | 168 public: |
169 static const GrFragmentProcessor* Create(GrTexture*, | 169 static sk_sp<GrFragmentProcessor> Make(GrTexture*, |
170 const SkMatrix&, | 170 const SkMatrix&, |
171 const SkRect& domain, | 171 const SkRect& domain, |
172 GrTextureDomain::Mode, | 172 GrTextureDomain::Mode, |
173 GrTextureParams::FilterMode filterM
ode, | 173 GrTextureParams::FilterMode filterMod
e, |
174 GrCoordSet = kLocal_GrCoordSet); | 174 GrCoordSet = kLocal_GrCoordSet); |
175 | 175 |
176 virtual ~GrTextureDomainEffect(); | 176 virtual ~GrTextureDomainEffect(); |
177 | 177 |
178 const char* name() const override { return "TextureDomain"; } | 178 const char* name() const override { return "TextureDomain"; } |
179 | 179 |
180 SkString dumpInfo() const override { | 180 SkString dumpInfo() const override { |
181 SkString str; | 181 SkString str; |
182 str.appendf("Domain: [L: %.2f, T: %.2f, R: %.2f, B: %.2f] ", | 182 str.appendf("Domain: [L: %.2f, T: %.2f, R: %.2f, B: %.2f] ", |
183 fTextureDomain.domain().fLeft, fTextureDomain.domain().fTop, | 183 fTextureDomain.domain().fLeft, fTextureDomain.domain().fTop, |
184 fTextureDomain.domain().fRight, fTextureDomain.domain().fBot
tom); | 184 fTextureDomain.domain().fRight, fTextureDomain.domain().fBot
tom); |
(...skipping 21 matching lines...) Expand all Loading... |
206 bool onIsEqual(const GrFragmentProcessor&) const override; | 206 bool onIsEqual(const GrFragmentProcessor&) const override; |
207 | 207 |
208 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 208 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
209 | 209 |
210 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 210 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
211 | 211 |
212 typedef GrSingleTextureEffect INHERITED; | 212 typedef GrSingleTextureEffect INHERITED; |
213 }; | 213 }; |
214 | 214 |
215 #endif | 215 #endif |
OLD | NEW |