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

Unified Diff: tools/debugger/SkDrawCommand.cpp

Issue 2107913003: add short-desc (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove global Created 4 years, 6 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 029be6cf8c1f18233da7da26ec88a0b978ca7734..22655a028dca7f9796dab4e1b9037ff5ea6ab099 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -5,7 +5,6 @@
* found in the LICENSE file.
*/
-
#include "SkDrawCommand.h"
#include "SkBlurMaskFilter.h"
@@ -92,6 +91,8 @@
#define SKDEBUGCANVAS_ATTRIBUTE_TEXTURECOORDS "textureCoords"
#define SKDEBUGCANVAS_ATTRIBUTE_FILTERQUALITY "filterQuality"
+#define SKDEBUGCANVAS_ATTRIBUTE_SHORTDESC "short-desc"
+
#define SKDEBUGCANVAS_VERB_MOVE "move"
#define SKDEBUGCANVAS_VERB_LINE "line"
#define SKDEBUGCANVAS_VERB_QUAD "quad"
@@ -158,6 +159,11 @@
typedef SkDrawCommand* (*FROM_JSON)(Json::Value&, UrlDataManager&);
+static SkString* str_append(SkString* str, const SkRect& r) {
+ str->appendf(" [%g %g %g %g]", r.left(), r.top(), r.right(), r.bottom());
+ return str;
+}
+
// TODO(chudy): Refactor into non subclass model.
SkDrawCommand::SkDrawCommand(OpType type)
@@ -1643,6 +1649,10 @@ Json::Value SkClipRectCommand::toJSON(UrlDataManager& urlDataManager) const {
result[SKDEBUGCANVAS_ATTRIBUTE_COORDS] = MakeJsonRect(fRect);
result[SKDEBUGCANVAS_ATTRIBUTE_REGIONOP] = make_json_regionop(fOp);
result[SKDEBUGCANVAS_ATTRIBUTE_ANTIALIAS] = Json::Value(fDoAA);
+
+ SkString desc;
+ result[SKDEBUGCANVAS_ATTRIBUTE_SHORTDESC] = Json::Value(str_append(&desc, fRect)->c_str());
+
return result;
}
@@ -1746,6 +1756,11 @@ Json::Value SkDrawAnnotationCommand::toJSON(UrlDataManager& urlDataManager) cons
if (fValue.get()) {
// TODO: dump out the "value"
}
+
+ SkString desc;
+ str_append(&desc, fRect)->appendf(" %s", fKey.c_str());
+ result[SKDEBUGCANVAS_ATTRIBUTE_SHORTDESC] = Json::Value(desc.c_str());
+
return result;
}
@@ -1950,6 +1965,10 @@ Json::Value SkDrawBitmapRectCommand::toJSON(UrlDataManager& urlDataManager) cons
result[SKDEBUGCANVAS_ATTRIBUTE_STRICT] = Json::Value(true);
}
}
+
+ SkString desc;
+ result[SKDEBUGCANVAS_ATTRIBUTE_SHORTDESC] = Json::Value(str_append(&desc, fDst)->c_str());
+
return result;
}
@@ -2117,6 +2136,10 @@ Json::Value SkDrawImageRectCommand::toJSON(UrlDataManager& urlDataManager) const
result[SKDEBUGCANVAS_ATTRIBUTE_STRICT] = Json::Value(true);
}
}
+
+ SkString desc;
+ result[SKDEBUGCANVAS_ATTRIBUTE_SHORTDESC] = Json::Value(str_append(&desc, fDst)->c_str());
+
return result;
}
@@ -2791,6 +2814,10 @@ Json::Value SkDrawRectCommand::toJSON(UrlDataManager& urlDataManager) const {
Json::Value result = INHERITED::toJSON(urlDataManager);
result[SKDEBUGCANVAS_ATTRIBUTE_COORDS] = MakeJsonRect(fRect);
result[SKDEBUGCANVAS_ATTRIBUTE_PAINT] = MakeJsonPaint(fPaint, urlDataManager);
+
+ SkString desc;
+ result[SKDEBUGCANVAS_ATTRIBUTE_SHORTDESC] = Json::Value(str_append(&desc, fRect)->c_str());
+
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