| OLD | NEW |
| 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 "SkImage.h" |
| 12 #include "SkPath.h" | 13 #include "SkPath.h" |
| 13 #include "SkRRect.h" | 14 #include "SkRRect.h" |
| 14 #include "SkShader.h" | 15 #include "SkShader.h" |
| 15 #include "SkStream.h" | 16 #include "SkStream.h" |
| 16 #include "SkStringUtils.h" | 17 #include "SkStringUtils.h" |
| 17 #include "SkTypeface.h" | 18 #include "SkTypeface.h" |
| 18 #include "SkUtils.h" | 19 #include "SkUtils.h" |
| 19 | 20 |
| 20 /* TODO(chudy): Replace all std::strings with char */ | 21 /* TODO(chudy): Replace all std::strings with char */ |
| 21 | 22 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 51 } else { | 52 } else { |
| 52 mBitmap->append(" not-volatile"); | 53 mBitmap->append(" not-volatile"); |
| 53 } | 54 } |
| 54 | 55 |
| 55 mBitmap->append(" genID: "); | 56 mBitmap->append(" genID: "); |
| 56 mBitmap->appendS32(bitmap.getGenerationID()); | 57 mBitmap->appendS32(bitmap.getGenerationID()); |
| 57 | 58 |
| 58 return mBitmap; | 59 return mBitmap; |
| 59 } | 60 } |
| 60 | 61 |
| 62 SkString* SkObjectParser::ImageToString(const SkImage* image) { |
| 63 SkString* str = new SkString("SkImage: "); |
| 64 if (!image) { |
| 65 return str; |
| 66 } |
| 67 |
| 68 str->append("W: "); |
| 69 str->appendS32(image->width()); |
| 70 str->append(" H: "); |
| 71 str->appendS32(image->height()); |
| 72 |
| 73 if (image->isOpaque()) { |
| 74 str->append(" opaque"); |
| 75 } else { |
| 76 str->append(" not-opaque"); |
| 77 } |
| 78 |
| 79 str->append(" uniqueID: "); |
| 80 str->appendS32(image->uniqueID()); |
| 81 |
| 82 return str; |
| 83 } |
| 84 |
| 61 SkString* SkObjectParser::BoolToString(bool doAA) { | 85 SkString* SkObjectParser::BoolToString(bool doAA) { |
| 62 SkString* mBool = new SkString("Bool doAA: "); | 86 SkString* mBool = new SkString("Bool doAA: "); |
| 63 if (doAA) { | 87 if (doAA) { |
| 64 mBool->append("True"); | 88 mBool->append("True"); |
| 65 } else { | 89 } else { |
| 66 mBool->append("False"); | 90 mBool->append("False"); |
| 67 } | 91 } |
| 68 return mBool; | 92 return mBool; |
| 69 } | 93 } |
| 70 | 94 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } | 384 } |
| 361 break; | 385 break; |
| 362 } | 386 } |
| 363 default: | 387 default: |
| 364 decodedText->append("Unknown text encoding."); | 388 decodedText->append("Unknown text encoding."); |
| 365 break; | 389 break; |
| 366 } | 390 } |
| 367 | 391 |
| 368 return decodedText; | 392 return decodedText; |
| 369 } | 393 } |
| OLD | NEW |