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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 DCHECK(task_runner_provider_->IsImplThread()); | 249 DCHECK(task_runner_provider_->IsImplThread()); |
250 DidVisibilityChange(this, visible_); | 250 DidVisibilityChange(this, visible_); |
251 | 251 |
252 SetDebugState(settings.initial_debug_state); | 252 SetDebugState(settings.initial_debug_state); |
253 | 253 |
254 // LTHI always has an active tree. | 254 // LTHI always has an active tree. |
255 active_tree_ = | 255 active_tree_ = |
256 LayerTreeImpl::create(this, new SyncedProperty<ScaleGroup>(), | 256 LayerTreeImpl::create(this, new SyncedProperty<ScaleGroup>(), |
257 new SyncedTopControls, new SyncedElasticOverscroll); | 257 new SyncedTopControls, new SyncedElasticOverscroll); |
| 258 active_tree_->property_trees()->is_active = true; |
258 | 259 |
259 viewport_ = Viewport::Create(this); | 260 viewport_ = Viewport::Create(this); |
260 | 261 |
261 TRACE_EVENT_OBJECT_CREATED_WITH_ID( | 262 TRACE_EVENT_OBJECT_CREATED_WITH_ID( |
262 TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", id_); | 263 TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", id_); |
263 | 264 |
264 top_controls_manager_ = | 265 top_controls_manager_ = |
265 TopControlsManager::Create(this, | 266 TopControlsManager::Create(this, |
266 settings.top_controls_show_threshold, | 267 settings.top_controls_show_threshold, |
267 settings.top_controls_hide_threshold); | 268 settings.top_controls_hide_threshold); |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 NOTREACHED(); | 1203 NOTREACHED(); |
1203 } | 1204 } |
1204 | 1205 |
1205 void LayerTreeHostImpl::ResetTreesForTesting() { | 1206 void LayerTreeHostImpl::ResetTreesForTesting() { |
1206 if (active_tree_) | 1207 if (active_tree_) |
1207 active_tree_->DetachLayerTree(); | 1208 active_tree_->DetachLayerTree(); |
1208 active_tree_ = | 1209 active_tree_ = |
1209 LayerTreeImpl::create(this, active_tree()->page_scale_factor(), | 1210 LayerTreeImpl::create(this, active_tree()->page_scale_factor(), |
1210 active_tree()->top_controls_shown_ratio(), | 1211 active_tree()->top_controls_shown_ratio(), |
1211 active_tree()->elastic_overscroll()); | 1212 active_tree()->elastic_overscroll()); |
| 1213 active_tree_->property_trees()->is_active = true; |
1212 if (pending_tree_) | 1214 if (pending_tree_) |
1213 pending_tree_->DetachLayerTree(); | 1215 pending_tree_->DetachLayerTree(); |
1214 pending_tree_ = nullptr; | 1216 pending_tree_ = nullptr; |
1215 if (recycle_tree_) | 1217 if (recycle_tree_) |
1216 recycle_tree_->DetachLayerTree(); | 1218 recycle_tree_->DetachLayerTree(); |
1217 recycle_tree_ = nullptr; | 1219 recycle_tree_ = nullptr; |
1218 } | 1220 } |
1219 | 1221 |
1220 size_t LayerTreeHostImpl::SourceAnimationFrameNumberForTesting() const { | 1222 size_t LayerTreeHostImpl::SourceAnimationFrameNumberForTesting() const { |
1221 return fps_counter_->current_frame_number(); | 1223 return fps_counter_->current_frame_number(); |
(...skipping 2741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3963 return task_runner_provider_->HasImplThread(); | 3965 return task_runner_provider_->HasImplThread(); |
3964 } | 3966 } |
3965 | 3967 |
3966 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3968 bool LayerTreeHostImpl::CommitToActiveTree() const { |
3967 // In single threaded mode we skip the pending tree and commit directly to the | 3969 // In single threaded mode we skip the pending tree and commit directly to the |
3968 // active tree. | 3970 // active tree. |
3969 return !task_runner_provider_->HasImplThread(); | 3971 return !task_runner_provider_->HasImplThread(); |
3970 } | 3972 } |
3971 | 3973 |
3972 } // namespace cc | 3974 } // namespace cc |
OLD | NEW |