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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_intel_drm.h

Issue 211133005: [WIP] Not for review. Zero copy. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
(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_INTEL_DRM_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_INTEL_DRM_H_
7
8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
9
10 typedef struct _drm_intel_bo drm_intel_bo;
11
12 namespace content {
13
14 // Provides implementation of a GPU memory buffer based on an intel DRM buffer
15 // object.
16 class GpuMemoryBufferImplIntelDRM : public GpuMemoryBufferImpl {
17 public:
18 GpuMemoryBufferImplIntelDRM(gfx::Size size, unsigned internalformat);
19 virtual ~GpuMemoryBufferImplIntelDRM();
20
21 static bool IsFormatSupported(unsigned internalformat);
22
23 static drm_intel_bo* CreateBufferObject(gfx::Size size,
24 unsigned internalformat);
25
26 static bool AllocateBufferObject(gfx::Size size,
27 unsigned internalformat,
28 base::SharedMemoryHandle* handle);
29
30 bool Initialize(gfx::GpuMemoryBufferHandle handle);
31 bool InitializeFromBufferObject(drm_intel_bo* buffer_object);
32
33 // Overridden from gfx::GpuMemoryBuffer:
34 virtual void* Map() OVERRIDE;
35 virtual void Unmap() OVERRIDE;
36 virtual uint32 GetStride() const OVERRIDE;
37 virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE;
38
39 private:
40 drm_intel_bo* buffer_object_;
41 base::ScopedFD prime_fd_;
42
43 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIntelDRM);
44 };
45
46 } // namespace content
47
48 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_INTEL_DRM_H_
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/client/gpu_memory_buffer_impl_intel_drm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698