Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_dma_buf.h

Issue 288343004: working copy of "zero_copy" Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/client/gpu_memory_buffer_impl_dma_buf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698