Index: cc/resources/drawing_display_item.cc |
diff --git a/cc/resources/drawing_display_item.cc b/cc/resources/drawing_display_item.cc |
index 473cb77e6ef85a43fc8e6cdc85ad8e39b7950e86..351fade134bc41e0cc0e26329023a7233eb54856 100644 |
--- a/cc/resources/drawing_display_item.cc |
+++ b/cc/resources/drawing_display_item.cc |
@@ -4,7 +4,12 @@ |
#include "cc/resources/drawing_display_item.h" |
+#include <string> |
+ |
#include "base/logging.h" |
+#include "base/strings/stringprintf.h" |
+#include "base/trace_event/trace_event_argument.h" |
+#include "cc/debug/picture_debug_util.h" |
#include "third_party/skia/include/core/SkCanvas.h" |
#include "third_party/skia/include/core/SkDrawPictureCallback.h" |
#include "third_party/skia/include/core/SkMatrix.h" |
@@ -57,4 +62,16 @@ size_t DrawingDisplayItem::PictureMemoryUsage() const { |
return SkPictureUtils::ApproximateBytesUsed(picture_.get()); |
} |
+void DrawingDisplayItem::AsValueInto(base::debug::TracedValue* array) const { |
+ array->BeginDictionary(); |
+ array->SetString("name", "DrawingDisplayItem"); |
+ array->SetString("location", |
+ base::StringPrintf("[%f,%f]", picture_->cullRect().x(), |
+ picture_->cullRect().y())); |
+ std::string b64_picture; |
+ PictureDebugUtil::SerializeAsBase64(picture_.get(), &b64_picture); |
+ array->SetString("skp64", b64_picture); |
+ array->EndDictionary(); |
+} |
+ |
} // namespace cc |