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

Side by Side Diff: src/utils/debugger/SkObjectParser.cpp

Issue 18034028: SkObjectParser::SaveFlagsToString() should handle SaveFlags as a bitmask. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 | « no previous file | no next file » | 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 /* 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 "SkObjectParser.h" 9 #include "SkObjectParser.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 return mOp; 291 return mOp;
292 } 292 }
293 293
294 SkString* SkObjectParser::RegionToString(const SkRegion& region) { 294 SkString* SkObjectParser::RegionToString(const SkRegion& region) {
295 SkString* mRegion = new SkString("SkRegion: Data unavailable."); 295 SkString* mRegion = new SkString("SkRegion: Data unavailable.");
296 return mRegion; 296 return mRegion;
297 } 297 }
298 298
299 SkString* SkObjectParser::SaveFlagsToString(SkCanvas::SaveFlags flags) { 299 SkString* SkObjectParser::SaveFlagsToString(SkCanvas::SaveFlags flags) {
300 SkString* mFlags = new SkString("SkCanvas::SaveFlags: "); 300 SkString* mFlags = new SkString("SkCanvas::SaveFlags: ");
301 if(flags == SkCanvas::kMatrixClip_SaveFlag) { 301 if (flags & SkCanvas::kMatrix_SaveFlag) {
302 mFlags->append("kMatrixClip_SaveFlag"); 302 mFlags->append("kMatrix_SaveFlag ");
303 } else if (flags == SkCanvas::kClip_SaveFlag) { 303 }
304 mFlags->append("kClip_SaveFlag"); 304 if (flags & SkCanvas::kClip_SaveFlag) {
305 } else if (flags == SkCanvas::kHasAlphaLayer_SaveFlag) { 305 mFlags->append("kClip_SaveFlag ");
306 mFlags->append("kHasAlphaLayer_SaveFlag"); 306 }
307 } else if (flags == SkCanvas::kFullColorLayer_SaveFlag) { 307 if (flags & SkCanvas::kHasAlphaLayer_SaveFlag) {
308 mFlags->append("kFullColorLayer_SaveFlag"); 308 mFlags->append("kHasAlphaLayer_SaveFlag ");
309 } else if (flags == SkCanvas::kClipToLayer_SaveFlag) { 309 }
310 mFlags->append("kClipToLayer_SaveFlag"); 310 if (flags & SkCanvas::kFullColorLayer_SaveFlag) {
311 } else if (flags == SkCanvas::kMatrixClip_SaveFlag) { 311 mFlags->append("kFullColorLayer_SaveFlag ");
312 mFlags->append("kMatrixClip_SaveFlag"); 312 }
313 } else if (flags == SkCanvas::kARGB_NoClipLayer_SaveFlag) { 313 if (flags & SkCanvas::kClipToLayer_SaveFlag) {
314 mFlags->append("kARGB_NoClipLayer_SaveFlag"); 314 mFlags->append("kClipToLayer_SaveFlag ");
315 } else if (flags == SkCanvas::kARGB_ClipLayer_SaveFlag) {
316 mFlags->append("kARGB_ClipLayer_SaveFlag");
317 } else {
318 mFlags->append("Data Unavailable");
319 } 315 }
320 return mFlags; 316 return mFlags;
321 } 317 }
322 318
323 SkString* SkObjectParser::ScalarToString(SkScalar x, const char* text) { 319 SkString* SkObjectParser::ScalarToString(SkScalar x, const char* text) {
324 SkString* mScalar = new SkString(text); 320 SkString* mScalar = new SkString(text);
325 mScalar->append(" "); 321 mScalar->append(" ");
326 mScalar->appendScalar(x); 322 mScalar->appendScalar(x);
327 return mScalar; 323 return mScalar;
328 } 324 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 } 362 }
367 break; 363 break;
368 } 364 }
369 default: 365 default:
370 decodedText->append("Unknown text encoding."); 366 decodedText->append("Unknown text encoding.");
371 break; 367 break;
372 } 368 }
373 369
374 return decodedText; 370 return decodedText;
375 } 371 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698