| 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/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 new DebugScopedSetImplThread(layer_tree_host_impl_->proxy())); | 105 new DebugScopedSetImplThread(layer_tree_host_impl_->proxy())); |
| 106 } | 106 } |
| 107 | 107 |
| 108 layer_tree_host_impl_->ActivatePendingTreeIfNeeded(); | 108 layer_tree_host_impl_->ActivatePendingTreeIfNeeded(); |
| 109 layer_tree_host_impl_->Animate( | 109 layer_tree_host_impl_->Animate( |
| 110 layer_tree_host_impl_->CurrentFrameTimeTicks(), | 110 layer_tree_host_impl_->CurrentFrameTimeTicks(), |
| 111 layer_tree_host_impl_->CurrentFrameTime()); | 111 layer_tree_host_impl_->CurrentFrameTime()); |
| 112 layer_tree_host_impl_->UpdateBackgroundAnimateTicking(true); | 112 layer_tree_host_impl_->UpdateBackgroundAnimateTicking(true); |
| 113 bool start_ready_animations = true; | 113 bool start_ready_animations = true; |
| 114 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); | 114 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); |
| 115 layer_tree_host_impl_->BeginNextFrame(); | 115 layer_tree_host_impl_->ResetCurrentFrameTimeForNextFrame(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void SetActive(bool active) { | 118 void SetActive(bool active) { |
| 119 if (active != time_source_->Active()) | 119 if (active != time_source_->Active()) |
| 120 time_source_->SetActive(active); | 120 time_source_->SetActive(active); |
| 121 } | 121 } |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 LayerTreeHostImplTimeSourceAdapter( | 124 LayerTreeHostImplTimeSourceAdapter( |
| 125 LayerTreeHostImpl* layer_tree_host_impl, | 125 LayerTreeHostImpl* layer_tree_host_impl, |
| (...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2083 return; | 2083 return; |
| 2084 | 2084 |
| 2085 GlobalStateThatImpactsTilePriority new_state(tile_manager_->GlobalState()); | 2085 GlobalStateThatImpactsTilePriority new_state(tile_manager_->GlobalState()); |
| 2086 if (new_state.tree_priority == priority) | 2086 if (new_state.tree_priority == priority) |
| 2087 return; | 2087 return; |
| 2088 | 2088 |
| 2089 new_state.tree_priority = priority; | 2089 new_state.tree_priority = priority; |
| 2090 tile_manager_->SetGlobalState(new_state); | 2090 tile_manager_->SetGlobalState(new_state); |
| 2091 } | 2091 } |
| 2092 | 2092 |
| 2093 void LayerTreeHostImpl::BeginNextFrame() { | 2093 void LayerTreeHostImpl::ResetCurrentFrameTimeForNextFrame() { |
| 2094 current_frame_timeticks_ = base::TimeTicks(); | 2094 current_frame_timeticks_ = base::TimeTicks(); |
| 2095 current_frame_time_ = base::Time(); | 2095 current_frame_time_ = base::Time(); |
| 2096 } | 2096 } |
| 2097 | 2097 |
| 2098 static void UpdateCurrentFrameTime(base::TimeTicks* ticks, base::Time* now) { | 2098 static void UpdateCurrentFrameTime(base::TimeTicks* ticks, base::Time* now) { |
| 2099 if (ticks->is_null()) { | 2099 if (ticks->is_null()) { |
| 2100 DCHECK(now->is_null()); | 2100 DCHECK(now->is_null()); |
| 2101 *ticks = base::TimeTicks::Now(); | 2101 *ticks = base::TimeTicks::Now(); |
| 2102 *now = base::Time::Now(); | 2102 *now = base::Time::Now(); |
| 2103 } | 2103 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 } | 2162 } |
| 2163 | 2163 |
| 2164 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2164 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
| 2165 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2165 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
| 2166 paint_time_counter_->ClearHistory(); | 2166 paint_time_counter_->ClearHistory(); |
| 2167 | 2167 |
| 2168 debug_state_ = debug_state; | 2168 debug_state_ = debug_state; |
| 2169 } | 2169 } |
| 2170 | 2170 |
| 2171 } // namespace cc | 2171 } // namespace cc |
| OLD | NEW |