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/raster/bitmap_tile_task_worker_pool.h" | 8 #include "cc/raster/bitmap_tile_task_worker_pool.h" |
9 #include "cc/raster/gpu_rasterizer.h" | 9 #include "cc/raster/gpu_rasterizer.h" |
10 #include "cc/raster/gpu_tile_task_worker_pool.h" | 10 #include "cc/raster/gpu_tile_task_worker_pool.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 host_impl->output_surface()->context_provider(); | 126 host_impl->output_surface()->context_provider(); |
127 ResourceProvider* resource_provider = host_impl->resource_provider(); | 127 ResourceProvider* resource_provider = host_impl->resource_provider(); |
128 size_t max_transfer_buffer_usage_bytes = 1024u * 1024u * 60u; | 128 size_t max_transfer_buffer_usage_bytes = 1024u * 1024u * 60u; |
129 int max_bytes_per_copy_operation = 1024 * 1024; | 129 int max_bytes_per_copy_operation = 1024 * 1024; |
130 int max_staging_buffers = 32; | 130 int max_staging_buffers = 32; |
131 | 131 |
132 switch (resource_pool_option_) { | 132 switch (resource_pool_option_) { |
133 case BITMAP_TILE_TASK_WORKER_POOL: | 133 case BITMAP_TILE_TASK_WORKER_POOL: |
134 EXPECT_FALSE(context_provider); | 134 EXPECT_FALSE(context_provider); |
135 EXPECT_EQ(PIXEL_TEST_SOFTWARE, test_type_); | 135 EXPECT_EQ(PIXEL_TEST_SOFTWARE, test_type_); |
136 *resource_pool = | 136 *resource_pool = ResourcePool::Create(resource_provider, task_runner, |
137 ResourcePool::Create(resource_provider, | 137 draw_texture_target_); |
138 draw_texture_target_); | |
139 | 138 |
140 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( | 139 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( |
141 task_runner, task_graph_runner(), resource_provider); | 140 task_runner, task_graph_runner(), resource_provider); |
142 break; | 141 break; |
143 case GPU_TILE_TASK_WORKER_POOL: | 142 case GPU_TILE_TASK_WORKER_POOL: |
144 EXPECT_TRUE(context_provider); | 143 EXPECT_TRUE(context_provider); |
145 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 144 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
146 *resource_pool = | 145 *resource_pool = ResourcePool::Create(resource_provider, task_runner, |
147 ResourcePool::Create(resource_provider, | 146 draw_texture_target_); |
148 draw_texture_target_); | |
149 | 147 |
150 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( | 148 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( |
151 task_runner, task_graph_runner(), context_provider, resource_provider, | 149 task_runner, task_graph_runner(), context_provider, resource_provider, |
152 false, 0); | 150 false, 0); |
153 break; | 151 break; |
154 case ZERO_COPY_TILE_TASK_WORKER_POOL: | 152 case ZERO_COPY_TILE_TASK_WORKER_POOL: |
155 EXPECT_TRUE(context_provider); | 153 EXPECT_TRUE(context_provider); |
156 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 154 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
157 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); | 155 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); |
158 *resource_pool = | 156 *resource_pool = ResourcePool::Create(resource_provider, task_runner, |
159 ResourcePool::Create(resource_provider, draw_texture_target_); | 157 draw_texture_target_); |
160 | 158 |
161 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( | 159 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( |
162 task_runner, task_graph_runner(), resource_provider); | 160 task_runner, task_graph_runner(), resource_provider); |
163 break; | 161 break; |
164 case ONE_COPY_TILE_TASK_WORKER_POOL: | 162 case ONE_COPY_TILE_TASK_WORKER_POOL: |
165 EXPECT_TRUE(context_provider); | 163 EXPECT_TRUE(context_provider); |
166 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 164 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
167 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); | 165 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); |
168 *resource_pool = | 166 *resource_pool = ResourcePool::Create(resource_provider, task_runner, |
169 ResourcePool::Create(resource_provider, draw_texture_target_); | 167 draw_texture_target_); |
170 | 168 |
171 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( | 169 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( |
172 task_runner, task_graph_runner(), context_provider, resource_provider, | 170 task_runner, task_graph_runner(), context_provider, resource_provider, |
173 max_bytes_per_copy_operation, false, max_staging_buffers); | 171 max_bytes_per_copy_operation, false, max_staging_buffers); |
174 break; | 172 break; |
175 case PIXEL_BUFFER_TILE_TASK_WORKER_POOL: | 173 case PIXEL_BUFFER_TILE_TASK_WORKER_POOL: |
176 EXPECT_TRUE(context_provider); | 174 EXPECT_TRUE(context_provider); |
177 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 175 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
178 *resource_pool = ResourcePool::Create( | 176 *resource_pool = ResourcePool::Create(resource_provider, task_runner, |
179 resource_provider, draw_texture_target_); | 177 draw_texture_target_); |
180 | 178 |
181 *tile_task_worker_pool = PixelBufferTileTaskWorkerPool::Create( | 179 *tile_task_worker_pool = PixelBufferTileTaskWorkerPool::Create( |
182 task_runner, task_graph_runner(), context_provider, resource_provider, | 180 task_runner, task_graph_runner(), context_provider, resource_provider, |
183 max_transfer_buffer_usage_bytes); | 181 max_transfer_buffer_usage_bytes); |
184 break; | 182 break; |
185 } | 183 } |
186 } | 184 } |
187 | 185 |
188 void LayerTreeHostPixelResourceTest::RunPixelResourceTest( | 186 void LayerTreeHostPixelResourceTest::RunPixelResourceTest( |
189 scoped_refptr<Layer> content_root, | 187 scoped_refptr<Layer> content_root, |
190 base::FilePath file_name) { | 188 base::FilePath file_name) { |
191 if (!IsTestCaseSupported(test_case_)) | 189 if (!IsTestCaseSupported(test_case_)) |
192 return; | 190 return; |
193 RunPixelTest(test_type_, content_root, file_name); | 191 RunPixelTest(test_type_, content_root, file_name); |
194 } | 192 } |
195 | 193 |
196 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest() | 194 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest() |
197 : LayerTreeHostPixelResourceTest(GetParam()) { | 195 : LayerTreeHostPixelResourceTest(GetParam()) { |
198 } | 196 } |
199 | 197 |
200 } // namespace cc | 198 } // namespace cc |
OLD | NEW |