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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 DCHECK(ProcessAppendedItemsCalled()); | 198 DCHECK(ProcessAppendedItemsCalled()); |
199 return approximate_op_count_; | 199 return approximate_op_count_; |
200 } | 200 } |
201 | 201 |
202 size_t DisplayItemList::PictureMemoryUsage() const { | 202 size_t DisplayItemList::PictureMemoryUsage() const { |
203 DCHECK(ProcessAppendedItemsCalled()); | 203 DCHECK(ProcessAppendedItemsCalled()); |
204 // We double-count in this case. Produce zero to avoid being misleading. | 204 // We double-count in this case. Produce zero to avoid being misleading. |
205 if (use_cached_picture_ && retain_individual_display_items_) | 205 if (use_cached_picture_ && retain_individual_display_items_) |
206 return 0; | 206 return 0; |
207 | 207 |
208 DCHECK_IMPLIES(use_cached_picture_, picture_); | 208 DCHECK(!use_cached_picture_ || picture_); |
209 return picture_memory_usage_; | 209 return picture_memory_usage_; |
210 } | 210 } |
211 | 211 |
212 scoped_refptr<base::trace_event::ConvertableToTraceFormat> | 212 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
213 DisplayItemList::AsValue(bool include_items) const { | 213 DisplayItemList::AsValue(bool include_items) const { |
214 DCHECK(ProcessAppendedItemsCalled()); | 214 DCHECK(ProcessAppendedItemsCalled()); |
215 scoped_refptr<base::trace_event::TracedValue> state = | 215 scoped_refptr<base::trace_event::TracedValue> state = |
216 new base::trace_event::TracedValue(); | 216 new base::trace_event::TracedValue(); |
217 | 217 |
218 if (include_items) { | 218 if (include_items) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 return; | 264 return; |
265 | 265 |
266 pixel_refs_->GatherPixelRefsFromPicture(picture_.get()); | 266 pixel_refs_->GatherPixelRefsFromPicture(picture_.get()); |
267 } | 267 } |
268 | 268 |
269 void* DisplayItemList::GetSidecar(DisplayItem* display_item) { | 269 void* DisplayItemList::GetSidecar(DisplayItem* display_item) { |
270 return items_.GetSidecar(display_item); | 270 return items_.GetSidecar(display_item); |
271 } | 271 } |
272 | 272 |
273 } // namespace cc | 273 } // namespace cc |
OLD | NEW |