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 #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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 static base::Closure AllocateForTesting(const gfx::Size& size, | 48 static base::Closure AllocateForTesting(const gfx::Size& size, |
49 gfx::BufferFormat format, | 49 gfx::BufferFormat format, |
50 gfx::BufferUsage usage, | 50 gfx::BufferUsage usage, |
51 gfx::GpuMemoryBufferHandle* handle); | 51 gfx::GpuMemoryBufferHandle* handle); |
52 | 52 |
53 // Overridden from gfx::GpuMemoryBuffer: | 53 // Overridden from gfx::GpuMemoryBuffer: |
54 bool Map() override; | 54 bool Map() override; |
55 void* memory(size_t plane) override; | 55 void* memory(size_t plane) override; |
56 void Unmap() override; | 56 void Unmap() override; |
57 int stride(size_t plane) const override; | 57 uint32_t stride(size_t plane) const override; |
58 gfx::GpuMemoryBufferHandle GetHandle() const override; | 58 gfx::GpuMemoryBufferHandle GetHandle() const override; |
59 | 59 |
60 private: | 60 private: |
61 GpuMemoryBufferImplSharedMemory( | 61 GpuMemoryBufferImplSharedMemory( |
62 gfx::GpuMemoryBufferId id, | 62 gfx::GpuMemoryBufferId id, |
63 const gfx::Size& size, | 63 const gfx::Size& size, |
64 gfx::BufferFormat format, | 64 gfx::BufferFormat format, |
65 const DestructionCallback& callback, | 65 const DestructionCallback& callback, |
66 std::unique_ptr<base::SharedMemory> shared_memory, | 66 std::unique_ptr<base::SharedMemory> shared_memory, |
67 size_t offset, | 67 size_t offset, |
68 int stride); | 68 uint32_t stride); |
69 | 69 |
70 std::unique_ptr<base::SharedMemory> shared_memory_; | 70 std::unique_ptr<base::SharedMemory> shared_memory_; |
71 size_t offset_; | 71 size_t offset_; |
72 int stride_; | 72 uint32_t stride_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSharedMemory); | 74 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSharedMemory); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace gpu | 77 } // namespace gpu |
78 | 78 |
79 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_ | 79 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_ |
OLD | NEW |