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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1386 resource_provider.get()); | 1386 resource_provider.get()); |
1387 } else if (output_surface->context3d()) { | 1387 } else if (output_surface->context3d()) { |
1388 renderer_ = GLRenderer::Create(this, | 1388 renderer_ = GLRenderer::Create(this, |
1389 output_surface.get(), | 1389 output_surface.get(), |
1390 resource_provider.get(), | 1390 resource_provider.get(), |
1391 settings_.highp_threshold_min); | 1391 settings_.highp_threshold_min); |
1392 } else if (output_surface->software_device()) { | 1392 } else if (output_surface->software_device()) { |
1393 renderer_ = SoftwareRenderer::Create(this, | 1393 renderer_ = SoftwareRenderer::Create(this, |
1394 output_surface.get(), | 1394 output_surface.get(), |
1395 resource_provider.get()); | 1395 resource_provider.get()); |
1396 | |
1397 const size_t software_memory_limit_when_visible = 128 * 1024 * 1024; | |
1398 const size_t software_memory_limit_when_not_visible = 64 * 1024 * 1024; | |
1399 SetManagedMemoryPolicy(ManagedMemoryPolicy( | |
1400 software_memory_limit_when_visible, | |
1401 ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING, | |
1402 software_memory_limit_when_not_visible, | |
1403 ManagedMemoryPolicy::CUTOFF_ALLOW_REQUIRED_ONLY)); | |
ccameron
2013/04/29 23:58:46
I'd suggest 0 and NOTHING for non-visible tabs (ca
| |
1396 } | 1404 } |
1397 if (!renderer_) | 1405 if (!renderer_) |
1398 return false; | 1406 return false; |
1399 | 1407 |
1400 resource_provider_ = resource_provider.Pass(); | 1408 resource_provider_ = resource_provider.Pass(); |
1401 output_surface_ = output_surface.Pass(); | 1409 output_surface_ = output_surface.Pass(); |
1402 | 1410 |
1403 if (!visible_) | 1411 if (!visible_) |
1404 renderer_->SetVisible(visible_); | 1412 renderer_->SetVisible(visible_); |
1405 | 1413 |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2137 } | 2145 } |
2138 | 2146 |
2139 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2147 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
2140 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2148 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
2141 paint_time_counter_->ClearHistory(); | 2149 paint_time_counter_->ClearHistory(); |
2142 | 2150 |
2143 debug_state_ = debug_state; | 2151 debug_state_ = debug_state; |
2144 } | 2152 } |
2145 | 2153 |
2146 } // namespace cc | 2154 } // namespace cc |
OLD | NEW |