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 <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 page_scale_layer_(NULL), | 81 page_scale_layer_(NULL), |
82 inner_viewport_scroll_layer_(NULL), | 82 inner_viewport_scroll_layer_(NULL), |
83 outer_viewport_scroll_layer_(NULL), | 83 outer_viewport_scroll_layer_(NULL), |
84 page_scale_factor_(1), | 84 page_scale_factor_(1), |
85 page_scale_delta_(1), | 85 page_scale_delta_(1), |
86 sent_page_scale_delta_(1), | 86 sent_page_scale_delta_(1), |
87 min_page_scale_factor_(0), | 87 min_page_scale_factor_(0), |
88 max_page_scale_factor_(0), | 88 max_page_scale_factor_(0), |
89 scrolling_layer_id_from_previous_tree_(0), | 89 scrolling_layer_id_from_previous_tree_(0), |
90 contents_textures_purged_(false), | 90 contents_textures_purged_(false), |
91 requires_high_res_to_draw_(false), | |
92 viewport_size_invalid_(false), | 91 viewport_size_invalid_(false), |
93 needs_update_draw_properties_(true), | 92 needs_update_draw_properties_(true), |
94 needs_full_tree_sync_(true), | 93 needs_full_tree_sync_(true), |
95 next_activation_forces_redraw_(false), | 94 next_activation_forces_redraw_(false), |
96 has_ever_been_drawn_(false), | 95 has_ever_been_drawn_(false), |
97 render_surface_layer_list_id_(0), | 96 render_surface_layer_list_id_(0), |
98 top_controls_layout_height_(0), | 97 top_controls_layout_height_(0), |
99 top_controls_content_offset_(0), | 98 top_controls_content_offset_(0), |
100 top_controls_delta_(0), | 99 top_controls_delta_(0), |
101 sent_top_controls_delta_(0) { | 100 sent_top_controls_delta_(0) { |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 next_activation_forces_redraw_ = false; | 620 next_activation_forces_redraw_ = false; |
622 } | 621 } |
623 | 622 |
624 if (scrolling_layer_id_from_previous_tree_) { | 623 if (scrolling_layer_id_from_previous_tree_) { |
625 currently_scrolling_layer_ = LayerTreeHostCommon::FindLayerInSubtree( | 624 currently_scrolling_layer_ = LayerTreeHostCommon::FindLayerInSubtree( |
626 root_layer(), scrolling_layer_id_from_previous_tree_); | 625 root_layer(), scrolling_layer_id_from_previous_tree_); |
627 } | 626 } |
628 | 627 |
629 // Always reset this flag on activation, as we would only have activated | 628 // Always reset this flag on activation, as we would only have activated |
630 // if we were in a good state. | 629 // if we were in a good state. |
631 ResetRequiresHighResToDraw(); | 630 layer_tree_host_impl_->ResetRequiresHighResToDraw(); |
632 | 631 |
633 if (root_layer()) | 632 if (root_layer()) |
634 DidBecomeActiveRecursive(root_layer()); | 633 DidBecomeActiveRecursive(root_layer()); |
635 | 634 |
636 devtools_instrumentation::DidActivateLayerTree(layer_tree_host_impl_->id(), | 635 devtools_instrumentation::DidActivateLayerTree(layer_tree_host_impl_->id(), |
637 source_frame_number_); | 636 source_frame_number_); |
638 } | 637 } |
639 | 638 |
640 bool LayerTreeImpl::ContentsTexturesPurged() const { | 639 bool LayerTreeImpl::ContentsTexturesPurged() const { |
641 return contents_textures_purged_; | 640 return contents_textures_purged_; |
642 } | 641 } |
643 | 642 |
644 void LayerTreeImpl::SetContentsTexturesPurged() { | 643 void LayerTreeImpl::SetContentsTexturesPurged() { |
645 if (contents_textures_purged_) | 644 if (contents_textures_purged_) |
646 return; | 645 return; |
647 contents_textures_purged_ = true; | 646 contents_textures_purged_ = true; |
648 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | 647 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
649 } | 648 } |
650 | 649 |
651 void LayerTreeImpl::ResetContentsTexturesPurged() { | 650 void LayerTreeImpl::ResetContentsTexturesPurged() { |
652 if (!contents_textures_purged_) | 651 if (!contents_textures_purged_) |
653 return; | 652 return; |
654 contents_textures_purged_ = false; | 653 contents_textures_purged_ = false; |
655 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | 654 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
656 } | 655 } |
657 | 656 |
658 void LayerTreeImpl::SetRequiresHighResToDraw() { | |
659 requires_high_res_to_draw_ = true; | |
660 } | |
661 | |
662 void LayerTreeImpl::ResetRequiresHighResToDraw() { | |
663 requires_high_res_to_draw_ = false; | |
664 } | |
665 | |
666 bool LayerTreeImpl::RequiresHighResToDraw() const { | 657 bool LayerTreeImpl::RequiresHighResToDraw() const { |
667 return requires_high_res_to_draw_; | 658 return layer_tree_host_impl_->RequiresHighResToDraw(); |
668 } | 659 } |
669 | 660 |
670 bool LayerTreeImpl::ViewportSizeInvalid() const { | 661 bool LayerTreeImpl::ViewportSizeInvalid() const { |
671 return viewport_size_invalid_; | 662 return viewport_size_invalid_; |
672 } | 663 } |
673 | 664 |
674 void LayerTreeImpl::SetViewportSizeInvalid() { | 665 void LayerTreeImpl::SetViewportSizeInvalid() { |
675 viewport_size_invalid_ = true; | 666 viewport_size_invalid_ = true; |
676 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | 667 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
677 } | 668 } |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 page_scale, | 1496 page_scale, |
1506 duration.InSecondsF()); | 1497 duration.InSecondsF()); |
1507 } | 1498 } |
1508 } | 1499 } |
1509 | 1500 |
1510 scoped_ptr<PageScaleAnimation> LayerTreeImpl::TakePageScaleAnimation() { | 1501 scoped_ptr<PageScaleAnimation> LayerTreeImpl::TakePageScaleAnimation() { |
1511 return page_scale_animation_.Pass(); | 1502 return page_scale_animation_.Pass(); |
1512 } | 1503 } |
1513 | 1504 |
1514 } // namespace cc | 1505 } // namespace cc |
OLD | NEW |