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

Side by Side Diff: cc/playback/display_item_list.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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 | « cc/playback/display_item_list.h ('k') | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/playback/display_item_list.h" 5 #include "cc/playback/display_item_list.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 // TODO(jbroman): Does anything else owned by this class substantially 230 // TODO(jbroman): Does anything else owned by this class substantially
231 // contribute to memory usage? 231 // contribute to memory usage?
232 232
233 return memory_usage; 233 return memory_usage;
234 } 234 }
235 235
236 bool DisplayItemList::ShouldBeAnalyzedForSolidColor() const { 236 bool DisplayItemList::ShouldBeAnalyzedForSolidColor() const {
237 return ApproximateOpCount() <= kOpCountThatIsOkToAnalyze; 237 return ApproximateOpCount() <= kOpCountThatIsOkToAnalyze;
238 } 238 }
239 239
240 scoped_ptr<base::trace_event::ConvertableToTraceFormat> 240 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
241 DisplayItemList::AsValue(bool include_items) const { 241 DisplayItemList::AsValue(bool include_items) const {
242 scoped_ptr<base::trace_event::TracedValue> state( 242 std::unique_ptr<base::trace_event::TracedValue> state(
243 new base::trace_event::TracedValue()); 243 new base::trace_event::TracedValue());
244 244
245 state->BeginDictionary("params"); 245 state->BeginDictionary("params");
246 if (include_items) { 246 if (include_items) {
247 state->BeginArray("items"); 247 state->BeginArray("items");
248 size_t item_index = 0; 248 size_t item_index = 0;
249 for (const DisplayItem& item : items_) { 249 for (const DisplayItem& item : items_) {
250 item.AsValueInto(item_index < visual_rects_.size() 250 item.AsValueInto(item_index < visual_rects_.size()
251 ? visual_rects_[item_index] 251 ? visual_rects_[item_index]
252 : gfx::Rect(), 252 : gfx::Rect(),
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 float raster_scale, 306 float raster_scale,
307 std::vector<DrawImage>* images) { 307 std::vector<DrawImage>* images) {
308 image_map_.GetDiscardableImagesInRect(rect, raster_scale, images); 308 image_map_.GetDiscardableImagesInRect(rect, raster_scale, images);
309 } 309 }
310 310
311 bool DisplayItemList::MayHaveDiscardableImages() const { 311 bool DisplayItemList::MayHaveDiscardableImages() const {
312 return !image_map_.empty(); 312 return !image_map_.empty();
313 } 313 }
314 314
315 } // namespace cc 315 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/display_item_list.h ('k') | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698