OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_resource_test.h" | 5 #include "cc/test/layer_tree_pixel_resource_test.h" |
6 | 6 |
7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
8 #include "cc/resources/bitmap_tile_task_worker_pool.h" | 8 #include "cc/resources/bitmap_tile_task_worker_pool.h" |
9 #include "cc/resources/gpu_rasterizer.h" | 9 #include "cc/resources/gpu_rasterizer.h" |
10 #include "cc/resources/gpu_tile_task_worker_pool.h" | 10 #include "cc/resources/gpu_tile_task_worker_pool.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 switch (resource_pool_option_) { | 165 switch (resource_pool_option_) { |
166 case BITMAP_TILE_TASK_WORKER_POOL: | 166 case BITMAP_TILE_TASK_WORKER_POOL: |
167 EXPECT_FALSE(context_provider); | 167 EXPECT_FALSE(context_provider); |
168 EXPECT_EQ(PIXEL_TEST_SOFTWARE, test_type_); | 168 EXPECT_EQ(PIXEL_TEST_SOFTWARE, test_type_); |
169 *resource_pool = | 169 *resource_pool = |
170 ResourcePool::Create(resource_provider, | 170 ResourcePool::Create(resource_provider, |
171 draw_texture_target_); | 171 draw_texture_target_); |
172 | 172 |
173 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( | 173 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( |
174 task_runner, TileTaskWorkerPool::GetTaskGraphRunner(), | 174 task_runner, task_graph_runner(), resource_provider); |
175 resource_provider); | |
176 break; | 175 break; |
177 case GPU_TILE_TASK_WORKER_POOL: | 176 case GPU_TILE_TASK_WORKER_POOL: |
178 EXPECT_TRUE(context_provider); | 177 EXPECT_TRUE(context_provider); |
179 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 178 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
180 *resource_pool = | 179 *resource_pool = |
181 ResourcePool::Create(resource_provider, | 180 ResourcePool::Create(resource_provider, |
182 draw_texture_target_); | 181 draw_texture_target_); |
183 | 182 |
184 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( | 183 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( |
185 task_runner, TileTaskWorkerPool::GetTaskGraphRunner(), | 184 task_runner, task_graph_runner(), |
186 static_cast<GpuRasterizer*>(host_impl->rasterizer())); | 185 static_cast<GpuRasterizer*>(host_impl->rasterizer())); |
187 break; | 186 break; |
188 case ZERO_COPY_TILE_TASK_WORKER_POOL: | 187 case ZERO_COPY_TILE_TASK_WORKER_POOL: |
189 EXPECT_TRUE(context_provider); | 188 EXPECT_TRUE(context_provider); |
190 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 189 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
191 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); | 190 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); |
192 *resource_pool = | 191 *resource_pool = |
193 ResourcePool::Create(resource_provider, draw_texture_target_); | 192 ResourcePool::Create(resource_provider, draw_texture_target_); |
194 | 193 |
195 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( | 194 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( |
196 task_runner, TileTaskWorkerPool::GetTaskGraphRunner(), | 195 task_runner, task_graph_runner(), resource_provider); |
197 resource_provider); | |
198 break; | 196 break; |
199 case ONE_COPY_TILE_TASK_WORKER_POOL: | 197 case ONE_COPY_TILE_TASK_WORKER_POOL: |
200 EXPECT_TRUE(context_provider); | 198 EXPECT_TRUE(context_provider); |
201 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 199 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
202 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); | 200 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); |
203 // We need to create a staging resource pool when using copy rasterizer. | 201 // We need to create a staging resource pool when using copy rasterizer. |
204 *staging_resource_pool = | 202 *staging_resource_pool = |
205 ResourcePool::Create(resource_provider, staging_texture_target_); | 203 ResourcePool::Create(resource_provider, staging_texture_target_); |
206 *resource_pool = | 204 *resource_pool = |
207 ResourcePool::Create(resource_provider, draw_texture_target_); | 205 ResourcePool::Create(resource_provider, draw_texture_target_); |
208 | 206 |
209 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( | 207 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( |
210 task_runner, TileTaskWorkerPool::GetTaskGraphRunner(), | 208 task_runner, task_graph_runner(), context_provider, resource_provider, |
211 context_provider, resource_provider, staging_resource_pool->get()); | 209 staging_resource_pool->get()); |
212 break; | 210 break; |
213 case PIXEL_BUFFER_TILE_TASK_WORKER_POOL: | 211 case PIXEL_BUFFER_TILE_TASK_WORKER_POOL: |
214 EXPECT_TRUE(context_provider); | 212 EXPECT_TRUE(context_provider); |
215 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 213 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
216 *resource_pool = ResourcePool::Create( | 214 *resource_pool = ResourcePool::Create( |
217 resource_provider, draw_texture_target_); | 215 resource_provider, draw_texture_target_); |
218 | 216 |
219 *tile_task_worker_pool = PixelBufferTileTaskWorkerPool::Create( | 217 *tile_task_worker_pool = PixelBufferTileTaskWorkerPool::Create( |
220 task_runner, TileTaskWorkerPool::GetTaskGraphRunner(), | 218 task_runner, task_graph_runner(), context_provider, resource_provider, |
221 context_provider, resource_provider, max_transfer_buffer_usage_bytes); | 219 max_transfer_buffer_usage_bytes); |
222 break; | 220 break; |
223 } | 221 } |
224 } | 222 } |
225 | 223 |
226 void LayerTreeHostPixelResourceTest::RunPixelResourceTest( | 224 void LayerTreeHostPixelResourceTest::RunPixelResourceTest( |
227 scoped_refptr<Layer> content_root, | 225 scoped_refptr<Layer> content_root, |
228 base::FilePath file_name) { | 226 base::FilePath file_name) { |
229 if (!IsTestCaseSupported(test_case_)) | 227 if (!IsTestCaseSupported(test_case_)) |
230 return; | 228 return; |
231 RunPixelTest(test_type_, content_root, file_name); | 229 RunPixelTest(test_type_, content_root, file_name); |
232 | 230 |
233 if (layer_tree_host()) | 231 if (layer_tree_host()) |
234 EXPECT_TRUE(layer_tree_host()->settings().impl_side_painting); | 232 EXPECT_TRUE(layer_tree_host()->settings().impl_side_painting); |
235 } | 233 } |
236 | 234 |
237 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest() | 235 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest() |
238 : LayerTreeHostPixelResourceTest(GetParam()) { | 236 : LayerTreeHostPixelResourceTest(GetParam()) { |
239 } | 237 } |
240 | 238 |
241 } // namespace cc | 239 } // namespace cc |
OLD | NEW |