| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 has_transparent_background_(false), | 50 has_transparent_background_(false), |
| 51 overscroll_elasticity_layer_(NULL), | 51 overscroll_elasticity_layer_(NULL), |
| 52 page_scale_layer_(NULL), | 52 page_scale_layer_(NULL), |
| 53 inner_viewport_scroll_layer_(NULL), | 53 inner_viewport_scroll_layer_(NULL), |
| 54 outer_viewport_scroll_layer_(NULL), | 54 outer_viewport_scroll_layer_(NULL), |
| 55 page_scale_factor_(page_scale_factor), | 55 page_scale_factor_(page_scale_factor), |
| 56 min_page_scale_factor_(0), | 56 min_page_scale_factor_(0), |
| 57 max_page_scale_factor_(0), | 57 max_page_scale_factor_(0), |
| 58 elastic_overscroll_(elastic_overscroll), | 58 elastic_overscroll_(elastic_overscroll), |
| 59 scrolling_layer_id_from_previous_tree_(0), | 59 scrolling_layer_id_from_previous_tree_(0), |
| 60 contents_textures_purged_(false), | |
| 61 viewport_size_invalid_(false), | 60 viewport_size_invalid_(false), |
| 62 needs_update_draw_properties_(true), | 61 needs_update_draw_properties_(true), |
| 63 needs_full_tree_sync_(true), | 62 needs_full_tree_sync_(true), |
| 64 next_activation_forces_redraw_(false), | 63 next_activation_forces_redraw_(false), |
| 65 has_ever_been_drawn_(false), | 64 has_ever_been_drawn_(false), |
| 66 render_surface_layer_list_id_(0), | 65 render_surface_layer_list_id_(0), |
| 67 top_controls_shrink_blink_size_(false), | 66 top_controls_shrink_blink_size_(false), |
| 68 top_controls_height_(0), | 67 top_controls_height_(0), |
| 69 top_controls_shown_ratio_(top_controls_shown_ratio) { | 68 top_controls_shown_ratio_(top_controls_shown_ratio) { |
| 70 } | 69 } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 227 } |
| 229 | 228 |
| 230 target_tree->RegisterSelection(selection_); | 229 target_tree->RegisterSelection(selection_); |
| 231 | 230 |
| 232 // This should match the property synchronization in | 231 // This should match the property synchronization in |
| 233 // LayerTreeHost::finishCommitOnImplThread(). | 232 // LayerTreeHost::finishCommitOnImplThread(). |
| 234 target_tree->set_source_frame_number(source_frame_number()); | 233 target_tree->set_source_frame_number(source_frame_number()); |
| 235 target_tree->set_background_color(background_color()); | 234 target_tree->set_background_color(background_color()); |
| 236 target_tree->set_has_transparent_background(has_transparent_background()); | 235 target_tree->set_has_transparent_background(has_transparent_background()); |
| 237 | 236 |
| 238 if (ContentsTexturesPurged()) | |
| 239 target_tree->SetContentsTexturesPurged(); | |
| 240 else | |
| 241 target_tree->ResetContentsTexturesPurged(); | |
| 242 | |
| 243 if (ViewportSizeInvalid()) | 237 if (ViewportSizeInvalid()) |
| 244 target_tree->SetViewportSizeInvalid(); | 238 target_tree->SetViewportSizeInvalid(); |
| 245 else | 239 else |
| 246 target_tree->ResetViewportSizeInvalid(); | 240 target_tree->ResetViewportSizeInvalid(); |
| 247 | 241 |
| 248 if (hud_layer()) | 242 if (hud_layer()) |
| 249 target_tree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>( | 243 target_tree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>( |
| 250 LayerTreeHostCommon::FindLayerInSubtree( | 244 LayerTreeHostCommon::FindLayerInSubtree( |
| 251 target_tree->root_layer(), hud_layer()->id()))); | 245 target_tree->root_layer(), hud_layer()->id()))); |
| 252 else | 246 else |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 LayerTreeHostCommon::CallFunctionForSubtree( | 784 LayerTreeHostCommon::CallFunctionForSubtree( |
| 791 root_layer(), [](LayerImpl* layer) { layer->DidBecomeActive(); }); | 785 root_layer(), [](LayerImpl* layer) { layer->DidBecomeActive(); }); |
| 792 } | 786 } |
| 793 | 787 |
| 794 for (auto* swap_promise : swap_promise_list_) | 788 for (auto* swap_promise : swap_promise_list_) |
| 795 swap_promise->DidActivate(); | 789 swap_promise->DidActivate(); |
| 796 devtools_instrumentation::DidActivateLayerTree(layer_tree_host_impl_->id(), | 790 devtools_instrumentation::DidActivateLayerTree(layer_tree_host_impl_->id(), |
| 797 source_frame_number_); | 791 source_frame_number_); |
| 798 } | 792 } |
| 799 | 793 |
| 800 bool LayerTreeImpl::ContentsTexturesPurged() const { | |
| 801 return contents_textures_purged_; | |
| 802 } | |
| 803 | |
| 804 void LayerTreeImpl::SetContentsTexturesPurged() { | |
| 805 if (contents_textures_purged_) | |
| 806 return; | |
| 807 contents_textures_purged_ = true; | |
| 808 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | |
| 809 } | |
| 810 | |
| 811 void LayerTreeImpl::ResetContentsTexturesPurged() { | |
| 812 if (!contents_textures_purged_) | |
| 813 return; | |
| 814 contents_textures_purged_ = false; | |
| 815 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | |
| 816 } | |
| 817 | |
| 818 bool LayerTreeImpl::RequiresHighResToDraw() const { | 794 bool LayerTreeImpl::RequiresHighResToDraw() const { |
| 819 return layer_tree_host_impl_->RequiresHighResToDraw(); | 795 return layer_tree_host_impl_->RequiresHighResToDraw(); |
| 820 } | 796 } |
| 821 | 797 |
| 822 bool LayerTreeImpl::ViewportSizeInvalid() const { | 798 bool LayerTreeImpl::ViewportSizeInvalid() const { |
| 823 return viewport_size_invalid_; | 799 return viewport_size_invalid_; |
| 824 } | 800 } |
| 825 | 801 |
| 826 void LayerTreeImpl::SetViewportSizeInvalid() { | 802 void LayerTreeImpl::SetViewportSizeInvalid() { |
| 827 viewport_size_invalid_ = true; | 803 viewport_size_invalid_ = true; |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1596 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1572 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
| 1597 pending_page_scale_animation_ = pending_animation.Pass(); | 1573 pending_page_scale_animation_ = pending_animation.Pass(); |
| 1598 } | 1574 } |
| 1599 | 1575 |
| 1600 scoped_ptr<PendingPageScaleAnimation> | 1576 scoped_ptr<PendingPageScaleAnimation> |
| 1601 LayerTreeImpl::TakePendingPageScaleAnimation() { | 1577 LayerTreeImpl::TakePendingPageScaleAnimation() { |
| 1602 return pending_page_scale_animation_.Pass(); | 1578 return pending_page_scale_animation_.Pass(); |
| 1603 } | 1579 } |
| 1604 | 1580 |
| 1605 } // namespace cc | 1581 } // namespace cc |
| OLD | NEW |