From fb40923afdb31f86c5f53f93a5c3885605292ac6 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Wed, 29 Jun 2016 10:28:11 -0700 Subject: [PATCH] Add Annotations to old debugger GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2110083002 Review-Url: https://codereview.chromium.org/2110083002 --- tools/debugger/SkDrawCommand.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp index 1ef5e0b86c..029be6cf8c 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); -- 2.34.1