| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return state; | 136 return state; |
| 137 } | 137 } |
| 138 | 138 |
| 139 void DisplayItemList::EmitTraceSnapshot() const { | 139 void DisplayItemList::EmitTraceSnapshot() const { |
| 140 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( | 140 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( |
| 141 TRACE_DISABLED_BY_DEFAULT("cc.debug.picture") "," | 141 TRACE_DISABLED_BY_DEFAULT("cc.debug.picture") "," |
| 142 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.picture"), | 142 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.picture"), |
| 143 "cc::DisplayItemList", this, AsValue()); | 143 "cc::DisplayItemList", this, AsValue()); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void DisplayItemList::GatherPixelRefs(const gfx::Size& grid_cell_size) { | |
| 147 // This should be only called once, and only after CreateAndCacheSkPicture. | |
| 148 DCHECK(picture_); | |
| 149 DCHECK(!pixel_refs_); | |
| 150 pixel_refs_ = make_scoped_ptr(new PixelRefMap(grid_cell_size)); | |
| 151 if (!picture_->willPlayBackBitmaps()) | |
| 152 return; | |
| 153 | |
| 154 pixel_refs_->GatherPixelRefsFromPicture(picture_.get()); | |
| 155 } | |
| 156 } // namespace cc | 146 } // namespace cc |
| OLD | NEW |