OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 "SkGradientShaderPriv.h" | 8 #include "SkGradientShaderPriv.h" |
9 #include "SkLinearGradient.h" | 9 #include "SkLinearGradient.h" |
10 #include "SkRadialGradient.h" | 10 #include "SkRadialGradient.h" |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 } | 647 } |
648 } | 648 } |
649 } | 649 } |
650 } | 650 } |
651 info->fColorCount = fColorCount; | 651 info->fColorCount = fColorCount; |
652 info->fTileMode = fTileMode; | 652 info->fTileMode = fTileMode; |
653 info->fGradientFlags = fGradFlags; | 653 info->fGradientFlags = fGradFlags; |
654 } | 654 } |
655 } | 655 } |
656 | 656 |
657 #ifdef SK_DEVELOPER | 657 #ifndef SK_IGNORE_TO_STRING |
658 void SkGradientShaderBase::toString(SkString* str) const { | 658 void SkGradientShaderBase::toString(SkString* str) const { |
659 | 659 |
660 str->appendf("%d colors: ", fColorCount); | 660 str->appendf("%d colors: ", fColorCount); |
661 | 661 |
662 for (int i = 0; i < fColorCount; ++i) { | 662 for (int i = 0; i < fColorCount; ++i) { |
663 str->appendHex(fOrigColors[i]); | 663 str->appendHex(fOrigColors[i]); |
664 if (i < fColorCount-1) { | 664 if (i < fColorCount-1) { |
665 str->append(", "); | 665 str->append(", "); |
666 } | 666 } |
667 } | 667 } |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 (*stops)[i] = stop; | 1138 (*stops)[i] = stop; |
1139 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; | 1139 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; |
1140 } | 1140 } |
1141 } | 1141 } |
1142 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 1142 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
1143 | 1143 |
1144 return outColors; | 1144 return outColors; |
1145 } | 1145 } |
1146 | 1146 |
1147 #endif | 1147 #endif |
OLD | NEW |