| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test/layer_tree_pixel_test.h" | 5 #include "cc/test/layer_tree_pixel_test.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 scoped_refptr<TestInProcessContextProvider> compositor_context_provider; | 45 scoped_refptr<TestInProcessContextProvider> compositor_context_provider; |
| 46 scoped_refptr<TestInProcessContextProvider> worker_context_provider; | 46 scoped_refptr<TestInProcessContextProvider> worker_context_provider; |
| 47 if (test_type_ == PIXEL_TEST_GL) { | 47 if (test_type_ == PIXEL_TEST_GL) { |
| 48 compositor_context_provider = new TestInProcessContextProvider(nullptr); | 48 compositor_context_provider = new TestInProcessContextProvider(nullptr); |
| 49 worker_context_provider = | 49 worker_context_provider = |
| 50 new TestInProcessContextProvider(compositor_context_provider.get()); | 50 new TestInProcessContextProvider(compositor_context_provider.get()); |
| 51 } | 51 } |
| 52 bool synchronous_composite = | 52 bool synchronous_composite = |
| 53 !HasImplThread() && | 53 !HasImplThread() && |
| 54 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; | 54 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; |
| 55 // Allow resource reclaiming for partial raster tests to get back |
| 56 // resources from the Display. |
| 57 bool force_disable_reclaim_resources = false; |
| 55 auto delegating_output_surface = base::MakeUnique<TestCompositorFrameSink>( | 58 auto delegating_output_surface = base::MakeUnique<TestCompositorFrameSink>( |
| 56 compositor_context_provider, std::move(worker_context_provider), | 59 compositor_context_provider, std::move(worker_context_provider), |
| 57 shared_bitmap_manager(), gpu_memory_buffer_manager(), RendererSettings(), | 60 shared_bitmap_manager(), gpu_memory_buffer_manager(), RendererSettings(), |
| 58 ImplThreadTaskRunner(), synchronous_composite); | 61 ImplThreadTaskRunner(), synchronous_composite, |
| 62 force_disable_reclaim_resources); |
| 59 delegating_output_surface->SetEnlargePassTextureAmount( | 63 delegating_output_surface->SetEnlargePassTextureAmount( |
| 60 enlarge_texture_amount_); | 64 enlarge_texture_amount_); |
| 61 return delegating_output_surface; | 65 return delegating_output_surface; |
| 62 } | 66 } |
| 63 | 67 |
| 64 std::unique_ptr<OutputSurface> | 68 std::unique_ptr<OutputSurface> |
| 65 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread( | 69 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread( |
| 66 scoped_refptr<ContextProvider> compositor_context_provider) { | 70 scoped_refptr<ContextProvider> compositor_context_provider) { |
| 67 std::unique_ptr<PixelTestOutputSurface> display_output_surface; | 71 std::unique_ptr<PixelTestOutputSurface> display_output_surface; |
| 68 if (test_type_ == PIXEL_TEST_GL) { | 72 if (test_type_ == PIXEL_TEST_GL) { |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 286 } |
| 283 | 287 |
| 284 void LayerTreePixelTest::Finish() { | 288 void LayerTreePixelTest::Finish() { |
| 285 std::unique_ptr<gpu::GLInProcessContext> context = | 289 std::unique_ptr<gpu::GLInProcessContext> context = |
| 286 CreateTestInProcessContext(); | 290 CreateTestInProcessContext(); |
| 287 GLES2Interface* gl = context->GetImplementation(); | 291 GLES2Interface* gl = context->GetImplementation(); |
| 288 gl->Finish(); | 292 gl->Finish(); |
| 289 } | 293 } |
| 290 | 294 |
| 291 } // namespace cc | 295 } // namespace cc |
| OLD | NEW |