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/pixel_test.h" | 5 #include "cc/test/pixel_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "cc/base/switches.h" | 11 #include "cc/base/switches.h" |
12 #include "cc/output/compositor_frame_metadata.h" | 12 #include "cc/output/compositor_frame_metadata.h" |
13 #include "cc/output/copy_output_request.h" | 13 #include "cc/output/copy_output_request.h" |
14 #include "cc/output/copy_output_result.h" | 14 #include "cc/output/copy_output_result.h" |
15 #include "cc/output/gl_renderer.h" | 15 #include "cc/output/gl_renderer.h" |
16 #include "cc/output/output_surface_client.h" | 16 #include "cc/output/output_surface_client.h" |
17 #include "cc/output/software_renderer.h" | 17 #include "cc/output/software_renderer.h" |
18 #include "cc/resources/raster_worker_pool.h" | 18 #include "cc/resources/raster_worker_pool.h" |
19 #include "cc/resources/resource_provider.h" | 19 #include "cc/resources/resource_provider.h" |
20 #include "cc/resources/texture_mailbox_deleter.h" | 20 #include "cc/resources/texture_mailbox_deleter.h" |
21 #include "cc/test/fake_output_surface_client.h" | 21 #include "cc/test/fake_output_surface_client.h" |
22 #include "cc/test/paths.h" | 22 #include "cc/test/paths.h" |
23 #include "cc/test/pixel_test_output_surface.h" | 23 #include "cc/test/pixel_test_output_surface.h" |
24 #include "cc/test/pixel_test_software_output_device.h" | 24 #include "cc/test/pixel_test_software_output_device.h" |
25 #include "cc/test/pixel_test_utils.h" | 25 #include "cc/test/pixel_test_utils.h" |
| 26 #include "cc/test/test_gpu_memory_buffer_manager.h" |
26 #include "cc/test/test_in_process_context_provider.h" | 27 #include "cc/test/test_in_process_context_provider.h" |
27 #include "cc/test/test_shared_bitmap_manager.h" | 28 #include "cc/test/test_shared_bitmap_manager.h" |
28 #include "cc/trees/blocking_task_runner.h" | 29 #include "cc/trees/blocking_task_runner.h" |
29 #include "gpu/command_buffer/client/gles2_interface.h" | 30 #include "gpu/command_buffer/client/gles2_interface.h" |
30 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
31 | 32 |
32 namespace cc { | 33 namespace cc { |
33 | 34 |
34 PixelTest::PixelTest() | 35 PixelTest::PixelTest() |
35 : device_viewport_size_(gfx::Size(200, 200)), | 36 : device_viewport_size_(gfx::Size(200, 200)), |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 *result_bitmap_, test_data_dir.Append(ref_file), comparator); | 108 *result_bitmap_, test_data_dir.Append(ref_file), comparator); |
108 } | 109 } |
109 | 110 |
110 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) { | 111 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) { |
111 enable_pixel_output_.reset(new gfx::DisableNullDrawGLBindings); | 112 enable_pixel_output_.reset(new gfx::DisableNullDrawGLBindings); |
112 | 113 |
113 output_surface_.reset( | 114 output_surface_.reset( |
114 new PixelTestOutputSurface(new TestInProcessContextProvider)); | 115 new PixelTestOutputSurface(new TestInProcessContextProvider)); |
115 output_surface_->BindToClient(output_surface_client_.get()); | 116 output_surface_->BindToClient(output_surface_client_.get()); |
116 | 117 |
117 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); | 118 shared_bitmap_manager_.reset(new TestSharedBitmapManager); |
118 resource_provider_ = ResourceProvider::Create(output_surface_.get(), | 119 gpu_memory_buffer_manager_.reset(new TestGpuMemoryBufferManager); |
119 shared_bitmap_manager_.get(), | 120 resource_provider_ = |
120 main_thread_task_runner_.get(), | 121 ResourceProvider::Create(output_surface_.get(), |
121 0, | 122 shared_bitmap_manager_.get(), |
122 false, | 123 gpu_memory_buffer_manager_.get(), |
123 1, | 124 main_thread_task_runner_.get(), |
124 false); | 125 0, |
| 126 false, |
| 127 1, |
| 128 false); |
125 | 129 |
126 texture_mailbox_deleter_ = make_scoped_ptr( | 130 texture_mailbox_deleter_ = make_scoped_ptr( |
127 new TextureMailboxDeleter(base::MessageLoopProxy::current())); | 131 new TextureMailboxDeleter(base::MessageLoopProxy::current())); |
128 | 132 |
129 renderer_ = GLRenderer::Create(this, | 133 renderer_ = GLRenderer::Create(this, |
130 &settings_, | 134 &settings_, |
131 output_surface_.get(), | 135 output_surface_.get(), |
132 resource_provider_.get(), | 136 resource_provider_.get(), |
133 texture_mailbox_deleter_.get(), | 137 texture_mailbox_deleter_.get(), |
134 0); | 138 0); |
(...skipping 20 matching lines...) Expand all Loading... |
155 void PixelTest::EnableExternalStencilTest() { | 159 void PixelTest::EnableExternalStencilTest() { |
156 static_cast<PixelTestOutputSurface*>(output_surface_.get()) | 160 static_cast<PixelTestOutputSurface*>(output_surface_.get()) |
157 ->set_has_external_stencil_test(true); | 161 ->set_has_external_stencil_test(true); |
158 } | 162 } |
159 | 163 |
160 void PixelTest::SetUpSoftwareRenderer() { | 164 void PixelTest::SetUpSoftwareRenderer() { |
161 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice()); | 165 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice()); |
162 output_surface_.reset(new PixelTestOutputSurface(device.Pass())); | 166 output_surface_.reset(new PixelTestOutputSurface(device.Pass())); |
163 output_surface_->BindToClient(output_surface_client_.get()); | 167 output_surface_->BindToClient(output_surface_client_.get()); |
164 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); | 168 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); |
165 resource_provider_ = ResourceProvider::Create(output_surface_.get(), | 169 resource_provider_ = |
166 shared_bitmap_manager_.get(), | 170 ResourceProvider::Create(output_surface_.get(), |
167 main_thread_task_runner_.get(), | 171 shared_bitmap_manager_.get(), |
168 0, | 172 gpu_memory_buffer_manager_.get(), |
169 false, | 173 main_thread_task_runner_.get(), |
170 1, | 174 0, |
171 false); | 175 false, |
| 176 1, |
| 177 false); |
172 renderer_ = SoftwareRenderer::Create( | 178 renderer_ = SoftwareRenderer::Create( |
173 this, &settings_, output_surface_.get(), resource_provider_.get()); | 179 this, &settings_, output_surface_.get(), resource_provider_.get()); |
174 } | 180 } |
175 | 181 |
176 } // namespace cc | 182 } // namespace cc |
OLD | NEW |