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

Unified Diff: ui/compositor/paint_recorder.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 | « ui/compositor/paint_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/paint_recorder.cc
diff --git a/ui/compositor/paint_recorder.cc b/ui/compositor/paint_recorder.cc
index 80fb616a35fa169554fbedeb61e73692368db7f6..ee740c6faf5746999ad16945b98ceef0a8a6080f 100644
--- a/ui/compositor/paint_recorder.cc
+++ b/ui/compositor/paint_recorder.cc
@@ -47,11 +47,10 @@ PaintRecorder::~PaintRecorder() {
if (!context_.list_)
return;
- scoped_ptr<cc::DrawingDisplayItem> item = cc::DrawingDisplayItem::Create(
- skia::AdoptRef(context_.recorder_->endRecordingAsPicture()));
+ auto* item = context_.list_->CreateAndAppendItem<cc::DrawingDisplayItem>();
+ item->SetNew(skia::AdoptRef(context_.recorder_->endRecordingAsPicture()));
if (cache_)
- cache_->SetCache(item->Clone());
- context_.list_->AppendItem(item.Pass());
+ cache_->SetCache(item);
}
} // namespace ui
« no previous file with comments | « ui/compositor/paint_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698