aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/debugger
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-08-29 09:15:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-29 09:15:33 -0700
commit0ac1bece4852b3ddcc987a5a04ef7cdc63799b57 (patch)
treed41b37fca720492b3a7d2bdf135f61c86bac6698 /tools/debugger
parent84cddf6fa7a2ee4a8163f99c9238d5fba6b49566 (diff)
Add width, height, unique ID, alpha to debugger DrawImageCommand
Diffstat (limited to 'tools/debugger')
-rw-r--r--tools/debugger/SkDrawCommand.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index a6d74c7a6e..d77a554fa4 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -97,6 +97,10 @@
#define SKDEBUGCANVAS_ATTRIBUTE_SWEEPANGLE "sweepAngle"
#define SKDEBUGCANVAS_ATTRIBUTE_USECENTER "useCenter"
#define SKDEBUGCANVAS_ATTRIBUTE_SHORTDESC "shortDesc"
+#define SKDEBUGCANVAS_ATTRIBUTE_UNIQUE_ID "uniqueID"
+#define SKDEBUGCANVAS_ATTRIBUTE_WIDTH "width"
+#define SKDEBUGCANVAS_ATTRIBUTE_HEIGHT "height"
+#define SKDEBUGCANVAS_ATTRIBUTE_ALPHA "alpha"
#define SKDEBUGCANVAS_VERB_MOVE "move"
#define SKDEBUGCANVAS_VERB_LINE "line"
@@ -156,6 +160,7 @@
#define SKDEBUGCANVAS_ALPHATYPE_OPAQUE "opaque"
#define SKDEBUGCANVAS_ALPHATYPE_PREMUL "premul"
#define SKDEBUGCANVAS_ALPHATYPE_UNPREMUL "unpremul"
+#define SKDEBUGCANVAS_ALPHATYPE_UNKNOWN "unknown"
#define SKDEBUGCANVAS_FILTERQUALITY_NONE "none"
#define SKDEBUGCANVAS_FILTERQUALITY_LOW "low"
@@ -2131,6 +2136,24 @@ Json::Value SkDrawImageCommand::toJSON(UrlDataManager& urlDataManager) const {
if (fPaint.isValid()) {
result[SKDEBUGCANVAS_ATTRIBUTE_PAINT] = MakeJsonPaint(*fPaint.get(), urlDataManager);
}
+
+ result[SKDEBUGCANVAS_ATTRIBUTE_UNIQUE_ID] = fImage->uniqueID();
+ result[SKDEBUGCANVAS_ATTRIBUTE_WIDTH] = fImage->width();
+ result[SKDEBUGCANVAS_ATTRIBUTE_HEIGHT] = fImage->height();
+ switch (fImage->alphaType()) {
+ case kOpaque_SkAlphaType:
+ result[SKDEBUGCANVAS_ATTRIBUTE_ALPHA] = SKDEBUGCANVAS_ALPHATYPE_OPAQUE;
+ break;
+ case kPremul_SkAlphaType:
+ result[SKDEBUGCANVAS_ATTRIBUTE_ALPHA] = SKDEBUGCANVAS_ALPHATYPE_PREMUL;
+ break;
+ case kUnpremul_SkAlphaType:
+ result[SKDEBUGCANVAS_ATTRIBUTE_ALPHA] = SKDEBUGCANVAS_ALPHATYPE_UNPREMUL;
+ break;
+ default:
+ result[SKDEBUGCANVAS_ATTRIBUTE_ALPHA] = SKDEBUGCANVAS_ALPHATYPE_UNKNOWN;
+ break;
+ }
}
return result;
}