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