Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: src/effects/gradients/SkGradientShader.cpp

Issue 197763008: Allow toString capability to be toggled independent of developer mode (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: remove gyp changes Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/effects/SkTransparentShader.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/effects/SkTransparentShader.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698