Chromium Code Reviews| 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 24 matching lines...) Expand all Loading... | |
| 35 : pixel_comparator_(new ExactPixelComparator(true)), | 35 : pixel_comparator_(new ExactPixelComparator(true)), |
| 36 test_type_(PIXEL_TEST_GL), | 36 test_type_(PIXEL_TEST_GL), |
| 37 pending_texture_mailbox_callbacks_(0) {} | 37 pending_texture_mailbox_callbacks_(0) {} |
| 38 | 38 |
| 39 LayerTreePixelTest::~LayerTreePixelTest() {} | 39 LayerTreePixelTest::~LayerTreePixelTest() {} |
| 40 | 40 |
| 41 std::unique_ptr<TestCompositorFrameSink> | 41 std::unique_ptr<TestCompositorFrameSink> |
| 42 LayerTreePixelTest::CreateCompositorFrameSink( | 42 LayerTreePixelTest::CreateCompositorFrameSink( |
| 43 scoped_refptr<ContextProvider>, | 43 scoped_refptr<ContextProvider>, |
| 44 scoped_refptr<ContextProvider>) { | 44 scoped_refptr<ContextProvider>) { |
| 45 constexpr bool kDisableDisplayVsync = false; | |
|
danakj
2017/05/04 15:36:35
can you put this beside where its used, like synch
Alex Z.
2017/05/04 18:41:55
Done.
| |
| 45 scoped_refptr<TestInProcessContextProvider> compositor_context_provider; | 46 scoped_refptr<TestInProcessContextProvider> compositor_context_provider; |
| 46 scoped_refptr<TestInProcessContextProvider> worker_context_provider; | 47 scoped_refptr<TestInProcessContextProvider> worker_context_provider; |
| 47 if (test_type_ == PIXEL_TEST_GL) { | 48 if (test_type_ == PIXEL_TEST_GL) { |
| 48 compositor_context_provider = new TestInProcessContextProvider(nullptr); | 49 compositor_context_provider = new TestInProcessContextProvider(nullptr); |
| 49 worker_context_provider = | 50 worker_context_provider = |
| 50 new TestInProcessContextProvider(compositor_context_provider.get()); | 51 new TestInProcessContextProvider(compositor_context_provider.get()); |
| 51 } | 52 } |
| 52 bool synchronous_composite = | 53 bool synchronous_composite = |
| 53 !HasImplThread() && | 54 !HasImplThread() && |
| 54 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; | 55 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; |
| 55 auto delegating_output_surface = base::MakeUnique<TestCompositorFrameSink>( | 56 auto delegating_output_surface = base::MakeUnique<TestCompositorFrameSink>( |
| 56 compositor_context_provider, std::move(worker_context_provider), | 57 compositor_context_provider, std::move(worker_context_provider), |
| 57 shared_bitmap_manager(), gpu_memory_buffer_manager(), RendererSettings(), | 58 shared_bitmap_manager(), gpu_memory_buffer_manager(), RendererSettings(), |
| 58 ImplThreadTaskRunner(), synchronous_composite); | 59 ImplThreadTaskRunner(), synchronous_composite, kDisableDisplayVsync); |
| 59 delegating_output_surface->SetEnlargePassTextureAmount( | 60 delegating_output_surface->SetEnlargePassTextureAmount( |
| 60 enlarge_texture_amount_); | 61 enlarge_texture_amount_); |
| 61 return delegating_output_surface; | 62 return delegating_output_surface; |
| 62 } | 63 } |
| 63 | 64 |
| 64 std::unique_ptr<OutputSurface> | 65 std::unique_ptr<OutputSurface> |
| 65 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread( | 66 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread( |
| 66 scoped_refptr<ContextProvider> compositor_context_provider) { | 67 scoped_refptr<ContextProvider> compositor_context_provider) { |
| 67 std::unique_ptr<PixelTestOutputSurface> display_output_surface; | 68 std::unique_ptr<PixelTestOutputSurface> display_output_surface; |
| 68 if (test_type_ == PIXEL_TEST_GL) { | 69 if (test_type_ == PIXEL_TEST_GL) { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 } | 287 } |
| 287 | 288 |
| 288 void LayerTreePixelTest::Finish() { | 289 void LayerTreePixelTest::Finish() { |
| 289 std::unique_ptr<gpu::GLInProcessContext> context = | 290 std::unique_ptr<gpu::GLInProcessContext> context = |
| 290 CreateTestInProcessContext(); | 291 CreateTestInProcessContext(); |
| 291 GLES2Interface* gl = context->GetImplementation(); | 292 GLES2Interface* gl = context->GetImplementation(); |
| 292 gl->Finish(); | 293 gl->Finish(); |
| 293 } | 294 } |
| 294 | 295 |
| 295 } // namespace cc | 296 } // namespace cc |
| OLD | NEW |