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

Unified 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: fix overflow check 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h b/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h
new file mode 100644
index 0000000000000000000000000000000000000000..da2936a38002157ded0f914220e8e86ba6b5417c
--- /dev/null
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h
@@ -0,0 +1,42 @@
+// Copyright 2013 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_IO_SURFACE_H_
+#define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
+
+#include "base/mac/scoped_cftyperef.h"
+#include "content/common/gpu/client/gpu_memory_buffer_impl.h"
+
+class IOSurfaceSupport;
+
+namespace content {
+
+// Provides implementation of a GPU memory buffer based
+// on an IO surface handle.
+class GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl {
+ public:
+ GpuMemoryBufferImplIOSurface(gfx::Size size, unsigned internalformat);
+ virtual ~GpuMemoryBufferImplIOSurface();
+
+ static bool IsFormatSupported(unsigned internalformat);
+ static uint32 PixelFormat(unsigned internalformat);
+
+ bool Initialize(gfx::GpuMemoryBufferHandle handle);
+
+ // Overridden from gfx::GpuMemoryBuffer:
+ virtual void Map(AccessMode mode, void** vaddr) OVERRIDE;
+ virtual void Unmap() OVERRIDE;
+ virtual uint32 GetStride() const OVERRIDE;
+ virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE;
+
+ private:
+ IOSurfaceSupport* io_surface_support_;
+ base::ScopedCFTypeRef<CFTypeRef> io_surface_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_

Powered by Google App Engine
This is Rietveld 408576698