OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkSweepGradient.h" | 9 #include "SkSweepGradient.h" |
10 | 10 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 class GrSweepGradient : public GrGradientEffect { | 207 class GrSweepGradient : public GrGradientEffect { |
208 public: | 208 public: |
209 static GrFragmentProcessor* Create(GrContext* ctx, GrProcessorDataManager* p
rocDataManager, | 209 static GrFragmentProcessor* Create(GrContext* ctx, GrProcessorDataManager* p
rocDataManager, |
210 const SkSweepGradient& shader, const SkMa
trix& m) { | 210 const SkSweepGradient& shader, const SkMa
trix& m) { |
211 return SkNEW_ARGS(GrSweepGradient, (ctx, procDataManager, shader, m)); | 211 return SkNEW_ARGS(GrSweepGradient, (ctx, procDataManager, shader, m)); |
212 } | 212 } |
213 virtual ~GrSweepGradient() { } | 213 virtual ~GrSweepGradient() { } |
214 | 214 |
215 const char* name() const override { return "Sweep Gradient"; } | 215 const char* name() const override { return "Sweep Gradient"; } |
216 | 216 |
217 GrGLFragmentProcessor* createGLInstance() const override { | |
218 return SkNEW_ARGS(GrGLSweepGradient, (*this)); | |
219 } | |
220 | |
221 private: | 217 private: |
222 GrSweepGradient(GrContext* ctx, | 218 GrSweepGradient(GrContext* ctx, |
223 GrProcessorDataManager* procDataManager, | 219 GrProcessorDataManager* procDataManager, |
224 const SkSweepGradient& shader, | 220 const SkSweepGradient& shader, |
225 const SkMatrix& matrix) | 221 const SkMatrix& matrix) |
226 : INHERITED(ctx, procDataManager, shader, matrix, SkShader::kClamp_TileMode)
{ | 222 : INHERITED(ctx, procDataManager, shader, matrix, SkShader::kClamp_TileMode)
{ |
227 this->initClassID<GrSweepGradient>(); | 223 this->initClassID<GrSweepGradient>(); |
228 } | 224 } |
229 | 225 |
| 226 GrGLFragmentProcessor* onCreateGLInstance() const override { |
| 227 return SkNEW_ARGS(GrGLSweepGradient, (*this)); |
| 228 } |
| 229 |
230 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, | 230 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, |
231 GrProcessorKeyBuilder* b) const override { | 231 GrProcessorKeyBuilder* b) const override { |
232 GrGLSweepGradient::GenKey(*this, caps, b); | 232 GrGLSweepGradient::GenKey(*this, caps, b); |
233 } | 233 } |
234 | 234 |
235 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 235 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
236 | 236 |
237 typedef GrGradientEffect INHERITED; | 237 typedef GrGradientEffect INHERITED; |
238 }; | 238 }; |
239 | 239 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 str->appendScalar(fCenter.fX); | 329 str->appendScalar(fCenter.fX); |
330 str->append(", "); | 330 str->append(", "); |
331 str->appendScalar(fCenter.fY); | 331 str->appendScalar(fCenter.fY); |
332 str->append(") "); | 332 str->append(") "); |
333 | 333 |
334 this->INHERITED::toString(str); | 334 this->INHERITED::toString(str); |
335 | 335 |
336 str->append(")"); | 336 str->append(")"); |
337 } | 337 } |
338 #endif | 338 #endif |
OLD | NEW |