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

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

Issue 19762004: Add multi-process GpuMemoryBuffer framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 (c) 2013 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_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/gpu_memory_buffer.h"
10 #include "ui/gfx/size.h"
11
12 namespace content {
13
14 // Provides common implementation of a GPU memory buffer based
15 // on a shared memory handle.
16 class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
17 public:
18 GpuMemoryBufferImpl(scoped_ptr<base::SharedMemory> shared_memory,
19 size_t width,
20 size_t height,
21 unsigned internalformat);
22 virtual ~GpuMemoryBufferImpl();
23
24 // Overridden from gfx::GpuMemoryBuffer:
25 virtual void Map(AccessMode mode, void** vaddr) OVERRIDE;
26 virtual void Unmap() OVERRIDE;
27 virtual bool IsMapped() const OVERRIDE;
28 virtual uint32 GetStride() const OVERRIDE;
29 virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE;
30
31 static bool IsFormatValid(unsigned internalformat);
32 static size_t BytesPerPixel(unsigned internalformat);
33
34 private:
35 scoped_ptr<base::SharedMemory> shared_memory_;
36 const gfx::Size size_;
37 unsigned internalformat_;
38 bool mapped_;
39
40 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl);
41 };
42
43 } // namespace content
44
45 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/client/gpu_memory_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698