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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 } | 724 } |
725 | 725 |
726 // It'd be ideal if this could be done earlier, but when the raster source | 726 // It'd be ideal if this could be done earlier, but when the raster source |
727 // is updated from the main thread during push properties, update draw | 727 // is updated from the main thread during push properties, update draw |
728 // properties has not occurred yet and so it's not clear whether or not the | 728 // properties has not occurred yet and so it's not clear whether or not the |
729 // layer can or cannot use lcd text. So, this is the cleanup pass to | 729 // layer can or cannot use lcd text. So, this is the cleanup pass to |
730 // determine if the raster source needs to be replaced with a non-lcd | 730 // determine if the raster source needs to be replaced with a non-lcd |
731 // raster source due to draw properties. | 731 // raster source due to draw properties. |
732 if (update_lcd_text) { | 732 if (update_lcd_text) { |
733 // TODO(enne): Make LTHI::sync_tree return this value. | 733 // TODO(enne): Make LTHI::sync_tree return this value. |
734 LayerTreeImpl* sync_tree = | 734 LayerTreeImpl* sync_tree = layer_tree_host_impl_->CommitToActiveTree() |
735 layer_tree_host_impl_->proxy()->CommitToActiveTree() | 735 ? layer_tree_host_impl_->active_tree() |
736 ? layer_tree_host_impl_->active_tree() | 736 : layer_tree_host_impl_->pending_tree(); |
737 : layer_tree_host_impl_->pending_tree(); | |
738 // If this is not the sync tree, then it is not safe to update lcd text | 737 // If this is not the sync tree, then it is not safe to update lcd text |
739 // as it causes invalidations and the tiles may be in use. | 738 // as it causes invalidations and the tiles may be in use. |
740 DCHECK_EQ(this, sync_tree); | 739 DCHECK_EQ(this, sync_tree); |
741 for (const auto& layer : picture_layers_) | 740 for (const auto& layer : picture_layers_) |
742 layer->UpdateCanUseLCDTextAfterCommit(); | 741 layer->UpdateCanUseLCDTextAfterCommit(); |
743 } | 742 } |
744 | 743 |
745 { | 744 { |
746 TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", | 745 TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", |
747 "IsActive", IsActiveTree(), "SourceFrameNumber", | 746 "IsActive", IsActiveTree(), "SourceFrameNumber", |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 void LayerTreeImpl::SetViewportSizeInvalid() { | 866 void LayerTreeImpl::SetViewportSizeInvalid() { |
868 viewport_size_invalid_ = true; | 867 viewport_size_invalid_ = true; |
869 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | 868 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
870 } | 869 } |
871 | 870 |
872 void LayerTreeImpl::ResetViewportSizeInvalid() { | 871 void LayerTreeImpl::ResetViewportSizeInvalid() { |
873 viewport_size_invalid_ = false; | 872 viewport_size_invalid_ = false; |
874 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | 873 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
875 } | 874 } |
876 | 875 |
877 Proxy* LayerTreeImpl::proxy() const { | 876 TaskRunnerProvider* LayerTreeImpl::task_runner_provider() const { |
878 return layer_tree_host_impl_->proxy(); | 877 return layer_tree_host_impl_->task_runner_provider(); |
879 } | 878 } |
880 | 879 |
881 const LayerTreeSettings& LayerTreeImpl::settings() const { | 880 const LayerTreeSettings& LayerTreeImpl::settings() const { |
882 return layer_tree_host_impl_->settings(); | 881 return layer_tree_host_impl_->settings(); |
883 } | 882 } |
884 | 883 |
885 const LayerTreeDebugState& LayerTreeImpl::debug_state() const { | 884 const LayerTreeDebugState& LayerTreeImpl::debug_state() const { |
886 return layer_tree_host_impl_->debug_state(); | 885 return layer_tree_host_impl_->debug_state(); |
887 } | 886 } |
888 | 887 |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 } | 1706 } |
1708 | 1707 |
1709 void LayerTreeImpl::InputScrollAnimationFinished() { | 1708 void LayerTreeImpl::InputScrollAnimationFinished() { |
1710 layer_tree_host_impl_->ScrollEnd(); | 1709 layer_tree_host_impl_->ScrollEnd(); |
1711 } | 1710 } |
1712 | 1711 |
1713 bool LayerTreeImpl::SmoothnessTakesPriority() const { | 1712 bool LayerTreeImpl::SmoothnessTakesPriority() const { |
1714 return layer_tree_host_impl_->GetTreePriority() == SMOOTHNESS_TAKES_PRIORITY; | 1713 return layer_tree_host_impl_->GetTreePriority() == SMOOTHNESS_TAKES_PRIORITY; |
1715 } | 1714 } |
1716 | 1715 |
1717 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { | |
1718 return proxy()->blocking_main_thread_task_runner(); | |
1719 } | |
1720 | |
1721 VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient() | 1716 VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient() |
1722 const { | 1717 const { |
1723 return layer_tree_host_impl_; | 1718 return layer_tree_host_impl_; |
1724 } | 1719 } |
1725 | 1720 |
1726 void LayerTreeImpl::SetPendingPageScaleAnimation( | 1721 void LayerTreeImpl::SetPendingPageScaleAnimation( |
1727 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1722 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
1728 pending_page_scale_animation_ = pending_animation.Pass(); | 1723 pending_page_scale_animation_ = pending_animation.Pass(); |
1729 } | 1724 } |
1730 | 1725 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 const gfx::BoxF& box, | 1887 const gfx::BoxF& box, |
1893 gfx::BoxF* bounds) const { | 1888 gfx::BoxF* bounds) const { |
1894 *bounds = gfx::BoxF(); | 1889 *bounds = gfx::BoxF(); |
1895 return layer_tree_host_impl_->animation_host() | 1890 return layer_tree_host_impl_->animation_host() |
1896 ? layer_tree_host_impl_->animation_host() | 1891 ? layer_tree_host_impl_->animation_host() |
1897 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 1892 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
1898 : true; | 1893 : true; |
1899 } | 1894 } |
1900 | 1895 |
1901 } // namespace cc | 1896 } // namespace cc |
OLD | NEW |