| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkTwoPointConicalGradient.h" | 8 #include "SkTwoPointConicalGradient.h" |
| 9 | 9 |
| 10 static int valid_divide(float numer, float denom, float* ratio) { | 10 static int valid_divide(float numer, float denom, float* ratio) { |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 // down). | 648 // down). |
| 649 float values[6] = { | 649 float values[6] = { |
| 650 SkScalarToFloat(a * 4), | 650 SkScalarToFloat(a * 4), |
| 651 1.f / (SkScalarToFloat(a)), | 651 1.f / (SkScalarToFloat(a)), |
| 652 SkScalarToFloat(centerX1), | 652 SkScalarToFloat(centerX1), |
| 653 SkScalarToFloat(radius0), | 653 SkScalarToFloat(radius0), |
| 654 SkScalarToFloat(SkScalarMul(radius0, radius0)), | 654 SkScalarToFloat(SkScalarMul(radius0, radius0)), |
| 655 SkScalarToFloat(diffRadius) | 655 SkScalarToFloat(diffRadius) |
| 656 }; | 656 }; |
| 657 | 657 |
| 658 uman.set1fv(fParamUni, 0, 6, values); | 658 uman.set1fv(fParamUni, 6, values); |
| 659 fCachedCenter = centerX1; | 659 fCachedCenter = centerX1; |
| 660 fCachedRadius = radius0; | 660 fCachedRadius = radius0; |
| 661 fCachedDiffRadius = diffRadius; | 661 fCachedDiffRadius = diffRadius; |
| 662 } | 662 } |
| 663 } | 663 } |
| 664 | 664 |
| 665 GrGLEffect::EffectKey GrGLConical2Gradient::GenKey(const GrDrawEffect& drawEffec
t, | 665 GrGLEffect::EffectKey GrGLConical2Gradient::GenKey(const GrDrawEffect& drawEffec
t, |
| 666 const GrGLCaps&) { | 666 const GrGLCaps&) { |
| 667 enum { | 667 enum { |
| 668 kIsDegenerate = 1 << kBaseKeyBitCnt, | 668 kIsDegenerate = 1 << kBaseKeyBitCnt, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 str->appendScalar(fCenter2.fY); | 727 str->appendScalar(fCenter2.fY); |
| 728 str->append(") radius2: "); | 728 str->append(") radius2: "); |
| 729 str->appendScalar(fRadius2); | 729 str->appendScalar(fRadius2); |
| 730 str->append(" "); | 730 str->append(" "); |
| 731 | 731 |
| 732 this->INHERITED::toString(str); | 732 this->INHERITED::toString(str); |
| 733 | 733 |
| 734 str->append(")"); | 734 str->append(")"); |
| 735 } | 735 } |
| 736 #endif | 736 #endif |
| OLD | NEW |