| 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 CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_PIXMAP_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_PIXMAP_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_PIXMAP_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_PIXMAP_H_ |
| 7 | 7 |
| 8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" | 8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
| 9 | 9 |
| 10 namespace ui { |
| 11 |
| 12 class ClientNativePixmap; |
| 13 |
| 14 } // namespace ui |
| 15 |
| 10 namespace content { | 16 namespace content { |
| 11 | 17 |
| 12 // Implementation of GPU memory buffer based on Ozone native pixmap. | 18 // Implementation of GPU memory buffer based on Ozone native pixmap. |
| 13 class GpuMemoryBufferImplOzoneNativePixmap : public GpuMemoryBufferImpl { | 19 class GpuMemoryBufferImplOzoneNativePixmap : public GpuMemoryBufferImpl { |
| 14 public: | 20 public: |
| 15 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( | 21 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( |
| 16 const gfx::GpuMemoryBufferHandle& handle, | 22 const gfx::GpuMemoryBufferHandle& handle, |
| 17 const gfx::Size& size, | 23 const gfx::Size& size, |
| 18 gfx::BufferFormat format, | 24 gfx::BufferFormat format, |
| 19 gfx::BufferUsage usage, | 25 gfx::BufferUsage usage, |
| 20 const DestructionCallback& callback); | 26 const DestructionCallback& callback); |
| 27 ~GpuMemoryBufferImplOzoneNativePixmap() override; |
| 21 | 28 |
| 22 // Overridden from gfx::GpuMemoryBuffer: | 29 // Overridden from gfx::GpuMemoryBuffer: |
| 23 bool Map(void** data) override; | 30 bool Map(void** data) override; |
| 24 void Unmap() override; | 31 void Unmap() override; |
| 25 void GetStride(int* stride) const override; | 32 void GetStride(int* stride) const override; |
| 26 gfx::GpuMemoryBufferHandle GetHandle() const override; | 33 gfx::GpuMemoryBufferHandle GetHandle() const override; |
| 27 | 34 |
| 28 private: | 35 private: |
| 29 GpuMemoryBufferImplOzoneNativePixmap(gfx::GpuMemoryBufferId id, | 36 GpuMemoryBufferImplOzoneNativePixmap(gfx::GpuMemoryBufferId id, |
| 30 const gfx::Size& size, | 37 const gfx::Size& size, |
| 31 gfx::BufferFormat format, | 38 gfx::BufferFormat format, |
| 39 gfx::BufferUsage usage, |
| 32 const DestructionCallback& callback); | 40 const DestructionCallback& callback); |
| 33 ~GpuMemoryBufferImplOzoneNativePixmap() override; | 41 |
| 42 bool Initialize(const gfx::GpuMemoryBufferHandle& handle); |
| 43 |
| 44 scoped_ptr<ui::ClientNativePixmap> pixmap_; |
| 45 gfx::BufferUsage usage_; |
| 34 | 46 |
| 35 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativePixmap); | 47 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativePixmap); |
| 36 }; | 48 }; |
| 37 | 49 |
| 38 } // namespace content | 50 } // namespace content |
| 39 | 51 |
| 40 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_PIXMAP_
H_ | 52 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_PIXMAP_
H_ |
| OLD | NEW |