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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 uint32_t* key = b->add32n(2); | 680 uint32_t* key = b->add32n(2); |
681 key[0] = GenBaseGradientKey(drawEffect); | 681 key[0] = GenBaseGradientKey(drawEffect); |
682 key[1] = drawEffect.castEffect<GrRadial2Gradient>().isDegenerate(); | 682 key[1] = drawEffect.castEffect<GrRadial2Gradient>().isDegenerate(); |
683 } | 683 } |
684 | 684 |
685 ///////////////////////////////////////////////////////////////////// | 685 ///////////////////////////////////////////////////////////////////// |
686 | 686 |
687 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa
int, | 687 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa
int, |
688 const SkMatrix* localMatrix, GrColor*
paintColor, | 688 const SkMatrix* localMatrix, GrColor*
paintColor, |
689 GrEffect** effect) const { | 689 GrEffect** effect) const { |
690 SkASSERT(NULL != context); | 690 SkASSERT(context); |
691 | 691 |
692 // invert the localM, translate to center1 (fPtsToUni), rotate so center2 is
on x axis. | 692 // invert the localM, translate to center1 (fPtsToUni), rotate so center2 is
on x axis. |
693 SkMatrix matrix; | 693 SkMatrix matrix; |
694 if (!this->getLocalMatrix().invert(&matrix)) { | 694 if (!this->getLocalMatrix().invert(&matrix)) { |
695 return false; | 695 return false; |
696 } | 696 } |
697 if (localMatrix) { | 697 if (localMatrix) { |
698 SkMatrix inv; | 698 SkMatrix inv; |
699 if (!localMatrix->invert(&inv)) { | 699 if (!localMatrix->invert(&inv)) { |
700 return false; | 700 return false; |
(...skipping 20 matching lines...) Expand all Loading... |
721 #else | 721 #else |
722 | 722 |
723 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa
int, | 723 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa
int, |
724 const SkMatrix* localMatrix, GrColor*
paintColor, | 724 const SkMatrix* localMatrix, GrColor*
paintColor, |
725 GrEffect** effect) const { | 725 GrEffect** effect) const { |
726 SkDEBUGFAIL("Should not call in GPU-less build"); | 726 SkDEBUGFAIL("Should not call in GPU-less build"); |
727 return false; | 727 return false; |
728 } | 728 } |
729 | 729 |
730 #endif | 730 #endif |
OLD | NEW |