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_BUFFER_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_BUFFER_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_BUFFER_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_BUFFER_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 #include "ui/ozone/public/native_pixmap_manager.h" | |
9 | 10 |
10 namespace content { | 11 namespace content { |
11 | 12 |
12 // Implementation of GPU memory buffer based on Ozone native buffers. | 13 // Implementation of GPU memory buffer based on Ozone native buffers. |
13 class GpuMemoryBufferImplOzoneNativeBuffer : public GpuMemoryBufferImpl { | 14 class GpuMemoryBufferImplOzoneNativeBuffer : public GpuMemoryBufferImpl { |
reveman
2015/06/25 14:07:51
There's now both OzoneNativeBuffer and NativePixma
dshwang
2015/06/25 14:52:13
I think GpuMemoryBufferFactoryOzoneNativeBuffer an
| |
14 public: | 15 public: |
15 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( | 16 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( |
17 ui::NativePixmapManager* manager, | |
16 const gfx::GpuMemoryBufferHandle& handle, | 18 const gfx::GpuMemoryBufferHandle& handle, |
17 const gfx::Size& size, | 19 const gfx::Size& size, |
18 Format format, | 20 Format format, |
19 Usage usage, | 21 Usage usage, |
20 const DestructionCallback& callback); | 22 const DestructionCallback& callback); |
21 | 23 |
24 ~GpuMemoryBufferImplOzoneNativeBuffer() override; | |
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 GpuMemoryBufferImplOzoneNativeBuffer(gfx::GpuMemoryBufferId id, | 33 GpuMemoryBufferImplOzoneNativeBuffer(gfx::GpuMemoryBufferId id, |
30 const gfx::Size& size, | 34 const gfx::Size& size, |
31 Format format, | 35 Format format, |
36 Usage usage, | |
32 const DestructionCallback& callback); | 37 const DestructionCallback& callback); |
33 ~GpuMemoryBufferImplOzoneNativeBuffer() override; | 38 |
39 bool Initialize(ui::NativePixmapManager* manager, | |
40 const gfx::GpuMemoryBufferHandle& handle); | |
41 | |
42 scoped_refptr<ui::NativePixmap> pixmap_; | |
43 Usage usage_; | |
34 | 44 |
35 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativeBuffer); | 45 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativeBuffer); |
36 }; | 46 }; |
37 | 47 |
38 } // namespace content | 48 } // namespace content |
39 | 49 |
40 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_BUFFER_ H_ | 50 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_BUFFER_ H_ |
OLD | NEW |