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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_io_surface.h

Issue 604903005: content: Move IOSurface backed GpuMemoryBuffer allocation to GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include CoreFoundation.h Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/gpu_memory_buffer_factory_io_surface.h
diff --git a/content/common/gpu/gpu_memory_buffer_factory_io_surface.h b/content/common/gpu/gpu_memory_buffer_factory_io_surface.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ff70953daadec52e551e7bd92ef53643b18120b
--- /dev/null
+++ b/content/common/gpu/gpu_memory_buffer_factory_io_surface.h
@@ -0,0 +1,52 @@
+// Copyright 2014 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_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
+#define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
+
+#include <IOSurface/IOSurfaceAPI.h>
+
+#include "base/containers/hash_tables.h"
+#include "base/mac/scoped_cftyperef.h"
+#include "base/memory/ref_counted.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+
+namespace gfx {
+class GLImage;
+}
+
+namespace content {
+
+class GpuMemoryBufferFactoryIOSurface {
+ public:
+ GpuMemoryBufferFactoryIOSurface();
+ ~GpuMemoryBufferFactoryIOSurface();
+
+ // Creates a IOSurface backed GPU memory buffer with |size| and
+ // |internalformat|. A valid handle is returned on success.
+ gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
+ const gfx::GpuMemoryBufferId& id,
+ const gfx::Size& size,
+ unsigned internalformat);
+
+ // Destroy a previously created GPU memory buffer.
+ void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferId& id);
+
+ // Creates a GLImage instance for a GPU memory buffer.
+ scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
+ const gfx::GpuMemoryBufferId& id,
+ const gfx::Size& size,
+ unsigned internalformat);
+
+ private:
+ typedef std::pair<int, int> IOSurfaceMapKey;
+ typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>>
+ IOSurfaceMap;
+ IOSurfaceMap io_surfaces_;
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl_mac.cc ('k') | content/common/gpu/gpu_memory_buffer_factory_io_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698