| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |