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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 // down). | 631 // down). |
632 float values[6] = { | 632 float values[6] = { |
633 SkScalarToFloat(a), | 633 SkScalarToFloat(a), |
634 1 / (2.f * SkScalarToFloat(a)), | 634 1 / (2.f * SkScalarToFloat(a)), |
635 SkScalarToFloat(centerX1), | 635 SkScalarToFloat(centerX1), |
636 SkScalarToFloat(radius0), | 636 SkScalarToFloat(radius0), |
637 SkScalarToFloat(SkScalarMul(radius0, radius0)), | 637 SkScalarToFloat(SkScalarMul(radius0, radius0)), |
638 data.isPosRoot() ? 1.f : -1.f | 638 data.isPosRoot() ? 1.f : -1.f |
639 }; | 639 }; |
640 | 640 |
641 uman.set1fv(fParamUni, 0, 6, values); | 641 uman.set1fv(fParamUni, 6, values); |
642 fCachedCenter = centerX1; | 642 fCachedCenter = centerX1; |
643 fCachedRadius = radius0; | 643 fCachedRadius = radius0; |
644 fCachedPosRoot = data.isPosRoot(); | 644 fCachedPosRoot = data.isPosRoot(); |
645 } | 645 } |
646 } | 646 } |
647 | 647 |
648 GrGLEffect::EffectKey GrGLRadial2Gradient::GenKey(const GrDrawEffect& drawEffect
, | 648 GrGLEffect::EffectKey GrGLRadial2Gradient::GenKey(const GrDrawEffect& drawEffect
, |
649 const GrGLCaps&) { | 649 const GrGLCaps&) { |
650 enum { | 650 enum { |
651 kIsDegenerate = 1 << kBaseKeyBitCnt, | 651 kIsDegenerate = 1 << kBaseKeyBitCnt, |
(...skipping 30 matching lines...) Expand all Loading... |
682 } | 682 } |
683 | 683 |
684 #else | 684 #else |
685 | 685 |
686 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c
onst { | 686 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c
onst { |
687 SkDEBUGFAIL("Should not call in GPU-less build"); | 687 SkDEBUGFAIL("Should not call in GPU-less build"); |
688 return NULL; | 688 return NULL; |
689 } | 689 } |
690 | 690 |
691 #endif | 691 #endif |
OLD | NEW |