| 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/resources/display_item_list.h" | 5 #include "cc/resources/display_item_list.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 size_t DisplayItemList::PictureMemoryUsage() const { | 58 size_t DisplayItemList::PictureMemoryUsage() const { |
| 59 size_t total_size = 0; | 59 size_t total_size = 0; |
| 60 | 60 |
| 61 for (const auto& item : items_) { | 61 for (const auto& item : items_) { |
| 62 total_size += item->PictureMemoryUsage(); | 62 total_size += item->PictureMemoryUsage(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 return total_size; | 65 return total_size; |
| 66 } | 66 } |
| 67 | 67 |
| 68 scoped_refptr<base::debug::ConvertableToTraceFormat> DisplayItemList::AsValue() | 68 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
| 69 const { | 69 DisplayItemList::AsValue() const { |
| 70 scoped_refptr<base::debug::TracedValue> state = | 70 scoped_refptr<base::trace_event::TracedValue> state = |
| 71 new base::debug::TracedValue(); | 71 new base::trace_event::TracedValue(); |
| 72 | 72 |
| 73 state->SetInteger("length", items_.size()); | 73 state->SetInteger("length", items_.size()); |
| 74 state->BeginArray("params.items"); | 74 state->BeginArray("params.items"); |
| 75 for (const DisplayItem* item : items_) { | 75 for (const DisplayItem* item : items_) { |
| 76 item->AsValueInto(state.get()); | 76 item->AsValueInto(state.get()); |
| 77 } | 77 } |
| 78 state->EndArray(); | 78 state->EndArray(); |
| 79 state->SetValue("params.layer_rect", | 79 state->SetValue("params.layer_rect", |
| 80 MathUtil::AsValue(layer_rect_).release()); | 80 MathUtil::AsValue(layer_rect_).release()); |
| 81 | 81 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 void DisplayItemList::EmitTraceSnapshot() const { | 98 void DisplayItemList::EmitTraceSnapshot() const { |
| 99 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( | 99 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( |
| 100 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT( | 100 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT( |
| 101 "devtools.timeline.picture"), | 101 "devtools.timeline.picture"), |
| 102 "cc::DisplayItemList", this, AsValue()); | 102 "cc::DisplayItemList", this, AsValue()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace cc | 105 } // namespace cc |
| OLD | NEW |