| 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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 } | 725 } |
| 726 | 726 |
| 727 // It'd be ideal if this could be done earlier, but when the raster source | 727 // It'd be ideal if this could be done earlier, but when the raster source |
| 728 // is updated from the main thread during push properties, update draw | 728 // is updated from the main thread during push properties, update draw |
| 729 // properties has not occurred yet and so it's not clear whether or not the | 729 // properties has not occurred yet and so it's not clear whether or not the |
| 730 // layer can or cannot use lcd text. So, this is the cleanup pass to | 730 // layer can or cannot use lcd text. So, this is the cleanup pass to |
| 731 // determine if the raster source needs to be replaced with a non-lcd | 731 // determine if the raster source needs to be replaced with a non-lcd |
| 732 // raster source due to draw properties. | 732 // raster source due to draw properties. |
| 733 if (update_lcd_text) { | 733 if (update_lcd_text) { |
| 734 // TODO(enne): Make LTHI::sync_tree return this value. | 734 // TODO(enne): Make LTHI::sync_tree return this value. |
| 735 LayerTreeImpl* sync_tree = | 735 LayerTreeImpl* sync_tree = layer_tree_host_impl_->CommitToActiveTree() |
| 736 layer_tree_host_impl_->proxy()->CommitToActiveTree() | 736 ? layer_tree_host_impl_->active_tree() |
| 737 ? layer_tree_host_impl_->active_tree() | 737 : layer_tree_host_impl_->pending_tree(); |
| 738 : layer_tree_host_impl_->pending_tree(); | |
| 739 // If this is not the sync tree, then it is not safe to update lcd text | 738 // If this is not the sync tree, then it is not safe to update lcd text |
| 740 // as it causes invalidations and the tiles may be in use. | 739 // as it causes invalidations and the tiles may be in use. |
| 741 DCHECK_EQ(this, sync_tree); | 740 DCHECK_EQ(this, sync_tree); |
| 742 for (const auto& layer : picture_layers_) | 741 for (const auto& layer : picture_layers_) |
| 743 layer->UpdateCanUseLCDTextAfterCommit(); | 742 layer->UpdateCanUseLCDTextAfterCommit(); |
| 744 } | 743 } |
| 745 | 744 |
| 746 { | 745 { |
| 747 TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", | 746 TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", |
| 748 "IsActive", IsActiveTree(), "SourceFrameNumber", | 747 "IsActive", IsActiveTree(), "SourceFrameNumber", |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 void LayerTreeImpl::SetViewportSizeInvalid() { | 867 void LayerTreeImpl::SetViewportSizeInvalid() { |
| 869 viewport_size_invalid_ = true; | 868 viewport_size_invalid_ = true; |
| 870 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | 869 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
| 871 } | 870 } |
| 872 | 871 |
| 873 void LayerTreeImpl::ResetViewportSizeInvalid() { | 872 void LayerTreeImpl::ResetViewportSizeInvalid() { |
| 874 viewport_size_invalid_ = false; | 873 viewport_size_invalid_ = false; |
| 875 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); | 874 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
| 876 } | 875 } |
| 877 | 876 |
| 878 Proxy* LayerTreeImpl::proxy() const { | 877 ThreadVerifier* LayerTreeImpl::thread_verifier() const { |
| 879 return layer_tree_host_impl_->proxy(); | 878 return layer_tree_host_impl_->thread_verifier(); |
| 880 } | 879 } |
| 881 | 880 |
| 882 const LayerTreeSettings& LayerTreeImpl::settings() const { | 881 const LayerTreeSettings& LayerTreeImpl::settings() const { |
| 883 return layer_tree_host_impl_->settings(); | 882 return layer_tree_host_impl_->settings(); |
| 884 } | 883 } |
| 885 | 884 |
| 886 const LayerTreeDebugState& LayerTreeImpl::debug_state() const { | 885 const LayerTreeDebugState& LayerTreeImpl::debug_state() const { |
| 887 return layer_tree_host_impl_->debug_state(); | 886 return layer_tree_host_impl_->debug_state(); |
| 888 } | 887 } |
| 889 | 888 |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 | 1649 |
| 1651 void LayerTreeImpl::InputScrollAnimationFinished() { | 1650 void LayerTreeImpl::InputScrollAnimationFinished() { |
| 1652 layer_tree_host_impl_->ScrollEnd(); | 1651 layer_tree_host_impl_->ScrollEnd(); |
| 1653 } | 1652 } |
| 1654 | 1653 |
| 1655 bool LayerTreeImpl::SmoothnessTakesPriority() const { | 1654 bool LayerTreeImpl::SmoothnessTakesPriority() const { |
| 1656 return layer_tree_host_impl_->GetTreePriority() == SMOOTHNESS_TAKES_PRIORITY; | 1655 return layer_tree_host_impl_->GetTreePriority() == SMOOTHNESS_TAKES_PRIORITY; |
| 1657 } | 1656 } |
| 1658 | 1657 |
| 1659 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { | 1658 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { |
| 1660 return proxy()->blocking_main_thread_task_runner(); | 1659 return thread_verifier()->blocking_main_thread_task_runner(); |
| 1661 } | 1660 } |
| 1662 | 1661 |
| 1663 VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient() | 1662 VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient() |
| 1664 const { | 1663 const { |
| 1665 return layer_tree_host_impl_; | 1664 return layer_tree_host_impl_; |
| 1666 } | 1665 } |
| 1667 | 1666 |
| 1668 void LayerTreeImpl::SetPendingPageScaleAnimation( | 1667 void LayerTreeImpl::SetPendingPageScaleAnimation( |
| 1669 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1668 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
| 1670 pending_page_scale_animation_ = pending_animation.Pass(); | 1669 pending_page_scale_animation_ = pending_animation.Pass(); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1834 const gfx::BoxF& box, | 1833 const gfx::BoxF& box, |
| 1835 gfx::BoxF* bounds) const { | 1834 gfx::BoxF* bounds) const { |
| 1836 *bounds = gfx::BoxF(); | 1835 *bounds = gfx::BoxF(); |
| 1837 return layer_tree_host_impl_->animation_host() | 1836 return layer_tree_host_impl_->animation_host() |
| 1838 ? layer_tree_host_impl_->animation_host() | 1837 ? layer_tree_host_impl_->animation_host() |
| 1839 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 1838 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
| 1840 : true; | 1839 : true; |
| 1841 } | 1840 } |
| 1842 | 1841 |
| 1843 } // namespace cc | 1842 } // namespace cc |
| OLD | NEW |