| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_DMA_BUF_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_DMA_BUF_H_ |
| 7 |
| 8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
| 9 struct gbm_bo; |
| 10 namespace content { |
| 11 class GBMWrapper; |
| 12 // Provides implementation of a GPU memory buffer based |
| 13 // on an Dma_buf handle. |
| 14 class GpuMemoryBufferImplDMABuf : public GpuMemoryBufferImpl { |
| 15 public: |
| 16 GpuMemoryBufferImplDMABuf(gfx::Size size, unsigned internalformat); |
| 17 virtual ~GpuMemoryBufferImplDMABuf(); |
| 18 |
| 19 static bool IsFormatSupported(unsigned internalformat); |
| 20 |
| 21 bool Initialize(gfx::GpuMemoryBufferHandle handle); |
| 22 |
| 23 // Overridden from gfx::GpuMemoryBuffer: |
| 24 virtual void* Map() OVERRIDE; |
| 25 virtual void Unmap() OVERRIDE; |
| 26 virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE; |
| 27 virtual uint32 GetStride() const OVERRIDE; |
| 28 |
| 29 private: |
| 30 int dma_buf_id_; |
| 31 void* mapped_addr_; |
| 32 uint32_t stride_; |
| 33 struct gbm_bo* tex_bo_; |
| 34 static GBMWrapper* wrapper_; |
| 35 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplDMABuf); |
| 36 }; |
| 37 |
| 38 } // namespace content |
| 39 |
| 40 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_DMA_BUF_H_ |
| OLD | NEW |