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_INTEL_H_ | |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_INTEL_H_ | |
7 | |
8 extern "C" { | |
9 #include <libdrm/intel_bufmgr.h> | |
10 } | |
11 | |
12 #include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h " | |
13 | |
14 namespace content { | |
15 | |
16 // Implementation of GPU memory buffer based on Ozone GBM libdrm_intel.so. | |
17 class GpuMemoryBufferImplOzoneGbmIntel | |
reveman
2015/04/13 00:46:13
It should either be implemented behind OzoneNative
dshwang
2015/04/14 13:15:55
behind OzoneNativeBuffer. It's ozone specific beca
| |
18 : public GpuMemoryBufferImplOzoneNativeBuffer { | |
19 public: | |
20 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( | |
21 const gfx::GpuMemoryBufferHandle& handle, | |
22 const gfx::Size& size, | |
23 Format format, | |
24 const DestructionCallback& callback); | |
25 ~GpuMemoryBufferImplOzoneGbmIntel() override; | |
26 | |
27 // Overridden from gfx::GpuMemoryBuffer: | |
28 bool Map(void** data) override; | |
29 void Unmap() override; | |
30 void GetStride(uint32* stride) const override; | |
31 gfx::GpuMemoryBufferHandle GetHandle() const override; | |
32 | |
33 private: | |
34 GpuMemoryBufferImplOzoneGbmIntel(gfx::GpuMemoryBufferId id, | |
35 const gfx::Size& size, | |
36 Format format, | |
37 const DestructionCallback& callback); | |
38 | |
39 bool Initialize(const gfx::GpuMemoryBufferHandle& handle); | |
40 | |
41 drm_intel_bo* buffer_; | |
42 base::ScopedFD prime_fd_; | |
43 uint32 stride_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneGbmIntel); | |
46 }; | |
47 | |
48 } // namespace content | |
49 | |
50 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_INTEL_H_ | |
OLD | NEW |