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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/animation/keyframed_animation_curve.h" | 8 #include "cc/animation/keyframed_animation_curve.h" |
9 #include "cc/animation/scrollbar_animation_controller.h" | 9 #include "cc/animation/scrollbar_animation_controller.h" |
10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pending_tree) { | 343 void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pending_tree) { |
344 int id = currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0; | 344 int id = currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0; |
345 LayerImpl* pending_scrolling_layer_twin = NULL; | 345 LayerImpl* pending_scrolling_layer_twin = NULL; |
346 if (pending_tree->root_layer()) { | 346 if (pending_tree->root_layer()) { |
347 pending_scrolling_layer_twin = | 347 pending_scrolling_layer_twin = |
348 LayerTreeHostCommon::FindLayerInSubtree(pending_tree->root_layer(), id); | 348 LayerTreeHostCommon::FindLayerInSubtree(pending_tree->root_layer(), id); |
349 } | 349 } |
350 pending_tree->SetCurrentlyScrollingLayer(pending_scrolling_layer_twin); | 350 pending_tree->SetCurrentlyScrollingLayer(pending_scrolling_layer_twin); |
351 } | 351 } |
352 | 352 |
353 static void DidBecomeActiveRecursive(LayerImpl* layer) { | 353 static void MarkActive(LayerImpl* layer) { |
354 layer->DidBecomeActive(); | 354 layer->DidBecomeActive(); |
355 for (size_t i = 0; i < layer->children().size(); ++i) | |
356 DidBecomeActiveRecursive(layer->children()[i]); | |
357 } | 355 } |
358 | 356 |
359 void LayerTreeImpl::DidBecomeActive() { | 357 void LayerTreeImpl::DidBecomeActive() { |
360 if (root_layer()) | 358 if (root_layer()) |
361 DidBecomeActiveRecursive(root_layer()); | 359 LayerTreeHostCommon::CallFunctionForSubtree(MarkActive, root_layer()); |
362 FindRootScrollLayer(); | 360 FindRootScrollLayer(); |
363 UpdateMaxScrollOffset(); | 361 UpdateMaxScrollOffset(); |
364 } | 362 } |
365 | 363 |
366 bool LayerTreeImpl::ContentsTexturesPurged() const { | 364 bool LayerTreeImpl::ContentsTexturesPurged() const { |
367 return contents_textures_purged_; | 365 return contents_textures_purged_; |
368 } | 366 } |
369 | 367 |
370 void LayerTreeImpl::SetContentsTexturesPurged() { | 368 void LayerTreeImpl::SetContentsTexturesPurged() { |
371 contents_textures_purged_ = true; | 369 contents_textures_purged_ = true; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 562 |
565 void LayerTreeImpl::ClearLatencyInfo() { | 563 void LayerTreeImpl::ClearLatencyInfo() { |
566 latency_info_.Clear(); | 564 latency_info_.Clear(); |
567 } | 565 } |
568 | 566 |
569 void LayerTreeImpl::WillModifyTilePriorities() { | 567 void LayerTreeImpl::WillModifyTilePriorities() { |
570 layer_tree_host_impl_->tile_manager()->WillModifyTilePriorities(); | 568 layer_tree_host_impl_->tile_manager()->WillModifyTilePriorities(); |
571 } | 569 } |
572 | 570 |
573 } // namespace cc | 571 } // namespace cc |
OLD | NEW |