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

Unified Diff: ui/compositor/compositing_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/clip_transform_recorder.cc ('k') | ui/compositor/paint_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositing_recorder.cc
diff --git a/ui/compositor/compositing_recorder.cc b/ui/compositor/compositing_recorder.cc
index 80d4f5747801adb9018a32517b5ea6730e779723..4c667d5a4a9f6d98aab80cd73ddc8048f6a00283 100644
--- a/ui/compositor/compositing_recorder.cc
+++ b/ui/compositor/compositing_recorder.cc
@@ -20,9 +20,10 @@ CompositingRecorder::CompositingRecorder(const PaintContext& context,
if (context_.canvas_) {
context_.canvas_->SaveLayerAlpha(alpha);
} else {
- context_.list_->AppendItem(cc::CompositingDisplayItem::Create(
- alpha, SkXfermode::kSrcOver_Mode, nullptr /* no bounds */,
- skia::RefPtr<SkColorFilter>()));
+ auto* item =
+ context_.list_->CreateAndAppendItem<cc::CompositingDisplayItem>();
+ item->SetNew(alpha, SkXfermode::kSrcOver_Mode, nullptr /* no bounds */,
+ skia::RefPtr<SkColorFilter>());
}
}
@@ -33,7 +34,7 @@ CompositingRecorder::~CompositingRecorder() {
if (context_.canvas_) {
context_.canvas_->Restore();
} else {
- context_.list_->AppendItem(cc::EndCompositingDisplayItem::Create());
+ context_.list_->CreateAndAppendItem<cc::EndCompositingDisplayItem>();
}
}
« no previous file with comments | « ui/compositor/clip_transform_recorder.cc ('k') | ui/compositor/paint_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698