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

Side by Side Diff: gpu/ipc/service/gpu_memory_buffer_factory_test_template.h

Issue 2717963002: ui: Add gfx::BufferUsage::SCANOUT_CPU_READ_WRITE. (Closed)
Patch Set: SCANOUT_CPU_READ_WRITE as valid shm usage Created 3 years, 9 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 | « gpu/ipc/host/gpu_memory_buffer_support.cc ('k') | ui/gfx/buffer_types.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 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 GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ 8 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_
9 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ 9 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 TYPED_TEST_P(GpuMemoryBufferFactoryTest, CreateGpuMemoryBuffer) { 26 TYPED_TEST_P(GpuMemoryBufferFactoryTest, CreateGpuMemoryBuffer) {
27 const gfx::GpuMemoryBufferId kBufferId(1); 27 const gfx::GpuMemoryBufferId kBufferId(1);
28 const int kClientId = 1; 28 const int kClientId = 1;
29 29
30 gfx::Size buffer_size(2, 2); 30 gfx::Size buffer_size(2, 2);
31 31
32 for (auto format : gfx::GetBufferFormatsForTesting()) { 32 for (auto format : gfx::GetBufferFormatsForTesting()) {
33 gfx::BufferUsage usages[] = { 33 gfx::BufferUsage usages[] = {
34 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT, 34 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT,
35 gfx::BufferUsage::SCANOUT_CPU_READ_WRITE,
35 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, 36 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE,
36 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT}; 37 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT};
37 for (auto usage : usages) { 38 for (auto usage : usages) {
38 if (!IsNativeGpuMemoryBufferConfigurationSupported(format, usage)) 39 if (!IsNativeGpuMemoryBufferConfigurationSupported(format, usage))
39 continue; 40 continue;
40 41
41 gfx::GpuMemoryBufferHandle handle = 42 gfx::GpuMemoryBufferHandle handle =
42 TestFixture::factory_.CreateGpuMemoryBuffer(kBufferId, buffer_size, 43 TestFixture::factory_.CreateGpuMemoryBuffer(kBufferId, buffer_size,
43 format, usage, kClientId, 44 format, usage, kClientId,
44 gpu::kNullSurfaceHandle); 45 gpu::kNullSurfaceHandle);
45 EXPECT_NE(handle.type, gfx::EMPTY_BUFFER); 46 EXPECT_NE(handle.type, gfx::EMPTY_BUFFER);
46 TestFixture::factory_.DestroyGpuMemoryBuffer(kBufferId, kClientId); 47 TestFixture::factory_.DestroyGpuMemoryBuffer(kBufferId, kClientId);
47 } 48 }
48 } 49 }
49 } 50 }
50 51
51 // The GpuMemoryBufferFactoryTest test case verifies behavior that is expected 52 // The GpuMemoryBufferFactoryTest test case verifies behavior that is expected
52 // from a GpuMemoryBuffer factory in order to be conformant. 53 // from a GpuMemoryBuffer factory in order to be conformant.
53 REGISTER_TYPED_TEST_CASE_P(GpuMemoryBufferFactoryTest, CreateGpuMemoryBuffer); 54 REGISTER_TYPED_TEST_CASE_P(GpuMemoryBufferFactoryTest, CreateGpuMemoryBuffer);
54 55
55 } // namespace gpu 56 } // namespace gpu
56 57
57 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ 58 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_
OLDNEW
« no previous file with comments | « gpu/ipc/host/gpu_memory_buffer_support.cc ('k') | ui/gfx/buffer_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698