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

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

Issue 77023002: gpu: Add IOSurface backed GpuMemoryBuffer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 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_IO_SURFACE_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
7
8 #include "base/mac/scoped_cftyperef.h"
9 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
10
11 namespace content {
12
13 // Provides implementation of a GPU memory buffer based
14 // on an IO surface handle.
15 class GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl {
16 public:
17 GpuMemoryBufferImplIOSurface(gfx::Size size, unsigned internalformat);
18 virtual ~GpuMemoryBufferImplIOSurface();
19
20 static bool IsFormatValid(unsigned internalformat);
21 static uint32 PixelFormat(unsigned internalformat);
22
23 bool Initialize(gfx::GpuMemoryBufferHandle handle);
24
25 // Overridden from gfx::GpuMemoryBuffer:
26 virtual void Map(AccessMode mode, void** vaddr) OVERRIDE;
27 virtual void Unmap() OVERRIDE;
28 virtual uint32 GetStride() const OVERRIDE;
29 virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE;
30
31 private:
32 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface);
33
34 base::ScopedCFTypeRef<CFTypeRef> io_surface_;
35 };
36
37 } // namespace content
38
39 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698