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; | |
58 auto delegating_output_surface = base::MakeUnique<TestCompositorFrameSink>( | 55 auto delegating_output_surface = base::MakeUnique<TestCompositorFrameSink>( |
59 compositor_context_provider, std::move(worker_context_provider), | 56 compositor_context_provider, std::move(worker_context_provider), |
60 shared_bitmap_manager(), gpu_memory_buffer_manager(), RendererSettings(), | 57 shared_bitmap_manager(), gpu_memory_buffer_manager(), RendererSettings(), |
61 ImplThreadTaskRunner(), synchronous_composite, | 58 ImplThreadTaskRunner(), synchronous_composite); |
62 force_disable_reclaim_resources); | |
63 delegating_output_surface->SetEnlargePassTextureAmount( | 59 delegating_output_surface->SetEnlargePassTextureAmount( |
64 enlarge_texture_amount_); | 60 enlarge_texture_amount_); |
65 return delegating_output_surface; | 61 return delegating_output_surface; |
66 } | 62 } |
67 | 63 |
68 std::unique_ptr<OutputSurface> | 64 std::unique_ptr<OutputSurface> |
69 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread( | 65 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread( |
70 scoped_refptr<ContextProvider> compositor_context_provider) { | 66 scoped_refptr<ContextProvider> compositor_context_provider) { |
71 std::unique_ptr<PixelTestOutputSurface> display_output_surface; | 67 std::unique_ptr<PixelTestOutputSurface> display_output_surface; |
72 if (test_type_ == PIXEL_TEST_GL) { | 68 if (test_type_ == PIXEL_TEST_GL) { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 } | 282 } |
287 | 283 |
288 void LayerTreePixelTest::Finish() { | 284 void LayerTreePixelTest::Finish() { |
289 std::unique_ptr<gpu::GLInProcessContext> context = | 285 std::unique_ptr<gpu::GLInProcessContext> context = |
290 CreateTestInProcessContext(); | 286 CreateTestInProcessContext(); |
291 GLES2Interface* gl = context->GetImplementation(); | 287 GLES2Interface* gl = context->GetImplementation(); |
292 gl->Finish(); | 288 gl->Finish(); |
293 } | 289 } |
294 | 290 |
295 } // namespace cc | 291 } // namespace cc |
OLD | NEW |