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

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

Issue 1063493002: cc: Remove all traces of synchronous GPU rasterization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 8 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
« no previous file with comments | « cc/test/layer_tree_pixel_resource_test.h ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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"
11 #include "cc/resources/one_copy_tile_task_worker_pool.h" 11 #include "cc/resources/one_copy_tile_task_worker_pool.h"
12 #include "cc/resources/pixel_buffer_tile_task_worker_pool.h" 12 #include "cc/resources/pixel_buffer_tile_task_worker_pool.h"
13 #include "cc/resources/resource_pool.h" 13 #include "cc/resources/resource_pool.h"
14 #include "cc/resources/software_rasterizer.h"
15 #include "cc/resources/tile_task_worker_pool.h" 14 #include "cc/resources/tile_task_worker_pool.h"
16 #include "cc/resources/zero_copy_tile_task_worker_pool.h" 15 #include "cc/resources/zero_copy_tile_task_worker_pool.h"
17 #include "cc/test/fake_output_surface.h" 16 #include "cc/test/fake_output_surface.h"
18 #include "gpu/GLES2/gl2extchromium.h" 17 #include "gpu/GLES2/gl2extchromium.h"
19 18
20 namespace cc { 19 namespace cc {
21 20
22 namespace { 21 namespace {
23 22
24 bool IsTestCaseSupported(PixelResourceTestCase test_case) { 23 bool IsTestCaseSupported(PixelResourceTestCase test_case) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 case GL_ASYNC_UPLOAD_2D_DRAW: 117 case GL_ASYNC_UPLOAD_2D_DRAW:
119 test_type_ = PIXEL_TEST_GL; 118 test_type_ = PIXEL_TEST_GL;
120 staging_texture_target_ = GL_INVALID_VALUE; 119 staging_texture_target_ = GL_INVALID_VALUE;
121 draw_texture_target_ = GL_TEXTURE_2D; 120 draw_texture_target_ = GL_TEXTURE_2D;
122 resource_pool_option_ = PIXEL_BUFFER_TILE_TASK_WORKER_POOL; 121 resource_pool_option_ = PIXEL_BUFFER_TILE_TASK_WORKER_POOL;
123 return; 122 return;
124 } 123 }
125 NOTREACHED(); 124 NOTREACHED();
126 } 125 }
127 126
128 scoped_ptr<Rasterizer> LayerTreeHostPixelResourceTest::CreateRasterizer(
129 LayerTreeHostImpl* host_impl) {
130 bool use_distance_field_text = false;
131 ContextProvider* context_provider =
132 host_impl->output_surface()->context_provider();
133 ResourceProvider* resource_provider = host_impl->resource_provider();
134 switch (resource_pool_option_) {
135 case BITMAP_TILE_TASK_WORKER_POOL:
136 case ZERO_COPY_TILE_TASK_WORKER_POOL:
137 case ONE_COPY_TILE_TASK_WORKER_POOL:
138 case PIXEL_BUFFER_TILE_TASK_WORKER_POOL:
139 return SoftwareRasterizer::Create();
140 case GPU_TILE_TASK_WORKER_POOL:
141 EXPECT_TRUE(context_provider);
142 return GpuRasterizer::Create(context_provider, resource_provider,
143 use_distance_field_text, false, 0);
144 }
145 NOTREACHED();
146 return nullptr;
147 }
148
149 void LayerTreeHostPixelResourceTest::CreateResourceAndTileTaskWorkerPool( 127 void LayerTreeHostPixelResourceTest::CreateResourceAndTileTaskWorkerPool(
150 LayerTreeHostImpl* host_impl, 128 LayerTreeHostImpl* host_impl,
151 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, 129 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool,
152 scoped_ptr<ResourcePool>* resource_pool, 130 scoped_ptr<ResourcePool>* resource_pool,
153 scoped_ptr<ResourcePool>* staging_resource_pool) { 131 scoped_ptr<ResourcePool>* staging_resource_pool) {
154 base::SingleThreadTaskRunner* task_runner = 132 base::SingleThreadTaskRunner* task_runner =
155 proxy()->HasImplThread() ? proxy()->ImplThreadTaskRunner() 133 proxy()->HasImplThread() ? proxy()->ImplThreadTaskRunner()
156 : proxy()->MainThreadTaskRunner(); 134 : proxy()->MainThreadTaskRunner();
157 DCHECK(task_runner); 135 DCHECK(task_runner);
158 DCHECK(initialized_); 136 DCHECK(initialized_);
(...skipping 15 matching lines...) Expand all
174 task_runner, task_graph_runner(), resource_provider); 152 task_runner, task_graph_runner(), resource_provider);
175 break; 153 break;
176 case GPU_TILE_TASK_WORKER_POOL: 154 case GPU_TILE_TASK_WORKER_POOL:
177 EXPECT_TRUE(context_provider); 155 EXPECT_TRUE(context_provider);
178 EXPECT_EQ(PIXEL_TEST_GL, test_type_); 156 EXPECT_EQ(PIXEL_TEST_GL, test_type_);
179 *resource_pool = 157 *resource_pool =
180 ResourcePool::Create(resource_provider, 158 ResourcePool::Create(resource_provider,
181 draw_texture_target_); 159 draw_texture_target_);
182 160
183 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( 161 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create(
184 task_runner, task_graph_runner(), 162 task_runner, task_graph_runner(), context_provider, resource_provider,
185 static_cast<GpuRasterizer*>(host_impl->rasterizer())); 163 false, 0);
186 break; 164 break;
187 case ZERO_COPY_TILE_TASK_WORKER_POOL: 165 case ZERO_COPY_TILE_TASK_WORKER_POOL:
188 EXPECT_TRUE(context_provider); 166 EXPECT_TRUE(context_provider);
189 EXPECT_EQ(PIXEL_TEST_GL, test_type_); 167 EXPECT_EQ(PIXEL_TEST_GL, test_type_);
190 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); 168 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image);
191 *resource_pool = 169 *resource_pool =
192 ResourcePool::Create(resource_provider, draw_texture_target_); 170 ResourcePool::Create(resource_provider, draw_texture_target_);
193 171
194 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( 172 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create(
195 task_runner, task_graph_runner(), resource_provider); 173 task_runner, task_graph_runner(), resource_provider);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 208
231 if (layer_tree_host()) 209 if (layer_tree_host())
232 EXPECT_TRUE(layer_tree_host()->settings().impl_side_painting); 210 EXPECT_TRUE(layer_tree_host()->settings().impl_side_painting);
233 } 211 }
234 212
235 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest() 213 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest()
236 : LayerTreeHostPixelResourceTest(GetParam()) { 214 : LayerTreeHostPixelResourceTest(GetParam()) {
237 } 215 }
238 216
239 } // namespace cc 217 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_pixel_resource_test.h ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698