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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 }; | 202 }; |
203 | 203 |
204 ///////////////////////////////////////////////////////////////////// | 204 ///////////////////////////////////////////////////////////////////// |
205 | 205 |
206 class GrSweepGradient : public GrGradientEffect { | 206 class GrSweepGradient : public GrGradientEffect { |
207 public: | 207 public: |
208 static GrEffectRef* Create(GrContext* ctx, | 208 static GrEffectRef* Create(GrContext* ctx, |
209 const SkSweepGradient& shader, | 209 const SkSweepGradient& shader, |
210 const SkMatrix& matrix) { | 210 const SkMatrix& matrix) { |
211 AutoEffectUnref effect(SkNEW_ARGS(GrSweepGradient, (ctx, shader, matrix)
)); | 211 return SkNEW_ARGS(GrSweepGradient, (ctx, shader, matrix)); |
212 return CreateEffectRef(effect); | |
213 } | 212 } |
214 virtual ~GrSweepGradient() { } | 213 virtual ~GrSweepGradient() { } |
215 | 214 |
216 static const char* Name() { return "Sweep Gradient"; } | 215 static const char* Name() { return "Sweep Gradient"; } |
217 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { | 216 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { |
218 return GrTBackendEffectFactory<GrSweepGradient>::getInstance(); | 217 return GrTBackendEffectFactory<GrSweepGradient>::getInstance(); |
219 } | 218 } |
220 | 219 |
221 typedef GrGLSweepGradient GLEffect; | 220 typedef GrGLSweepGradient GLEffect; |
222 | 221 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 str->appendScalar(fCenter.fX); | 324 str->appendScalar(fCenter.fX); |
326 str->append(", "); | 325 str->append(", "); |
327 str->appendScalar(fCenter.fY); | 326 str->appendScalar(fCenter.fY); |
328 str->append(") "); | 327 str->append(") "); |
329 | 328 |
330 this->INHERITED::toString(str); | 329 this->INHERITED::toString(str); |
331 | 330 |
332 str->append(")"); | 331 str->append(")"); |
333 } | 332 } |
334 #endif | 333 #endif |
OLD | NEW |