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

Side by Side Diff: src/core/SkShader.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/core/SkPaint.cpp ('k') | src/core/SkXfermode.cpp » ('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 "SkBitmapProcShader.h" 8 #include "SkBitmapProcShader.h"
9 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkMallocPixelRef.h" 10 #include "SkMallocPixelRef.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 GrEffectRef* SkShader::asNewEffect(GrContext*, const SkPaint&) const { 173 GrEffectRef* SkShader::asNewEffect(GrContext*, const SkPaint&) const {
174 return NULL; 174 return NULL;
175 } 175 }
176 176
177 SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, 177 SkShader* SkShader::CreateBitmapShader(const SkBitmap& src,
178 TileMode tmx, TileMode tmy) { 178 TileMode tmx, TileMode tmy) {
179 return ::CreateBitmapShader(src, tmx, tmy, NULL); 179 return ::CreateBitmapShader(src, tmx, tmy, NULL);
180 } 180 }
181 181
182 #ifdef SK_DEVELOPER 182 #ifndef SK_IGNORE_TO_STRING
183 void SkShader::toString(SkString* str) const { 183 void SkShader::toString(SkString* str) const {
184 if (this->hasLocalMatrix()) { 184 if (this->hasLocalMatrix()) {
185 str->append(" "); 185 str->append(" ");
186 this->getLocalMatrix().toString(str); 186 this->getLocalMatrix().toString(str);
187 } 187 }
188 } 188 }
189 #endif 189 #endif
190 190
191 ////////////////////////////////////////////////////////////////////////////// 191 //////////////////////////////////////////////////////////////////////////////
192 192
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 if (info) { 302 if (info) {
303 if (info->fColors && info->fColorCount >= 1) { 303 if (info->fColors && info->fColorCount >= 1) {
304 info->fColors[0] = fColor; 304 info->fColors[0] = fColor;
305 } 305 }
306 info->fColorCount = 1; 306 info->fColorCount = 1;
307 info->fTileMode = SkShader::kRepeat_TileMode; 307 info->fTileMode = SkShader::kRepeat_TileMode;
308 } 308 }
309 return kColor_GradientType; 309 return kColor_GradientType;
310 } 310 }
311 311
312 #ifdef SK_DEVELOPER 312 #ifndef SK_IGNORE_TO_STRING
313 void SkColorShader::toString(SkString* str) const { 313 void SkColorShader::toString(SkString* str) const {
314 str->append("SkColorShader: ("); 314 str->append("SkColorShader: (");
315 315
316 if (fInheritColor) { 316 if (fInheritColor) {
317 str->append("Color: inherited from paint"); 317 str->append("Color: inherited from paint");
318 } else { 318 } else {
319 str->append("Color: "); 319 str->append("Color: ");
320 str->appendHex(fColor); 320 str->appendHex(fColor);
321 } 321 }
322 322
(...skipping 18 matching lines...) Expand all
341 } 341 }
342 342
343 void SkEmptyShader::shadeSpan16(int x, int y, uint16_t span[], int count) { 343 void SkEmptyShader::shadeSpan16(int x, int y, uint16_t span[], int count) {
344 SkDEBUGFAIL("should never get called, since setContext() returned false"); 344 SkDEBUGFAIL("should never get called, since setContext() returned false");
345 } 345 }
346 346
347 void SkEmptyShader::shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) { 347 void SkEmptyShader::shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) {
348 SkDEBUGFAIL("should never get called, since setContext() returned false"); 348 SkDEBUGFAIL("should never get called, since setContext() returned false");
349 } 349 }
350 350
351 #ifdef SK_DEVELOPER 351 #ifndef SK_IGNORE_TO_STRING
352 void SkEmptyShader::toString(SkString* str) const { 352 void SkEmptyShader::toString(SkString* str) const {
353 str->append("SkEmptyShader: ("); 353 str->append("SkEmptyShader: (");
354 354
355 this->INHERITED::toString(str); 355 this->INHERITED::toString(str);
356 356
357 str->append(")"); 357 str->append(")");
358 } 358 }
359 #endif 359 #endif
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698