| 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> | 12 #include <memory> |
| 13 | 13 |
| 14 #include "base/mac/scoped_cftyperef.h" | 14 #include "base/mac/scoped_cftyperef.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "gpu/gpu_export.h" | 16 #include "gpu/gpu_export.h" |
| 17 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" | 17 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" |
| 18 #include "ui/gfx/color_space.h" |
| 18 | 19 |
| 19 namespace gpu { | 20 namespace gpu { |
| 20 | 21 |
| 21 // Implementation of GPU memory buffer based on IO surfaces. | 22 // Implementation of GPU memory buffer based on IO surfaces. |
| 22 class GPU_EXPORT GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl { | 23 class GPU_EXPORT GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl { |
| 23 public: | 24 public: |
| 24 ~GpuMemoryBufferImplIOSurface() override; | 25 ~GpuMemoryBufferImplIOSurface() override; |
| 25 | 26 |
| 26 static std::unique_ptr<GpuMemoryBufferImplIOSurface> CreateFromHandle( | 27 static std::unique_ptr<GpuMemoryBufferImplIOSurface> CreateFromHandle( |
| 27 const gfx::GpuMemoryBufferHandle& handle, | 28 const gfx::GpuMemoryBufferHandle& handle, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 49 private: | 50 private: |
| 50 GpuMemoryBufferImplIOSurface(gfx::GpuMemoryBufferId id, | 51 GpuMemoryBufferImplIOSurface(gfx::GpuMemoryBufferId id, |
| 51 const gfx::Size& size, | 52 const gfx::Size& size, |
| 52 gfx::BufferFormat format, | 53 gfx::BufferFormat format, |
| 53 const DestructionCallback& callback, | 54 const DestructionCallback& callback, |
| 54 IOSurfaceRef io_surface, | 55 IOSurfaceRef io_surface, |
| 55 uint32_t lock_flags); | 56 uint32_t lock_flags); |
| 56 | 57 |
| 57 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; | 58 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
| 58 uint32_t lock_flags_; | 59 uint32_t lock_flags_; |
| 60 // Cache the color space, because re-assigning the same value can be |
| 61 // expensive. |
| 62 gfx::ColorSpace color_space_; |
| 59 | 63 |
| 60 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface); | 64 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface); |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 } // namespace gpu | 67 } // namespace gpu |
| 64 | 68 |
| 65 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_ | 69 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_ |
| OLD | NEW |