| 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 "SkTwoPointRadialGradient.h" | 9 #include "SkTwoPointRadialGradient.h" |
| 10 | 10 |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 }; | 431 }; |
| 432 | 432 |
| 433 ///////////////////////////////////////////////////////////////////// | 433 ///////////////////////////////////////////////////////////////////// |
| 434 | 434 |
| 435 class GrRadial2Gradient : public GrGradientEffect { | 435 class GrRadial2Gradient : public GrGradientEffect { |
| 436 public: | 436 public: |
| 437 static GrEffectRef* Create(GrContext* ctx, | 437 static GrEffectRef* Create(GrContext* ctx, |
| 438 const SkTwoPointRadialGradient& shader, | 438 const SkTwoPointRadialGradient& shader, |
| 439 const SkMatrix& matrix, | 439 const SkMatrix& matrix, |
| 440 SkShader::TileMode tm) { | 440 SkShader::TileMode tm) { |
| 441 AutoEffectUnref effect(SkNEW_ARGS(GrRadial2Gradient, (ctx, shader, matri
x, tm))); | 441 return SkNEW_ARGS(GrRadial2Gradient, (ctx, shader, matrix, tm)); |
| 442 return CreateEffectRef(effect); | |
| 443 } | 442 } |
| 444 | 443 |
| 445 virtual ~GrRadial2Gradient() { } | 444 virtual ~GrRadial2Gradient() { } |
| 446 | 445 |
| 447 static const char* Name() { return "Two-Point Radial Gradient"; } | 446 static const char* Name() { return "Two-Point Radial Gradient"; } |
| 448 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { | 447 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { |
| 449 return GrTBackendEffectFactory<GrRadial2Gradient>::getInstance(); | 448 return GrTBackendEffectFactory<GrRadial2Gradient>::getInstance(); |
| 450 } | 449 } |
| 451 | 450 |
| 452 // The radial gradient parameters can collapse to a linear (instead of quadr
atic) equation. | 451 // The radial gradient parameters can collapse to a linear (instead of quadr
atic) equation. |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 #else | 710 #else |
| 712 | 711 |
| 713 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa
int, | 712 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa
int, |
| 714 const SkMatrix* localMatrix, GrColor*
grColor, | 713 const SkMatrix* localMatrix, GrColor*
grColor, |
| 715 GrEffect** grEffect) const { | 714 GrEffect** grEffect) const { |
| 716 SkDEBUGFAIL("Should not call in GPU-less build"); | 715 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 717 return false; | 716 return false; |
| 718 } | 717 } |
| 719 | 718 |
| 720 #endif | 719 #endif |
| OLD | NEW |