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

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

Issue 331723003: gpu: Remove Create/DeleteImage IPC by adding an X11_PIXMAP_BUFFER GpuMemoryBuffer type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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_x11_pixmap.h
diff --git a/content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h b/content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h
new file mode 100644
index 0000000000000000000000000000000000000000..e93a0b2207e698511da359fbc71a8973cc13b506
--- /dev/null
+++ b/content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h
@@ -0,0 +1,46 @@
+// 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_X11_PIXMAP_H_
+#define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_X11_PIXMAP_H_
+
+#include "base/containers/hash_tables.h"
+#include "base/memory/ref_counted.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+#include "ui/gfx/x/x11_types.h"
+
+namespace gfx {
+class GLImage;
+}
+
+namespace content {
+
+class GpuMemoryBufferFactoryX11Pixmap {
+ public:
+ GpuMemoryBufferFactoryX11Pixmap();
+ ~GpuMemoryBufferFactoryX11Pixmap();
+
+ // Create a GPU memory buffer for an existing X11 pixmap.
+ void CreateGpuMemoryBuffer(const gfx::GpuMemoryBufferId& id, XID pixmap);
+
+ // Destroy a previously created GPU memory buffer.
+ void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferId& id);
+
+ // Creates a GLImage instance for a GPU memory buffer. Successful completion
+ // moves ownership of GPU memory buffer to GLImage instance.
+ scoped_refptr<gfx::GLImage> AcquireImageForGpuMemoryBuffer(
+ const gfx::GpuMemoryBufferId& id,
+ const gfx::Size& size,
+ unsigned internalformat);
+
+ private:
+ typedef std::pair<int, int> X11PixmapMapKey;
+ typedef base::hash_map<X11PixmapMapKey, XID> X11PixmapMap;
+ X11PixmapMap pixmaps_;
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_X11_PIXMAP_H_
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_x11.cc ('k') | content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698