| 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> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "gpu/gpu_export.h" | 13 #include "gpu/gpu_export.h" |
| 14 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" | 14 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" |
| 15 | 15 |
| 16 namespace gpu { | 16 namespace gpu { |
| 17 | 17 |
| 18 // Implementation of GPU memory buffer based on shared memory. | 18 // Implementation of GPU memory buffer based on shared memory. |
| 19 class GPU_EXPORT GpuMemoryBufferImplSharedMemory : public GpuMemoryBufferImpl { | 19 class GPU_EXPORT GpuMemoryBufferImplSharedMemory : public GpuMemoryBufferImpl { |
| 20 public: | 20 public: |
| 21 ~GpuMemoryBufferImplSharedMemory() override; | 21 ~GpuMemoryBufferImplSharedMemory() override; |
| 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 AllocateGpuMemoryBuffer( | 29 static gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |
| 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 | 33 |
| 34 static std::unique_ptr<GpuMemoryBufferImplSharedMemory> CreateFromHandle( | 34 static std::unique_ptr<GpuMemoryBufferImplSharedMemory> CreateFromHandle( |
| 35 const gfx::GpuMemoryBufferHandle& handle, | 35 const gfx::GpuMemoryBufferHandle& handle, |
| 36 const gfx::Size& size, | 36 const gfx::Size& size, |
| 37 gfx::BufferFormat format, | 37 gfx::BufferFormat format, |
| 38 gfx::BufferUsage usage, | 38 gfx::BufferUsage usage, |
| 39 const DestructionCallback& callback); | 39 const DestructionCallback& callback); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 69 std::unique_ptr<base::SharedMemory> shared_memory_; | 69 std::unique_ptr<base::SharedMemory> shared_memory_; |
| 70 size_t offset_; | 70 size_t offset_; |
| 71 int stride_; | 71 int stride_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSharedMemory); | 73 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSharedMemory); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace gpu | 76 } // namespace gpu |
| 77 | 77 |
| 78 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_ | 78 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SHARED_MEMORY_H_ |
| OLD | NEW |