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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ui/compositor/paint_cache.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/paint_recorder.h" 5 #include "ui/compositor/paint_recorder.h"
6 6
7 #include "cc/resources/display_item_list.h" 7 #include "cc/resources/display_item_list.h"
8 #include "cc/resources/drawing_display_item.h" 8 #include "cc/resources/drawing_display_item.h"
9 #include "third_party/skia/include/core/SkPictureRecorder.h" 9 #include "third_party/skia/include/core/SkPictureRecorder.h"
10 #include "ui/compositor/paint_cache.h" 10 #include "ui/compositor/paint_cache.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 PaintRecorder::~PaintRecorder() { 42 PaintRecorder::~PaintRecorder() {
43 #if DCHECK_IS_ON() 43 #if DCHECK_IS_ON()
44 context_.inside_paint_recorder_ = false; 44 context_.inside_paint_recorder_ = false;
45 #endif 45 #endif
46 46
47 if (!context_.list_) 47 if (!context_.list_)
48 return; 48 return;
49 49
50 scoped_ptr<cc::DrawingDisplayItem> item = cc::DrawingDisplayItem::Create( 50 auto* item = context_.list_->CreateAndAppendItem<cc::DrawingDisplayItem>();
51 skia::AdoptRef(context_.recorder_->endRecordingAsPicture())); 51 item->SetNew(skia::AdoptRef(context_.recorder_->endRecordingAsPicture()));
52 if (cache_) 52 if (cache_)
53 cache_->SetCache(item->Clone()); 53 cache_->SetCache(item);
54 context_.list_->AppendItem(item.Pass());
55 } 54 }
56 55
57 } // namespace ui 56 } // namespace ui
OLDNEW
« 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