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

Unified Diff: cc/resources/display_item_list.cc

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@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/display_item_list.h ('k') | cc/resources/display_list_recording_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/display_item_list.cc
diff --git a/cc/resources/display_item_list.cc b/cc/resources/display_item_list.cc
index 2ead28d07344d1ee9efb4748d7ad0b46d2acf67d..6424fee414d394abd3c4e2970af3e0bdf7a9d842 100644
--- a/cc/resources/display_item_list.cc
+++ b/cc/resources/display_item_list.cc
@@ -4,9 +4,15 @@
#include "cc/resources/display_item_list.h"
+#include <string>
+
#include "base/debug/trace_event.h"
#include "base/debug/trace_event_argument.h"
+#include "cc/base/math_util.h"
+#include "cc/debug/picture_debug_util.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkPictureRecorder.h"
+#include "ui/gfx/skia_util.h"
namespace cc {
@@ -64,8 +70,23 @@ scoped_refptr<base::debug::ConvertableToTraceFormat> DisplayItemList::AsValue()
scoped_refptr<base::debug::TracedValue> state =
new base::debug::TracedValue();
- // TODO(ajuma): Include the value of each item.
state->SetInteger("length", items_.size());
+ state->SetValue("params.layer_rect",
+ MathUtil::AsValue(layer_rect_).release());
+
+ SkPictureRecorder recorder;
+ SkCanvas* canvas =
+ recorder.beginRecording(layer_rect_.width(), layer_rect_.height());
+ canvas->translate(-layer_rect_.x(), -layer_rect_.y());
+ canvas->clipRect(gfx::RectToSkRect(layer_rect_));
+ for (size_t i = 0; i < items_.size(); ++i)
+ items_[i]->RasterForTracing(canvas);
+ skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
+
+ std::string b64_picture;
+ PictureDebugUtil::SerializeAsBase64(picture.get(), &b64_picture);
+ state->SetString("skp64", b64_picture);
+
return state;
}
« no previous file with comments | « cc/resources/display_item_list.h ('k') | cc/resources/display_list_recording_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698