| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 delegating_output_surface->SetEnlargePassTextureAmount( | 62 delegating_output_surface->SetEnlargePassTextureAmount( |
| 63 enlarge_texture_amount_); | 63 enlarge_texture_amount_); |
| 64 return delegating_output_surface; | 64 return delegating_output_surface; |
| 65 } | 65 } |
| 66 | 66 |
| 67 std::unique_ptr<OutputSurface> | 67 std::unique_ptr<OutputSurface> |
| 68 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread( | 68 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread( |
| 69 scoped_refptr<ContextProvider> compositor_context_provider) { | 69 scoped_refptr<ContextProvider> compositor_context_provider) { |
| 70 std::unique_ptr<PixelTestOutputSurface> display_output_surface; | 70 std::unique_ptr<PixelTestOutputSurface> display_output_surface; |
| 71 if (test_type_ == PIXEL_TEST_GL) { | 71 if (test_type_ == PIXEL_TEST_GL) { |
| 72 // Pixel tests use a separate context for the Display to more closely |
| 73 // mimic texture transport from the renderer process to the Display |
| 74 // compositor. |
| 75 auto display_context_provider = |
| 76 make_scoped_refptr(new TestInProcessContextProvider(nullptr)); |
| 77 display_context_provider->BindToCurrentThread(); |
| 78 |
| 72 bool flipped_output_surface = false; | 79 bool flipped_output_surface = false; |
| 73 display_output_surface = base::MakeUnique<PixelTestOutputSurface>( | 80 display_output_surface = base::MakeUnique<PixelTestOutputSurface>( |
| 74 // Pixel tests use a separate context for the Display to more closely | 81 std::move(display_context_provider), flipped_output_surface); |
| 75 // mimic texture transport from the renderer process to the Display | |
| 76 // compositor. | |
| 77 make_scoped_refptr(new TestInProcessContextProvider(nullptr)), | |
| 78 flipped_output_surface); | |
| 79 } else { | 82 } else { |
| 80 display_output_surface = base::MakeUnique<PixelTestOutputSurface>( | 83 display_output_surface = base::MakeUnique<PixelTestOutputSurface>( |
| 81 base::MakeUnique<SoftwareOutputDevice>()); | 84 base::MakeUnique<SoftwareOutputDevice>()); |
| 82 } | 85 } |
| 83 return std::move(display_output_surface); | 86 return std::move(display_output_surface); |
| 84 } | 87 } |
| 85 | 88 |
| 86 std::unique_ptr<CopyOutputRequest> | 89 std::unique_ptr<CopyOutputRequest> |
| 87 LayerTreePixelTest::CreateCopyOutputRequest() { | 90 LayerTreePixelTest::CreateCopyOutputRequest() { |
| 88 return CopyOutputRequest::CreateBitmapRequest( | 91 return CopyOutputRequest::CreateBitmapRequest( |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 285 } |
| 283 | 286 |
| 284 void LayerTreePixelTest::Finish() { | 287 void LayerTreePixelTest::Finish() { |
| 285 std::unique_ptr<gpu::GLInProcessContext> context = | 288 std::unique_ptr<gpu::GLInProcessContext> context = |
| 286 CreateTestInProcessContext(); | 289 CreateTestInProcessContext(); |
| 287 GLES2Interface* gl = context->GetImplementation(); | 290 GLES2Interface* gl = context->GetImplementation(); |
| 288 gl->Finish(); | 291 gl->Finish(); |
| 289 } | 292 } |
| 290 | 293 |
| 291 } // namespace cc | 294 } // namespace cc |
| OLD | NEW |