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

Unified Diff: tools/debugger/SkDrawCommand.cpp

Issue 2110083002: Add Annotations to old debugger (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update 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 1ef5e0b86c03047a230128c16afe172189289de0..029be6cf8c1f18233da7da26ec88a0b978ca7734 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -177,7 +177,7 @@ const char* SkDrawCommand::GetCommandString(OpType type) {
case kClipRect_OpType: return "ClipRect";
case kClipRRect_OpType: return "ClipRRect";
case kConcat_OpType: return "Concat";
- case kDrawAnnotation_OpType: return "drawAnnotation";
+ case kDrawAnnotation_OpType: return "DrawAnnotation";
case kDrawBitmap_OpType: return "DrawBitmap";
case kDrawBitmapNine_OpType: return "DrawBitmapNine";
case kDrawBitmapRect_OpType: return "DrawBitmapRect";
@@ -1722,7 +1722,17 @@ SkDrawAnnotationCommand::SkDrawAnnotationCommand(const SkRect& rect, const char
, fRect(rect)
, fKey(key)
, fValue(std::move(value))
-{}
+{
+ SkString str;
+ str.appendf("Key: %s Value: ", key);
+ if (fValue && fValue->size()) {
+ str.append((const char*) fValue->bytes(), fValue->size());
+ } else {
+ str.appendf("no value");
+ }
+ str.appendf("\n");
+ fInfo.push(new SkString(str));
+}
void SkDrawAnnotationCommand::execute(SkCanvas* canvas) const {
canvas->drawAnnotation(fRect, fKey.c_str(), fValue);
« 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