Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: tools/debugger/SkDrawCommand.cpp

Issue 2290683002: Add width, height, unique ID, alpha to debugger DrawImageCommand (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/debugger/SkDrawCommand.cpp
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index a6d74c7a6e4af0fc86457754107f2edcd9f4e410..d77a554fa403d4a188e9b0cf9ebd19d19988d483 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698