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 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 // Implementation of GPU memory buffer based on Ozone native buffers. | 12 // Implementation of GPU memory buffer based on Ozone native buffers. |
13 class GpuMemoryBufferImplOzoneNativeBuffer : public GpuMemoryBufferImpl { | 13 class GpuMemoryBufferImplOzoneNativeBuffer : public GpuMemoryBufferImpl { |
14 public: | 14 public: |
15 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( | 15 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( |
16 const gfx::GpuMemoryBufferHandle& handle, | 16 const gfx::GpuMemoryBufferHandle& handle, |
17 const gfx::Size& size, | 17 const gfx::Size& size, |
18 Format format, | 18 Format format, |
19 const DestructionCallback& callback); | 19 const DestructionCallback& callback); |
20 | 20 |
21 // Overridden from gfx::GpuMemoryBuffer: | 21 // Overridden from gfx::GpuMemoryBuffer: |
22 bool Map(void** data) override; | 22 bool Map(void** data) override; |
23 void Unmap() override; | 23 void Unmap() override; |
24 void GetStride(int* stride) const override; | 24 void GetStride(int* stride) const override; |
25 gfx::GpuMemoryBufferHandle GetHandle() const override; | 25 gfx::GpuMemoryBufferHandle GetHandle() const override; |
26 | 26 |
27 private: | 27 protected: |
| 28 ~GpuMemoryBufferImplOzoneNativeBuffer() override; |
28 GpuMemoryBufferImplOzoneNativeBuffer(gfx::GpuMemoryBufferId id, | 29 GpuMemoryBufferImplOzoneNativeBuffer(gfx::GpuMemoryBufferId id, |
29 const gfx::Size& size, | 30 const gfx::Size& size, |
30 Format format, | 31 Format format, |
31 const DestructionCallback& callback); | 32 const DestructionCallback& callback); |
32 ~GpuMemoryBufferImplOzoneNativeBuffer() override; | |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativeBuffer); | 34 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativeBuffer); |
35 }; | 35 }; |
36 | 36 |
37 } // namespace content | 37 } // namespace content |
38 | 38 |
39 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_BUFFER_
H_ | 39 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_NATIVE_BUFFER_
H_ |
OLD | NEW |