Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(897)

Side by Side Diff: cc/test/layer_tree_pixel_resource_test.cc

Issue 1910213005: cc: Refactor TileTaskWorkerPool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@task_states
Patch Set: nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 ResourceProvider* resource_provider = host_impl->resource_provider(); 121 ResourceProvider* resource_provider = host_impl->resource_provider();
122 int max_bytes_per_copy_operation = 1024 * 1024; 122 int max_bytes_per_copy_operation = 1024 * 1024;
123 int max_staging_buffer_usage_in_bytes = 32 * 1024 * 1024; 123 int max_staging_buffer_usage_in_bytes = 32 * 1024 * 1024;
124 124
125 switch (resource_pool_option_) { 125 switch (resource_pool_option_) {
126 case BITMAP_TILE_TASK_WORKER_POOL: 126 case BITMAP_TILE_TASK_WORKER_POOL:
127 EXPECT_FALSE(context_provider); 127 EXPECT_FALSE(context_provider);
128 EXPECT_EQ(PIXEL_TEST_SOFTWARE, test_type_); 128 EXPECT_EQ(PIXEL_TEST_SOFTWARE, test_type_);
129 *resource_pool = ResourcePool::Create(resource_provider, task_runner); 129 *resource_pool = ResourcePool::Create(resource_provider, task_runner);
130 130
131 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( 131 *tile_task_worker_pool =
132 task_runner, task_graph_runner(), resource_provider); 132 BitmapTileTaskWorkerPool::Create(resource_provider);
133 break; 133 break;
134 case GPU_TILE_TASK_WORKER_POOL: 134 case GPU_TILE_TASK_WORKER_POOL:
135 EXPECT_TRUE(context_provider); 135 EXPECT_TRUE(context_provider);
136 EXPECT_EQ(PIXEL_TEST_GL, test_type_); 136 EXPECT_EQ(PIXEL_TEST_GL, test_type_);
137 *resource_pool = ResourcePool::Create(resource_provider, task_runner); 137 *resource_pool = ResourcePool::Create(resource_provider, task_runner);
138 138
139 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( 139 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create(
140 task_runner, task_graph_runner(), context_provider, resource_provider, 140 context_provider, resource_provider, false, 0);
141 false, 0);
142 break; 141 break;
143 case ZERO_COPY_TILE_TASK_WORKER_POOL: 142 case ZERO_COPY_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 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); 145 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image);
147 *resource_pool = ResourcePool::Create(resource_provider, task_runner); 146 *resource_pool = ResourcePool::Create(resource_provider, task_runner);
148 147
149 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( 148 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create(
150 task_runner, task_graph_runner(), resource_provider, 149 resource_provider, PlatformColor::BestTextureFormat());
151 PlatformColor::BestTextureFormat());
152 break; 150 break;
153 case ONE_COPY_TILE_TASK_WORKER_POOL: 151 case ONE_COPY_TILE_TASK_WORKER_POOL:
154 EXPECT_TRUE(context_provider); 152 EXPECT_TRUE(context_provider);
155 EXPECT_EQ(PIXEL_TEST_GL, test_type_); 153 EXPECT_EQ(PIXEL_TEST_GL, test_type_);
156 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); 154 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image);
157 *resource_pool = ResourcePool::Create(resource_provider, task_runner); 155 *resource_pool = ResourcePool::Create(resource_provider, task_runner);
158 156
159 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( 157 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create(
160 task_runner, task_graph_runner(), context_provider, resource_provider, 158 task_runner, context_provider, resource_provider,
161 max_bytes_per_copy_operation, false, 159 max_bytes_per_copy_operation, false,
162 max_staging_buffer_usage_in_bytes, 160 max_staging_buffer_usage_in_bytes,
163 PlatformColor::BestTextureFormat()); 161 PlatformColor::BestTextureFormat());
164 break; 162 break;
165 } 163 }
166 } 164 }
167 165
168 void LayerTreeHostPixelResourceTest::RunPixelResourceTest( 166 void LayerTreeHostPixelResourceTest::RunPixelResourceTest(
169 scoped_refptr<Layer> content_root, 167 scoped_refptr<Layer> content_root,
170 base::FilePath file_name) { 168 base::FilePath file_name) {
171 if (!IsTestCaseSupported(test_case_)) 169 if (!IsTestCaseSupported(test_case_))
172 return; 170 return;
173 RunPixelTest(test_type_, content_root, file_name); 171 RunPixelTest(test_type_, content_root, file_name);
174 } 172 }
175 173
176 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest() 174 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest()
177 : LayerTreeHostPixelResourceTest(GetParam()) { 175 : LayerTreeHostPixelResourceTest(GetParam()) {
178 } 176 }
179 177
180 } // namespace cc 178 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698