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

Unified Diff: cc/resources/drawing_display_item.cc

Issue 1123983002: cc: Use a ListContainer for DisplayItemList to reduce allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: displaylistcontainer: fixdcheck Created 5 years, 7 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 333d29862274b5023f019e8c103394eb3d80fa0f..97864b3228ee5695b5aacc1f140a34657bb713f9 100644
--- a/cc/resources/drawing_display_item.cc
+++ b/cc/resources/drawing_display_item.cc
@@ -17,13 +17,16 @@
namespace cc {
-DrawingDisplayItem::DrawingDisplayItem(skia::RefPtr<SkPicture> picture)
- : picture_(picture) {
+DrawingDisplayItem::DrawingDisplayItem() {
}
DrawingDisplayItem::~DrawingDisplayItem() {
}
+void DrawingDisplayItem::SetNew(skia::RefPtr<SkPicture> picture) {
+ picture_ = picture.Pass();
+}
+
void DrawingDisplayItem::Raster(SkCanvas* canvas,
SkDrawPictureCallback* callback) const {
// SkPicture always does a wrapping save/restore on the canvas, so it is not
@@ -62,8 +65,8 @@ void DrawingDisplayItem::AsValueInto(
array->EndDictionary();
}
-scoped_ptr<DrawingDisplayItem> DrawingDisplayItem::Clone() {
- return Create(picture_);
+void DrawingDisplayItem::CloneTo(DrawingDisplayItem* item) const {
+ item->SetNew(picture_);
}
} // 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