OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_H_ | |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_H_ | |
7 | |
8 #include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h " | |
9 | |
10 struct gbm_bo; | |
11 | |
12 namespace content { | |
13 | |
14 // Implementation of GPU memory buffer based on Ozone GBM. | |
15 class GpuMemoryBufferImplOzoneGbm | |
reveman
2015/05/11 16:40:56
We shouldn't have multiple Ozone abstractions for
dshwang
2015/05/11 17:11:53
it's directly related to spang's concern also.
Gpu
dshwang
2015/05/14 12:25:46
I understand. I merge this into OzoneNativeBuffer.
| |
16 : public GpuMemoryBufferImplOzoneNativeBuffer { | |
17 public: | |
18 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( | |
19 const gfx::GpuMemoryBufferHandle& handle, | |
20 const gfx::Size& size, | |
21 Format format, | |
22 const DestructionCallback& callback); | |
23 ~GpuMemoryBufferImplOzoneGbm() override; | |
24 | |
25 // Overridden from gfx::GpuMemoryBuffer: | |
26 bool Map(void** data) override; | |
27 void Unmap() override; | |
28 void GetStride(int* stride) const override; | |
29 gfx::GpuMemoryBufferHandle GetHandle() const override; | |
30 | |
31 private: | |
32 GpuMemoryBufferImplOzoneGbm(gfx::GpuMemoryBufferId id, | |
33 const gfx::Size& size, | |
34 Format format, | |
35 const DestructionCallback& callback); | |
36 | |
37 bool Initialize(const gfx::GpuMemoryBufferHandle& handle); | |
38 | |
39 uint32_t vgem_bo_handle_; | |
40 base::ScopedFD dma_buf_; | |
41 size_t stride_; | |
42 void* mmap_ptr_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneGbm); | |
45 }; | |
46 | |
47 } // namespace content | |
48 | |
49 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_H_ | |
OLD | NEW |