OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
| 9 #include <map> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
12 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
13 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
14 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
15 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
16 #include "base/trace_event/trace_event_argument.h" | 17 #include "base/trace_event/trace_event_argument.h" |
17 #include "cc/animation/animation_id_provider.h" | 18 #include "cc/animation/animation_id_provider.h" |
18 #include "cc/animation/scroll_offset_animation_curve.h" | 19 #include "cc/animation/scroll_offset_animation_curve.h" |
(...skipping 3218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3237 FrameData* frame, | 3238 FrameData* frame, |
3238 base::trace_event::TracedValue* state) const { | 3239 base::trace_event::TracedValue* state) const { |
3239 if (this->pending_tree_) { | 3240 if (this->pending_tree_) { |
3240 state->BeginDictionary("activation_state"); | 3241 state->BeginDictionary("activation_state"); |
3241 ActivationStateAsValueInto(state); | 3242 ActivationStateAsValueInto(state); |
3242 state->EndDictionary(); | 3243 state->EndDictionary(); |
3243 } | 3244 } |
3244 MathUtil::AddToTracedValue("device_viewport_size", device_viewport_size_, | 3245 MathUtil::AddToTracedValue("device_viewport_size", device_viewport_size_, |
3245 state); | 3246 state); |
3246 | 3247 |
3247 std::set<const Tile*> tiles; | 3248 std::map<const Tile*, TilePriority> tile_map; |
3248 active_tree_->GetAllTilesForTracing(&tiles); | 3249 active_tree_->GetAllTilesAndPrioritiesForTracing(&tile_map); |
3249 if (pending_tree_) | 3250 if (pending_tree_) |
3250 pending_tree_->GetAllTilesForTracing(&tiles); | 3251 pending_tree_->GetAllTilesAndPrioritiesForTracing(&tile_map); |
3251 | 3252 |
3252 state->BeginArray("active_tiles"); | 3253 state->BeginArray("active_tiles"); |
3253 for (std::set<const Tile*>::const_iterator it = tiles.begin(); | 3254 for (const auto& pair : tile_map) { |
3254 it != tiles.end(); | 3255 const Tile* tile = pair.first; |
3255 ++it) { | 3256 const TilePriority& priority = pair.second; |
3256 const Tile* tile = *it; | |
3257 | 3257 |
3258 state->BeginDictionary(); | 3258 state->BeginDictionary(); |
3259 tile->AsValueInto(state); | 3259 tile->AsValueWithPriorityInto(priority, state); |
3260 state->EndDictionary(); | 3260 state->EndDictionary(); |
3261 } | 3261 } |
3262 state->EndArray(); | 3262 state->EndArray(); |
3263 | 3263 |
3264 if (tile_manager_) { | 3264 if (tile_manager_) { |
3265 state->BeginDictionary("tile_manager_basic_state"); | 3265 state->BeginDictionary("tile_manager_basic_state"); |
3266 tile_manager_->BasicStateAsValueInto(state); | 3266 tile_manager_->BasicStateAsValueInto(state); |
3267 state->EndDictionary(); | 3267 state->EndDictionary(); |
3268 } | 3268 } |
3269 state->BeginDictionary("active_tree"); | 3269 state->BeginDictionary("active_tree"); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3467 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3467 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
3468 | 3468 |
3469 curve->UpdateTarget( | 3469 curve->UpdateTarget( |
3470 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3470 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
3471 .InSecondsF(), | 3471 .InSecondsF(), |
3472 new_target); | 3472 new_target); |
3473 | 3473 |
3474 return true; | 3474 return true; |
3475 } | 3475 } |
3476 } // namespace cc | 3476 } // namespace cc |
OLD | NEW |