| 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 | 466 |
| 467 // The radial gradient parameters can collapse to a linear (instead of quadr
atic) equation. | 467 // The radial gradient parameters can collapse to a linear (instead of quadr
atic) equation. |
| 468 bool isDegenerate() const { return SK_Scalar1 == fCenterX1; } | 468 bool isDegenerate() const { return SK_Scalar1 == fCenterX1; } |
| 469 SkScalar center() const { return fCenterX1; } | 469 SkScalar center() const { return fCenterX1; } |
| 470 SkScalar radius() const { return fRadius0; } | 470 SkScalar radius() const { return fRadius0; } |
| 471 bool isPosRoot() const { return SkToBool(fPosRoot); } | 471 bool isPosRoot() const { return SkToBool(fPosRoot); } |
| 472 | 472 |
| 473 typedef GrGLRadial2Gradient GLProcessor; | 473 typedef GrGLRadial2Gradient GLProcessor; |
| 474 | 474 |
| 475 private: | 475 private: |
| 476 virtual bool onIsEqual(const GrProcessor& sBase) const SK_OVERRIDE { | 476 virtual bool onIsEqual(const GrFragmentProcessor& sBase) const SK_OVERRIDE { |
| 477 const GrRadial2Gradient& s = sBase.cast<GrRadial2Gradient>(); | 477 const GrRadial2Gradient& s = sBase.cast<GrRadial2Gradient>(); |
| 478 return (INHERITED::onIsEqual(sBase) && | 478 return (INHERITED::onIsEqual(sBase) && |
| 479 this->fCenterX1 == s.fCenterX1 && | 479 this->fCenterX1 == s.fCenterX1 && |
| 480 this->fRadius0 == s.fRadius0 && | 480 this->fRadius0 == s.fRadius0 && |
| 481 this->fPosRoot == s.fPosRoot); | 481 this->fPosRoot == s.fPosRoot); |
| 482 } | 482 } |
| 483 | 483 |
| 484 GrRadial2Gradient(GrContext* ctx, | 484 GrRadial2Gradient(GrContext* ctx, |
| 485 const SkTwoPointRadialGradient& shader, | 485 const SkTwoPointRadialGradient& shader, |
| 486 const SkMatrix& matrix, | 486 const SkMatrix& matrix, |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 | 720 |
| 721 #else | 721 #else |
| 722 | 722 |
| 723 bool SkTwoPointRadialGradient::asFragmentProcessor(GrContext*, const SkPaint&, c
onst SkMatrix*, | 723 bool SkTwoPointRadialGradient::asFragmentProcessor(GrContext*, const SkPaint&, c
onst SkMatrix*, |
| 724 GrColor*, GrFragmentProcessor
**) const { | 724 GrColor*, GrFragmentProcessor
**) const { |
| 725 SkDEBUGFAIL("Should not call in GPU-less build"); | 725 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 726 return false; | 726 return false; |
| 727 } | 727 } |
| 728 | 728 |
| 729 #endif | 729 #endif |
| OLD | NEW |