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

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

Issue 225023009: Add Intel DRM backed GpuMemoryBuffer implementation. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typos Created 6 years, 8 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 | Annotate | Revision Log
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(AccessMode mode) OVERRIDE;
35 virtual void Unmap() OVERRIDE;
36 virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE;
37
38 private:
39 drm_intel_bo* buffer_object_;
40
41 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIntelDRM);
42 };
43
44 } // namespace content
45
46 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_INTEL_DRM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698