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