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_raster_buffer_provider.h" | 8 #include "cc/raster/bitmap_raster_buffer_provider.h" |
9 #include "cc/raster/gpu_raster_buffer_provider.h" | 9 #include "cc/raster/gpu_raster_buffer_provider.h" |
10 #include "cc/raster/gpu_rasterizer.h" | |
11 #include "cc/raster/one_copy_raster_buffer_provider.h" | 10 #include "cc/raster/one_copy_raster_buffer_provider.h" |
12 #include "cc/raster/raster_buffer_provider.h" | 11 #include "cc/raster/raster_buffer_provider.h" |
13 #include "cc/raster/zero_copy_raster_buffer_provider.h" | 12 #include "cc/raster/zero_copy_raster_buffer_provider.h" |
14 #include "cc/resources/resource_pool.h" | 13 #include "cc/resources/resource_pool.h" |
15 #include "cc/test/fake_output_surface.h" | 14 #include "cc/test/fake_output_surface.h" |
16 #include "gpu/GLES2/gl2extchromium.h" | 15 #include "gpu/GLES2/gl2extchromium.h" |
17 | 16 |
18 namespace cc { | 17 namespace cc { |
19 | 18 |
20 namespace { | 19 namespace { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 *raster_buffer_provider = | 134 *raster_buffer_provider = |
136 BitmapRasterBufferProvider::Create(resource_provider); | 135 BitmapRasterBufferProvider::Create(resource_provider); |
137 break; | 136 break; |
138 case RASTER_BUFFER_PROVIDER_TYPE_GPU: | 137 case RASTER_BUFFER_PROVIDER_TYPE_GPU: |
139 EXPECT_TRUE(compositor_context_provider); | 138 EXPECT_TRUE(compositor_context_provider); |
140 EXPECT_TRUE(worker_context_provider); | 139 EXPECT_TRUE(worker_context_provider); |
141 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 140 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
142 | 141 |
143 *raster_buffer_provider = base::MakeUnique<GpuRasterBufferProvider>( | 142 *raster_buffer_provider = base::MakeUnique<GpuRasterBufferProvider>( |
144 compositor_context_provider, worker_context_provider, | 143 compositor_context_provider, worker_context_provider, |
145 resource_provider, false, 0); | 144 resource_provider, false, 0, false); |
146 break; | 145 break; |
147 case RASTER_BUFFER_PROVIDER_TYPE_ZERO_COPY: | 146 case RASTER_BUFFER_PROVIDER_TYPE_ZERO_COPY: |
148 EXPECT_TRUE(compositor_context_provider); | 147 EXPECT_TRUE(compositor_context_provider); |
149 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 148 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
150 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); | 149 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); |
151 | 150 |
152 *raster_buffer_provider = ZeroCopyRasterBufferProvider::Create( | 151 *raster_buffer_provider = ZeroCopyRasterBufferProvider::Create( |
153 resource_provider, PlatformColor::BestTextureFormat()); | 152 resource_provider, PlatformColor::BestTextureFormat()); |
154 break; | 153 break; |
155 case RASTER_BUFFER_PROVIDER_TYPE_ONE_COPY: | 154 case RASTER_BUFFER_PROVIDER_TYPE_ONE_COPY: |
156 EXPECT_TRUE(compositor_context_provider); | 155 EXPECT_TRUE(compositor_context_provider); |
157 EXPECT_TRUE(worker_context_provider); | 156 EXPECT_TRUE(worker_context_provider); |
158 EXPECT_EQ(PIXEL_TEST_GL, test_type_); | 157 EXPECT_EQ(PIXEL_TEST_GL, test_type_); |
159 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); | 158 EXPECT_TRUE(host_impl->GetRendererCapabilities().using_image); |
160 | 159 |
161 *raster_buffer_provider = base::MakeUnique<OneCopyRasterBufferProvider>( | 160 *raster_buffer_provider = base::MakeUnique<OneCopyRasterBufferProvider>( |
162 task_runner, compositor_context_provider, worker_context_provider, | 161 task_runner, compositor_context_provider, worker_context_provider, |
163 resource_provider, max_bytes_per_copy_operation, false, | 162 resource_provider, max_bytes_per_copy_operation, false, |
164 max_staging_buffer_usage_in_bytes, | 163 max_staging_buffer_usage_in_bytes, PlatformColor::BestTextureFormat(), |
165 PlatformColor::BestTextureFormat()); | 164 false); |
166 break; | 165 break; |
167 } | 166 } |
168 } | 167 } |
169 | 168 |
170 void LayerTreeHostPixelResourceTest::RunPixelResourceTest( | 169 void LayerTreeHostPixelResourceTest::RunPixelResourceTest( |
171 scoped_refptr<Layer> content_root, | 170 scoped_refptr<Layer> content_root, |
172 base::FilePath file_name) { | 171 base::FilePath file_name) { |
173 if (!IsTestCaseSupported(test_case_)) | 172 if (!IsTestCaseSupported(test_case_)) |
174 return; | 173 return; |
175 RunPixelTest(test_type_, content_root, file_name); | 174 RunPixelTest(test_type_, content_root, file_name); |
176 } | 175 } |
177 | 176 |
178 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest() | 177 ParameterizedPixelResourceTest::ParameterizedPixelResourceTest() |
179 : LayerTreeHostPixelResourceTest(GetParam()) { | 178 : LayerTreeHostPixelResourceTest(GetParam()) { |
180 } | 179 } |
181 | 180 |
182 } // namespace cc | 181 } // namespace cc |
OLD | NEW |