OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This file defines tests that implementations of GpuMemoryBufferFactory should | 5 // This file defines tests that implementations of GpuMemoryBufferFactory should |
6 // pass in order to be conformant. | 6 // pass in order to be conformant. |
7 | 7 |
8 #ifndef CONTENT_TEST_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ | 8 #ifndef CONTENT_TEST_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ |
9 #define CONTENT_TEST_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ | 9 #define CONTENT_TEST_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 TYPED_TEST_CASE_P(GpuMemoryBufferFactoryTest); | 23 TYPED_TEST_CASE_P(GpuMemoryBufferFactoryTest); |
24 | 24 |
25 TYPED_TEST_P(GpuMemoryBufferFactoryTest, CreateGpuMemoryBuffer) { | 25 TYPED_TEST_P(GpuMemoryBufferFactoryTest, CreateGpuMemoryBuffer) { |
26 const gfx::GpuMemoryBufferId kBufferId(1); | 26 const gfx::GpuMemoryBufferId kBufferId(1); |
27 const int kClientId = 1; | 27 const int kClientId = 1; |
28 | 28 |
29 gfx::Size buffer_size(2, 2); | 29 gfx::Size buffer_size(2, 2); |
30 | 30 |
31 for (auto format : gfx::GetBufferFormatsForTesting()) { | 31 for (auto format : gfx::GetBufferFormatsForTesting()) { |
32 gfx::BufferUsage usages[] = { | 32 gfx::BufferUsage usages[] = { |
33 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::GPU_READ_WRITE, | 33 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT, |
34 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, | 34 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, |
35 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT}; | 35 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT}; |
36 for (auto usage : usages) { | 36 for (auto usage : usages) { |
37 if (!TypeParam::IsGpuMemoryBufferConfigurationSupported(format, usage)) | 37 if (!TypeParam::IsGpuMemoryBufferConfigurationSupported(format, usage)) |
38 continue; | 38 continue; |
39 | 39 |
40 gfx::GpuMemoryBufferHandle handle = | 40 gfx::GpuMemoryBufferHandle handle = |
41 TestFixture::factory_.CreateGpuMemoryBuffer(kBufferId, buffer_size, | 41 TestFixture::factory_.CreateGpuMemoryBuffer(kBufferId, buffer_size, |
42 format, usage, kClientId, | 42 format, usage, kClientId, |
43 gfx::kNullPluginWindow); | 43 gfx::kNullPluginWindow); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 // The GpuMemoryBufferFactoryImportTest test case verifies that the | 91 // The GpuMemoryBufferFactoryImportTest test case verifies that the |
92 // GpuMemoryBufferFactory implementation handles import of buffers correctly. | 92 // GpuMemoryBufferFactory implementation handles import of buffers correctly. |
93 REGISTER_TYPED_TEST_CASE_P(GpuMemoryBufferFactoryImportTest, | 93 REGISTER_TYPED_TEST_CASE_P(GpuMemoryBufferFactoryImportTest, |
94 CreateGpuMemoryBufferFromHandle); | 94 CreateGpuMemoryBufferFromHandle); |
95 | 95 |
96 } // namespace content | 96 } // namespace content |
97 | 97 |
98 #endif // CONTENT_TEST_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ | 98 #endif // CONTENT_TEST_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ |
OLD | NEW |