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