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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/resources/display_item_list.h ('k') | cc/resources/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/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
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
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
OLDNEW
« no previous file with comments | « cc/resources/display_item_list.h ('k') | cc/resources/display_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698