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

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

Issue 305133006: use colortype instead of config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 6 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/utils/debugger/SkObjectParser.h ('k') | 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"
11 #include "SkFontDescriptor.h" 11 #include "SkFontDescriptor.h"
12 #include "SkRRect.h" 12 #include "SkRRect.h"
13 #include "SkShader.h" 13 #include "SkShader.h"
14 #include "SkStream.h" 14 #include "SkStream.h"
15 #include "SkStringUtils.h" 15 #include "SkStringUtils.h"
16 #include "SkTypeface.h" 16 #include "SkTypeface.h"
17 #include "SkUtils.h" 17 #include "SkUtils.h"
18 18
19 /* TODO(chudy): Replace all std::strings with char */ 19 /* TODO(chudy): Replace all std::strings with char */
20 20
21 SkString* SkObjectParser::BitmapToString(const SkBitmap& bitmap) { 21 SkString* SkObjectParser::BitmapToString(const SkBitmap& bitmap) {
22 SkString* mBitmap = new SkString("SkBitmap: "); 22 SkString* mBitmap = new SkString("SkBitmap: ");
23 mBitmap->append("W: "); 23 mBitmap->append("W: ");
24 mBitmap->appendS32(bitmap.width()); 24 mBitmap->appendS32(bitmap.width());
25 mBitmap->append(" H: "); 25 mBitmap->append(" H: ");
26 mBitmap->appendS32(bitmap.height()); 26 mBitmap->appendS32(bitmap.height());
27 27
28 const char* gConfigStrings[] = { 28 const char* gColorTypeStrings[] = {
29 "None", "A8", "Index8", "RGB565", "ARGB4444", "ARGB8888" 29 "None", "A8", "565", "4444", "RGBA", "BGRA", "Index8"
30 }; 30 };
31 SkASSERT(SkBitmap::kConfigCount == SK_ARRAY_COUNT(gConfigStrings)); 31 SkASSERT(kLastEnum_SkColorType + 1 == SK_ARRAY_COUNT(gColorTypeStrings));
32 32
33 mBitmap->append(" Config: "); 33 mBitmap->append(" ColorType: ");
34 mBitmap->append(gConfigStrings[bitmap.config()]); 34 mBitmap->append(gColorTypeStrings[bitmap.colorType()]);
35 35
36 if (bitmap.isOpaque()) { 36 if (bitmap.isOpaque()) {
37 mBitmap->append(" opaque"); 37 mBitmap->append(" opaque");
38 } else { 38 } else {
39 mBitmap->append(" not-opaque"); 39 mBitmap->append(" not-opaque");
40 } 40 }
41 41
42 if (bitmap.isImmutable()) { 42 if (bitmap.isImmutable()) {
43 mBitmap->append(" immutable"); 43 mBitmap->append(" immutable");
44 } else { 44 } else {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 break; 366 break;
367 } 367 }
368 default: 368 default:
369 decodedText->append("Unknown text encoding."); 369 decodedText->append("Unknown text encoding.");
370 break; 370 break;
371 } 371 }
372 372
373 return decodedText; 373 return decodedText;
374 } 374 }
OLDNEW
« no previous file with comments | « src/utils/debugger/SkObjectParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698