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

Side by Side Diff: gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h

Issue 2496783002: gpu: Reuse existing code for shared memory allocation. (Closed)
Patch Set: . Created 4 years, 1 month 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 #ifndef GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_ 5 #ifndef GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_
6 #define GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_ 6 #define GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 11 matching lines...) Expand all
22 22
23 static std::unique_ptr<GpuMemoryBufferImplSharedMemory> Create( 23 static std::unique_ptr<GpuMemoryBufferImplSharedMemory> Create(
24 gfx::GpuMemoryBufferId id, 24 gfx::GpuMemoryBufferId id,
25 const gfx::Size& size, 25 const gfx::Size& size,
26 gfx::BufferFormat format, 26 gfx::BufferFormat format,
27 const DestructionCallback& callback); 27 const DestructionCallback& callback);
28 28
29 static gfx::GpuMemoryBufferHandle AllocateForChildProcess( 29 static gfx::GpuMemoryBufferHandle AllocateForChildProcess(
30 gfx::GpuMemoryBufferId id, 30 gfx::GpuMemoryBufferId id,
31 const gfx::Size& size, 31 const gfx::Size& size,
32 gfx::BufferFormat format, 32 gfx::BufferFormat format);
33 base::ProcessHandle child_process);
34 33
35 static std::unique_ptr<GpuMemoryBufferImplSharedMemory> CreateFromHandle( 34 static std::unique_ptr<GpuMemoryBufferImplSharedMemory> CreateFromHandle(
36 const gfx::GpuMemoryBufferHandle& handle, 35 const gfx::GpuMemoryBufferHandle& handle,
37 const gfx::Size& size, 36 const gfx::Size& size,
38 gfx::BufferFormat format, 37 gfx::BufferFormat format,
39 gfx::BufferUsage usage, 38 gfx::BufferUsage usage,
40 const DestructionCallback& callback); 39 const DestructionCallback& callback);
41 40
42 static bool IsUsageSupported(gfx::BufferUsage usage); 41 static bool IsUsageSupported(gfx::BufferUsage usage);
43 static bool IsConfigurationSupported(gfx::BufferFormat format, 42 static bool IsConfigurationSupported(gfx::BufferFormat format,
(...skipping 26 matching lines...) Expand all
70 std::unique_ptr<base::SharedMemory> shared_memory_; 69 std::unique_ptr<base::SharedMemory> shared_memory_;
71 size_t offset_; 70 size_t offset_;
72 int stride_; 71 int stride_;
73 72
74 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSharedMemory); 73 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSharedMemory);
75 }; 74 };
76 75
77 } // namespace gpu 76 } // namespace gpu
78 77
79 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_ 78 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698