aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-08-24 08:27:38 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-24 08:27:38 -0700
commit80af64519b9ba9bbbf07feb8d72968460bfa1422 (patch)
treed8ad2a1c28eb3c61738721cfba280fe97484b9d4
parent06a7f9c73b251fc3bee088d9fc2a91df7a0e0d49 (diff)
Update debugger print out of drawImageRect information
-rw-r--r--src/utils/debugger/SkDrawCommand.cpp10
-rw-r--r--src/utils/debugger/SkObjectParser.cpp24
-rw-r--r--src/utils/debugger/SkObjectParser.h8
3 files changed, 41 insertions, 1 deletions
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index 8e1612fad7..75d847493b 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -402,6 +402,16 @@ SkDrawImageRectCommand::SkDrawImageRectCommand(const SkImage* image, const SkRec
if (paint) {
fPaint.set(*paint);
}
+
+ fInfo.push(SkObjectParser::ImageToString(image));
+ if (src) {
+ fInfo.push(SkObjectParser::RectToString(*src, "Src: "));
+ }
+ fInfo.push(SkObjectParser::RectToString(dst, "Dst: "));
+ if (paint) {
+ fInfo.push(SkObjectParser::PaintToString(*paint));
+ }
+ fInfo.push(SkObjectParser::IntToString(fConstraint, "Constraint: "));
}
void SkDrawImageRectCommand::execute(SkCanvas* canvas) const {
diff --git a/src/utils/debugger/SkObjectParser.cpp b/src/utils/debugger/SkObjectParser.cpp
index d8dbe838da..3807fad59b 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) {
diff --git a/src/utils/debugger/SkObjectParser.h b/src/utils/debugger/SkObjectParser.h
index da842653ff..c4d0da0bf8 100644
--- a/src/utils/debugger/SkObjectParser.h
+++ b/src/utils/debugger/SkObjectParser.h
@@ -20,12 +20,18 @@ class SkObjectParser {
public:
/**
- Returns a string about a bitmaps bounds and colortype.
+ Returns a string about a bitmap's bounds and colortype.
@param bitmap SkBitmap
*/
static SkString* BitmapToString(const SkBitmap& bitmap);
/**
+ Returns a string about a image
+ @param image SkImage
+ */
+ static SkString* ImageToString(const SkImage* image);
+
+ /**
Returns a string representation of a boolean.
@param doAA boolean
*/