Chromium Code Reviews| Index: content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm_intel.h |
| diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm_intel.h b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm_intel.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..46a0301194c4fa491009c1c0e6f6b6c87b948c73 |
| --- /dev/null |
| +++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm_intel.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_INTEL_H_ |
| +#define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_INTEL_H_ |
| + |
| +extern "C" { |
| +#include <libdrm/intel_bufmgr.h> |
| +} |
| + |
| +#include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h" |
| + |
| +namespace content { |
| + |
| +// Implementation of GPU memory buffer based on Ozone GBM libdrm_intel.so. |
| +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
|
| + : public GpuMemoryBufferImplOzoneNativeBuffer { |
| + public: |
| + static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( |
| + const gfx::GpuMemoryBufferHandle& handle, |
| + const gfx::Size& size, |
| + Format format, |
| + const DestructionCallback& callback); |
| + ~GpuMemoryBufferImplOzoneGbmIntel() override; |
| + |
| + // Overridden from gfx::GpuMemoryBuffer: |
| + bool Map(void** data) override; |
| + void Unmap() override; |
| + void GetStride(uint32* stride) const override; |
| + gfx::GpuMemoryBufferHandle GetHandle() const override; |
| + |
| + private: |
| + GpuMemoryBufferImplOzoneGbmIntel(gfx::GpuMemoryBufferId id, |
| + const gfx::Size& size, |
| + Format format, |
| + const DestructionCallback& callback); |
| + |
| + bool Initialize(const gfx::GpuMemoryBufferHandle& handle); |
| + |
| + drm_intel_bo* buffer_; |
| + base::ScopedFD prime_fd_; |
| + uint32 stride_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneGbmIntel); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_INTEL_H_ |