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 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2501 } | 2501 } |
2502 | 2502 |
2503 void LayerTreeHostImpl::SetTreePriority(TreePriority priority) { | 2503 void LayerTreeHostImpl::SetTreePriority(TreePriority priority) { |
2504 if (!tile_manager_) | 2504 if (!tile_manager_) |
2505 return; | 2505 return; |
2506 | 2506 |
2507 GlobalStateThatImpactsTilePriority new_state(tile_manager_->GlobalState()); | 2507 GlobalStateThatImpactsTilePriority new_state(tile_manager_->GlobalState()); |
2508 if (new_state.tree_priority == priority) | 2508 if (new_state.tree_priority == priority) |
2509 return; | 2509 return; |
2510 | 2510 |
2511 TRACE_EVENT0("cc", "LayerTreeHostImpl::SetTreePriority"); | |
2512 | |
2511 new_state.tree_priority = priority; | 2513 new_state.tree_priority = priority; |
2512 tile_manager_->SetGlobalState(new_state); | 2514 tile_manager_->SetGlobalState(new_state); |
2513 manage_tiles_needed_ = true; | 2515 manage_tiles_needed_ = true; |
2516 | |
2517 // In smoothness-takes-priority, we may finish rastering without | |
2518 // activating. We need to guarantee ManageTiles is called after this | |
2519 // case, or we will block activation until after the next compositor | |
2520 // frame (webkit is live-locked in the mean time). | |
2521 if (priority != SMOOTHNESS_TAKES_PRIORITY) | |
reveman
2013/09/10 19:21:20
why not when entering SMOOTHNESS_TAKES_PRIORITY or
epennerAtGoogle
2013/09/10 19:36:55
The reason we are calling it here is to not starve
reveman
2013/09/10 19:57:54
How are we guaranteeing that a new frame is produc
| |
2522 ManageTiles(); | |
2514 } | 2523 } |
2515 | 2524 |
2516 void LayerTreeHostImpl::ResetCurrentFrameTimeForNextFrame() { | 2525 void LayerTreeHostImpl::ResetCurrentFrameTimeForNextFrame() { |
2517 current_frame_timeticks_ = base::TimeTicks(); | 2526 current_frame_timeticks_ = base::TimeTicks(); |
2518 current_frame_time_ = base::Time(); | 2527 current_frame_time_ = base::Time(); |
2519 } | 2528 } |
2520 | 2529 |
2521 void LayerTreeHostImpl::UpdateCurrentFrameTime(base::TimeTicks* ticks, | 2530 void LayerTreeHostImpl::UpdateCurrentFrameTime(base::TimeTicks* ticks, |
2522 base::Time* now) const { | 2531 base::Time* now) const { |
2523 if (ticks->is_null()) { | 2532 if (ticks->is_null()) { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2631 | 2640 |
2632 ResourceProvider::ResourceId LayerTreeHostImpl::ResourceIdForUIResource( | 2641 ResourceProvider::ResourceId LayerTreeHostImpl::ResourceIdForUIResource( |
2633 UIResourceId uid) const { | 2642 UIResourceId uid) const { |
2634 UIResourceMap::const_iterator iter = ui_resource_map_.find(uid); | 2643 UIResourceMap::const_iterator iter = ui_resource_map_.find(uid); |
2635 if (iter != ui_resource_map_.end()) | 2644 if (iter != ui_resource_map_.end()) |
2636 return iter->second; | 2645 return iter->second; |
2637 return 0; | 2646 return 0; |
2638 } | 2647 } |
2639 | 2648 |
2640 } // namespace cc | 2649 } // namespace cc |
OLD | NEW |