| Index: content/common/gpu/client/gpu_memory_buffer_impl_dma_buf.h
|
| ===================================================================
|
| --- content/common/gpu/client/gpu_memory_buffer_impl_dma_buf.h (revision 0)
|
| +++ content/common/gpu/client/gpu_memory_buffer_impl_dma_buf.h (revision 0)
|
| @@ -0,0 +1,40 @@
|
| +// Copyright 2014 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_DMA_BUF_H_
|
| +#define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_DMA_BUF_H_
|
| +
|
| +#include "content/common/gpu/client/gpu_memory_buffer_impl.h"
|
| +struct gbm_bo;
|
| +namespace content {
|
| +class GBMWrapper;
|
| +// Provides implementation of a GPU memory buffer based
|
| +// on an Dma_buf handle.
|
| +class GpuMemoryBufferImplDMABuf : public GpuMemoryBufferImpl {
|
| + public:
|
| + GpuMemoryBufferImplDMABuf(gfx::Size size, unsigned internalformat);
|
| + virtual ~GpuMemoryBufferImplDMABuf();
|
| +
|
| + static bool IsFormatSupported(unsigned internalformat);
|
| +
|
| + bool Initialize(gfx::GpuMemoryBufferHandle handle);
|
| +
|
| + // Overridden from gfx::GpuMemoryBuffer:
|
| + virtual void* Map() OVERRIDE;
|
| + virtual void Unmap() OVERRIDE;
|
| + virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE;
|
| + virtual uint32 GetStride() const OVERRIDE;
|
| +
|
| + private:
|
| + int dma_buf_id_;
|
| + void* mapped_addr_;
|
| + uint32_t stride_;
|
| + struct gbm_bo* tex_bo_;
|
| + static GBMWrapper* wrapper_;
|
| + DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplDMABuf);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_DMA_BUF_H_
|
|
|