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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 } | 633 } |
634 | 634 |
635 this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, sampl
ers[0]); | 635 this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, sampl
ers[0]); |
636 } | 636 } |
637 } | 637 } |
638 | 638 |
639 void GrGLRadial2Gradient::setData(const GrGLUniformManager& uman, | 639 void GrGLRadial2Gradient::setData(const GrGLUniformManager& uman, |
640 const GrDrawEffect& drawEffect) { | 640 const GrDrawEffect& drawEffect) { |
641 INHERITED::setData(uman, drawEffect); | 641 INHERITED::setData(uman, drawEffect); |
642 const GrRadial2Gradient& data = drawEffect.castEffect<GrRadial2Gradient>(); | 642 const GrRadial2Gradient& data = drawEffect.castEffect<GrRadial2Gradient>(); |
643 GrAssert(data.isDegenerate() == fIsDegenerate); | 643 SkASSERT(data.isDegenerate() == fIsDegenerate); |
644 SkScalar centerX1 = data.center(); | 644 SkScalar centerX1 = data.center(); |
645 SkScalar radius0 = data.radius(); | 645 SkScalar radius0 = data.radius(); |
646 if (fCachedCenter != centerX1 || | 646 if (fCachedCenter != centerX1 || |
647 fCachedRadius != radius0 || | 647 fCachedRadius != radius0 || |
648 fCachedPosRoot != data.isPosRoot()) { | 648 fCachedPosRoot != data.isPosRoot()) { |
649 | 649 |
650 SkScalar a = SkScalarMul(centerX1, centerX1) - SK_Scalar1; | 650 SkScalar a = SkScalarMul(centerX1, centerX1) - SK_Scalar1; |
651 | 651 |
652 // When we're in the degenerate (linear) case, the second | 652 // When we're in the degenerate (linear) case, the second |
653 // value will be INF but the program doesn't read it. (We | 653 // value will be INF but the program doesn't read it. (We |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 } | 708 } |
709 | 709 |
710 #else | 710 #else |
711 | 711 |
712 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c
onst { | 712 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c
onst { |
713 SkDEBUGFAIL("Should not call in GPU-less build"); | 713 SkDEBUGFAIL("Should not call in GPU-less build"); |
714 return NULL; | 714 return NULL; |
715 } | 715 } |
716 | 716 |
717 #endif | 717 #endif |
OLD | NEW |