| 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 <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 6266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6277 gpu_memory_buffer_manager_.get(), | 6277 gpu_memory_buffer_manager_.get(), |
| 6278 0); | 6278 0); |
| 6279 | 6279 |
| 6280 scoped_ptr<OutputSurface> output_surface( | 6280 scoped_ptr<OutputSurface> output_surface( |
| 6281 FakeOutputSurface::Create3d(TestWebGraphicsContext3D::Create())); | 6281 FakeOutputSurface::Create3d(TestWebGraphicsContext3D::Create())); |
| 6282 host_impl_->InitializeRenderer(output_surface.Pass()); | 6282 host_impl_->InitializeRenderer(output_surface.Pass()); |
| 6283 EXPECT_LT(0ul, host_impl_->memory_allocation_limit_bytes()); | 6283 EXPECT_LT(0ul, host_impl_->memory_allocation_limit_bytes()); |
| 6284 } | 6284 } |
| 6285 | 6285 |
| 6286 TEST_F(LayerTreeHostImplTest, MemoryPolicy) { | 6286 TEST_F(LayerTreeHostImplTest, MemoryPolicy) { |
| 6287 ManagedMemoryPolicy policy1( | 6287 ManagedMemoryPolicy policy1(456, |
| 6288 456, gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, 1000); | 6288 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING); |
| 6289 int everything_cutoff_value = ManagedMemoryPolicy::PriorityCutoffToValue( | 6289 int everything_cutoff_value = ManagedMemoryPolicy::PriorityCutoffToValue( |
| 6290 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING); | 6290 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING); |
| 6291 int allow_nice_to_have_cutoff_value = | 6291 int allow_nice_to_have_cutoff_value = |
| 6292 ManagedMemoryPolicy::PriorityCutoffToValue( | 6292 ManagedMemoryPolicy::PriorityCutoffToValue( |
| 6293 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE); | 6293 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE); |
| 6294 int nothing_cutoff_value = ManagedMemoryPolicy::PriorityCutoffToValue( | 6294 int nothing_cutoff_value = ManagedMemoryPolicy::PriorityCutoffToValue( |
| 6295 gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING); | 6295 gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING); |
| 6296 | 6296 |
| 6297 // GPU rasterization should be disabled by default on the tree(s) | 6297 // GPU rasterization should be disabled by default on the tree(s) |
| 6298 EXPECT_FALSE(host_impl_->active_tree()->use_gpu_rasterization()); | 6298 EXPECT_FALSE(host_impl_->active_tree()->use_gpu_rasterization()); |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7570 // surface. | 7570 // surface. |
| 7571 EXPECT_EQ(0, num_lost_surfaces_); | 7571 EXPECT_EQ(0, num_lost_surfaces_); |
| 7572 host_impl_->DidLoseOutputSurface(); | 7572 host_impl_->DidLoseOutputSurface(); |
| 7573 EXPECT_EQ(1, num_lost_surfaces_); | 7573 EXPECT_EQ(1, num_lost_surfaces_); |
| 7574 host_impl_->DidLoseOutputSurface(); | 7574 host_impl_->DidLoseOutputSurface(); |
| 7575 EXPECT_LE(1, num_lost_surfaces_); | 7575 EXPECT_LE(1, num_lost_surfaces_); |
| 7576 } | 7576 } |
| 7577 | 7577 |
| 7578 } // namespace | 7578 } // namespace |
| 7579 } // namespace cc | 7579 } // namespace cc |
| OLD | NEW |