aboutsummaryrefslogtreecommitdiffhomepage
path: root/debugger
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-23 12:13:35 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-23 12:13:35 +0000
commit195952f0aee6e2dedf29d095e8be2edc2496dc18 (patch)
tree1d6f27fe3efd18187453f16a55caad5fd3e1fc17 /debugger
parentc892a153aabb04da31756acad076fddc6b1ea00e (diff)
Make Debugger print out more information (mainly w.r.t. SkBitmap)
Diffstat (limited to 'debugger')
-rw-r--r--debugger/SkObjectParser.cpp53
1 files changed, 47 insertions, 6 deletions
diff --git a/debugger/SkObjectParser.cpp b/debugger/SkObjectParser.cpp
index aa6da67c10..4bee8715f1 100644
--- a/debugger/SkObjectParser.cpp
+++ b/debugger/SkObjectParser.cpp
@@ -11,7 +11,41 @@
/* TODO(chudy): Replace all std::strings with char */
SkString* SkObjectParser::BitmapToString(const SkBitmap& bitmap) {
- SkString* mBitmap = new SkString("SkBitmap: Data unavailable");
+ SkString* mBitmap = new SkString("SkBitmap: ");
+ mBitmap->append("W: ");
+ mBitmap->appendS32(bitmap.width());
+ mBitmap->append(" H: ");
+ mBitmap->appendS32(bitmap.height());
+
+ const char* gConfigStrings[] = {
+ "None", "A1", "A8", "Index8", "RGB565", "ARGB4444", "ARGB8888", "RLE8"
+ };
+ SkASSERT(SkBitmap::kConfigCount == 8);
+
+ mBitmap->append(" Config: ");
+ mBitmap->append(gConfigStrings[bitmap.getConfig()]);
+
+ if (bitmap.isOpaque()) {
+ mBitmap->append(" opaque");
+ } else {
+ mBitmap->append(" not-opaque");
+ }
+
+ if (bitmap.isImmutable()) {
+ mBitmap->append(" immutable");
+ } else {
+ mBitmap->append(" not-immutable");
+ }
+
+ if (bitmap.isVolatile()) {
+ mBitmap->append(" volatile");
+ } else {
+ mBitmap->append(" not-volatile");
+ }
+
+ mBitmap->append(" genID: ");
+ mBitmap->appendS32(bitmap.getGenerationID());
+
return mBitmap;
}
@@ -40,13 +74,13 @@ SkString* SkObjectParser::IntToString(int x, const char* text) {
SkString* SkObjectParser::IRectToString(const SkIRect& rect) {
SkString* mRect = new SkString("SkIRect: ");
mRect->append("L: ");
- mRect->appendScalar(SkIntToScalar(rect.left()));
+ mRect->appendS32(rect.left());
mRect->append(", T: ");
- mRect->appendScalar(SkIntToScalar(rect.top()));
+ mRect->appendS32(rect.top());
mRect->append(", R: ");
- mRect->appendScalar(SkIntToScalar(rect.right()));
+ mRect->appendS32(rect.right());
mRect->append(", B: ");
- mRect->appendScalar(SkIntToScalar(rect.bottom()));
+ mRect->appendS32(rect.bottom());
return mRect;
}
@@ -63,8 +97,9 @@ SkString* SkObjectParser::MatrixToString(const SkMatrix& matrix) {
SkString* SkObjectParser::PaintToString(const SkPaint& paint) {
SkColor color = paint.getColor();
- SkString* mPaint = new SkString("SkPaint: 0x");
+ SkString* mPaint = new SkString("SkPaint: Color: 0x");
mPaint->appendHex(color);
+
return mPaint;
}
@@ -79,6 +114,12 @@ SkString* SkObjectParser::PathToString(const SkPath& path) {
mPath->append(gConvexityStrings[path.getConvexity()]);
mPath->append(", ");
+ if (path.isRect(NULL)) {
+ mPath->append("isRect, ");
+ } else {
+ mPath->append("isNotRect, ");
+ }
+
mPath->appendS32(path.countVerbs());
mPath->append("V, ");
mPath->appendS32(path.countPoints());