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_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 client_->SetNeedsAnimateOnImplThread(); | 1771 client_->SetNeedsAnimateOnImplThread(); |
1772 } | 1772 } |
1773 | 1773 |
1774 void LayerTreeHostImpl::SetNeedsRedraw() { | 1774 void LayerTreeHostImpl::SetNeedsRedraw() { |
1775 NotifySwapPromiseMonitorsOfSetNeedsRedraw(); | 1775 NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
1776 client_->SetNeedsRedrawOnImplThread(); | 1776 client_->SetNeedsRedrawOnImplThread(); |
1777 } | 1777 } |
1778 | 1778 |
1779 ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const { | 1779 ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const { |
1780 ManagedMemoryPolicy actual = cached_managed_memory_policy_; | 1780 ManagedMemoryPolicy actual = cached_managed_memory_policy_; |
1781 // TODO(ernstm): NICE_TO_HAVE is currently triggered for forced GPU | 1781 bool any_tree_use_gpu_rasterization = |
1782 // rasterization only. Change the trigger to LTHI::UseGpuRasterization, once | 1782 (active_tree_ && active_tree_->use_gpu_rasterization()) || |
1783 // that is implemented. | 1783 (pending_tree_ && pending_tree_->use_gpu_rasterization()); |
1784 if (debug_state_.rasterize_only_visible_content) { | 1784 if (debug_state_.rasterize_only_visible_content) { |
1785 actual.priority_cutoff_when_visible = | 1785 actual.priority_cutoff_when_visible = |
1786 gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY; | 1786 gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY; |
1787 } else if (settings_.gpu_rasterization_forced) { | 1787 } else if (any_tree_use_gpu_rasterization) { |
1788 actual.priority_cutoff_when_visible = | 1788 actual.priority_cutoff_when_visible = |
1789 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; | 1789 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; |
1790 } | 1790 } |
1791 | 1791 |
1792 if (zero_budget_) { | 1792 if (zero_budget_) { |
1793 actual.bytes_limit_when_visible = 0; | 1793 actual.bytes_limit_when_visible = 0; |
1794 } | 1794 } |
1795 | 1795 |
1796 return actual; | 1796 return actual; |
1797 } | 1797 } |
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3134 swap_promise_monitor_.erase(monitor); | 3134 swap_promise_monitor_.erase(monitor); |
3135 } | 3135 } |
3136 | 3136 |
3137 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3137 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
3138 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3138 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
3139 for (; it != swap_promise_monitor_.end(); it++) | 3139 for (; it != swap_promise_monitor_.end(); it++) |
3140 (*it)->OnSetNeedsRedrawOnImpl(); | 3140 (*it)->OnSetNeedsRedrawOnImpl(); |
3141 } | 3141 } |
3142 | 3142 |
3143 } // namespace cc | 3143 } // namespace cc |
OLD | NEW |