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 "SkLinearGradient.h" | 8 #include "SkLinearGradient.h" |
9 | 9 |
10 static inline int repeat_bits(int x, const int bits) { | 10 static inline int repeat_bits(int x, const int bits) { |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 SkMatrix inv; | 554 SkMatrix inv; |
555 if (!localMatrix->invert(&inv)) { | 555 if (!localMatrix->invert(&inv)) { |
556 return nullptr; | 556 return nullptr; |
557 } | 557 } |
558 matrix.postConcat(inv); | 558 matrix.postConcat(inv); |
559 } | 559 } |
560 matrix.postConcat(fPtsToUnit); | 560 matrix.postConcat(fPtsToUnit); |
561 | 561 |
562 SkAutoTUnref<const GrFragmentProcessor> inner( | 562 SkAutoTUnref<const GrFragmentProcessor> inner( |
563 GrLinearGradient::Create(context, procDataManager, *this, matrix, fTileM
ode)); | 563 GrLinearGradient::Create(context, procDataManager, *this, matrix, fTileM
ode)); |
564 return GrFragmentProcessor::MulOuputByInputAlpha(inner); | 564 return GrFragmentProcessor::MulOutputByInputAlpha(inner); |
565 } | 565 } |
566 | 566 |
567 | 567 |
568 #endif | 568 #endif |
569 | 569 |
570 #ifndef SK_IGNORE_TO_STRING | 570 #ifndef SK_IGNORE_TO_STRING |
571 void SkLinearGradient::toString(SkString* str) const { | 571 void SkLinearGradient::toString(SkString* str) const { |
572 str->append("SkLinearGradient ("); | 572 str->append("SkLinearGradient ("); |
573 | 573 |
574 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); | 574 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); |
575 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); | 575 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); |
576 | 576 |
577 this->INHERITED::toString(str); | 577 this->INHERITED::toString(str); |
578 | 578 |
579 str->append(")"); | 579 str->append(")"); |
580 } | 580 } |
581 #endif | 581 #endif |
OLD | NEW |