| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_IO_SURFACE_H_ | 5 #ifndef GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_ |
| 6 #define GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_ | 6 #define GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_ |
| 7 | 7 |
| 8 #include <IOSurface/IOSurface.h> | 8 #include <IOSurface/IOSurface.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 | 11 |
| 12 #include <memory> |
| 13 |
| 12 #include "base/mac/scoped_cftyperef.h" | 14 #include "base/mac/scoped_cftyperef.h" |
| 13 #include "base/macros.h" | 15 #include "base/macros.h" |
| 14 #include "gpu/gpu_export.h" | 16 #include "gpu/gpu_export.h" |
| 15 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" | 17 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" |
| 16 | 18 |
| 17 namespace gpu { | 19 namespace gpu { |
| 18 | 20 |
| 19 // Implementation of GPU memory buffer based on IO surfaces. | 21 // Implementation of GPU memory buffer based on IO surfaces. |
| 20 class GPU_EXPORT GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl { | 22 class GPU_EXPORT GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl { |
| 21 public: | 23 public: |
| 22 ~GpuMemoryBufferImplIOSurface() override; | 24 ~GpuMemoryBufferImplIOSurface() override; |
| 23 | 25 |
| 24 static scoped_ptr<GpuMemoryBufferImplIOSurface> CreateFromHandle( | 26 static std::unique_ptr<GpuMemoryBufferImplIOSurface> CreateFromHandle( |
| 25 const gfx::GpuMemoryBufferHandle& handle, | 27 const gfx::GpuMemoryBufferHandle& handle, |
| 26 const gfx::Size& size, | 28 const gfx::Size& size, |
| 27 gfx::BufferFormat format, | 29 gfx::BufferFormat format, |
| 28 gfx::BufferUsage usage, | 30 gfx::BufferUsage usage, |
| 29 const DestructionCallback& callback); | 31 const DestructionCallback& callback); |
| 30 | 32 |
| 31 static bool IsConfigurationSupported(gfx::BufferFormat format, | 33 static bool IsConfigurationSupported(gfx::BufferFormat format, |
| 32 gfx::BufferUsage usage); | 34 gfx::BufferUsage usage); |
| 33 | 35 |
| 34 static base::Closure AllocateForTesting(const gfx::Size& size, | 36 static base::Closure AllocateForTesting(const gfx::Size& size, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 54 | 56 |
| 55 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; | 57 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
| 56 uint32_t lock_flags_; | 58 uint32_t lock_flags_; |
| 57 | 59 |
| 58 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface); | 60 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface); |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 } // namespace gpu | 63 } // namespace gpu |
| 62 | 64 |
| 63 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_ | 65 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_ |
| OLD | NEW |