| 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 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 client_->OnCanDrawStateChanged(CanDraw()); | 852 client_->OnCanDrawStateChanged(CanDraw()); |
| 853 client_->RenewTreePriority(); | 853 client_->RenewTreePriority(); |
| 854 } | 854 } |
| 855 client_->SendManagedMemoryStats(); | 855 client_->SendManagedMemoryStats(); |
| 856 | 856 |
| 857 if (tile_manager_) { | 857 if (tile_manager_) { |
| 858 GlobalStateThatImpactsTilePriority new_state(tile_manager_->GlobalState()); | 858 GlobalStateThatImpactsTilePriority new_state(tile_manager_->GlobalState()); |
| 859 new_state.memory_limit_in_bytes = visible_ ? | 859 new_state.memory_limit_in_bytes = visible_ ? |
| 860 policy.bytes_limit_when_visible : | 860 policy.bytes_limit_when_visible : |
| 861 policy.bytes_limit_when_not_visible; | 861 policy.bytes_limit_when_not_visible; |
| 862 // TODO(reveman): We should avoid keeping around unused resources if |
| 863 // possible. crbug.com/224475 |
| 864 new_state.unused_memory_limit_in_bytes = |
| 865 (new_state.memory_limit_in_bytes * |
| 866 settings_.max_unused_resource_memory_percentage) / 100; |
| 862 new_state.memory_limit_policy = | 867 new_state.memory_limit_policy = |
| 863 ManagedMemoryPolicy::PriorityCutoffToTileMemoryLimitPolicy( | 868 ManagedMemoryPolicy::PriorityCutoffToTileMemoryLimitPolicy( |
| 864 visible_ ? | 869 visible_ ? |
| 865 policy.priority_cutoff_when_visible : | 870 policy.priority_cutoff_when_visible : |
| 866 policy.priority_cutoff_when_not_visible); | 871 policy.priority_cutoff_when_not_visible); |
| 867 tile_manager_->SetGlobalState(new_state); | 872 tile_manager_->SetGlobalState(new_state); |
| 868 } | 873 } |
| 869 } | 874 } |
| 870 | 875 |
| 871 bool LayerTreeHostImpl::HasImplThread() const { | 876 bool LayerTreeHostImpl::HasImplThread() const { |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2037 } | 2042 } |
| 2038 | 2043 |
| 2039 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2044 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
| 2040 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2045 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
| 2041 paint_time_counter_->ClearHistory(); | 2046 paint_time_counter_->ClearHistory(); |
| 2042 | 2047 |
| 2043 debug_state_ = debug_state; | 2048 debug_state_ = debug_state; |
| 2044 } | 2049 } |
| 2045 | 2050 |
| 2046 } // namespace cc | 2051 } // namespace cc |
| OLD | NEW |