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 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1640 renderer_->SetVisible(visible); | 1640 renderer_->SetVisible(visible); |
1641 } | 1641 } |
1642 | 1642 |
1643 void LayerTreeHostImpl::SetNeedsRedraw() { | 1643 void LayerTreeHostImpl::SetNeedsRedraw() { |
1644 NotifySwapPromiseMonitorsOfSetNeedsRedraw(); | 1644 NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
1645 client_->SetNeedsRedrawOnImplThread(); | 1645 client_->SetNeedsRedrawOnImplThread(); |
1646 } | 1646 } |
1647 | 1647 |
1648 ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const { | 1648 ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const { |
1649 ManagedMemoryPolicy actual = cached_managed_memory_policy_; | 1649 ManagedMemoryPolicy actual = cached_managed_memory_policy_; |
1650 if (debug_state_.rasterize_only_visible_content) { | 1650 // TODO(ernstm): The second condition disables pre-painting for all layers |
| 1651 // when GPU rasterization is enabled. Once we selectively enable GPU |
| 1652 // rasterization per layer, we also need to disable pre-painting selectively: |
| 1653 // crbug.com/335387 |
| 1654 if (debug_state_.rasterize_only_visible_content || |
| 1655 settings_.gpu_rasterization) { |
1651 actual.priority_cutoff_when_visible = | 1656 actual.priority_cutoff_when_visible = |
1652 gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY; | 1657 gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY; |
1653 } | 1658 } |
1654 | 1659 |
1655 if (zero_budget_) { | 1660 if (zero_budget_) { |
1656 actual.bytes_limit_when_visible = 0; | 1661 actual.bytes_limit_when_visible = 0; |
1657 } | 1662 } |
1658 | 1663 |
1659 return actual; | 1664 return actual; |
1660 } | 1665 } |
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2907 swap_promise_monitor_.erase(monitor); | 2912 swap_promise_monitor_.erase(monitor); |
2908 } | 2913 } |
2909 | 2914 |
2910 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 2915 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
2911 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 2916 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
2912 for (; it != swap_promise_monitor_.end(); it++) | 2917 for (; it != swap_promise_monitor_.end(); it++) |
2913 (*it)->OnSetNeedsRedrawOnImpl(); | 2918 (*it)->OnSetNeedsRedrawOnImpl(); |
2914 } | 2919 } |
2915 | 2920 |
2916 } // namespace cc | 2921 } // namespace cc |
OLD | NEW |