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

Unified Diff: cc/resources/drawing_display_item.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « cc/resources/drawing_display_item.h ('k') | cc/resources/filter_display_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « cc/resources/drawing_display_item.h ('k') | cc/resources/filter_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698