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: |
| 19 ~GpuMemoryBufferImplOzoneNativePixmap() override; |
| 20 |
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); |
21 | 27 |
22 // Overridden from gfx::GpuMemoryBuffer: | 28 // Overridden from gfx::GpuMemoryBuffer: |
23 bool Map(void** data) override; | 29 bool Map(void** data) override; |
24 void Unmap() override; | 30 void Unmap() override; |
25 void GetStride(int* stride) const override; | 31 void GetStride(int* stride) const override; |
26 gfx::GpuMemoryBufferHandle GetHandle() const override; | 32 gfx::GpuMemoryBufferHandle GetHandle() const override; |
27 | 33 |
28 private: | 34 private: |
29 GpuMemoryBufferImplOzoneNativePixmap(gfx::GpuMemoryBufferId id, | 35 GpuMemoryBufferImplOzoneNativePixmap( |
30 const gfx::Size& size, | 36 gfx::GpuMemoryBufferId id, |
31 gfx::BufferFormat format, | 37 const gfx::Size& size, |
32 const DestructionCallback& callback); | 38 gfx::BufferFormat format, |
33 ~GpuMemoryBufferImplOzoneNativePixmap() override; | 39 const DestructionCallback& callback, |
| 40 scoped_ptr<ui::ClientNativePixmap> native_pixmap); |
| 41 |
| 42 scoped_ptr<ui::ClientNativePixmap> pixmap_; |
34 | 43 |
35 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativePixmap); | 44 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativePixmap); |
36 }; | 45 }; |
37 | 46 |
38 } // namespace content | 47 } // namespace content |
39 | 48 |
40 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_PIXMAP_
H_ | 49 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_PIXMAP_
H_ |
OLD | NEW |