Index: src/utils/debugger/SkObjectParser.cpp |
diff --git a/src/utils/debugger/SkObjectParser.cpp b/src/utils/debugger/SkObjectParser.cpp |
index d8dbe838da043f6c8015479242d48ce6e3d01857..3807fad59b5172b908b267044dce62411a06d9c1 100644 |
--- a/src/utils/debugger/SkObjectParser.cpp |
+++ b/src/utils/debugger/SkObjectParser.cpp |
@@ -9,6 +9,7 @@ |
#include "SkObjectParser.h" |
#include "SkData.h" |
#include "SkFontDescriptor.h" |
+#include "SkImage.h" |
#include "SkPath.h" |
#include "SkRRect.h" |
#include "SkShader.h" |
@@ -58,6 +59,29 @@ SkString* SkObjectParser::BitmapToString(const SkBitmap& bitmap) { |
return mBitmap; |
} |
+SkString* SkObjectParser::ImageToString(const SkImage* image) { |
+ SkString* str = new SkString("SkImage: "); |
+ if (!image) { |
+ return str; |
+ } |
+ |
+ str->append("W: "); |
+ str->appendS32(image->width()); |
+ str->append(" H: "); |
+ str->appendS32(image->height()); |
+ |
+ if (image->isOpaque()) { |
+ str->append(" opaque"); |
+ } else { |
+ str->append(" not-opaque"); |
+ } |
+ |
+ str->append(" uniqueID: "); |
+ str->appendS32(image->uniqueID()); |
+ |
+ return str; |
+} |
+ |
SkString* SkObjectParser::BoolToString(bool doAA) { |
SkString* mBool = new SkString("Bool doAA: "); |
if (doAA) { |