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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_x11.cc

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: Add GpuMemoryBufferFactory interface Created 6 years, 6 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.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_x11.cc b/content/common/gpu/gpu_memory_buffer_factory_x11.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8c36b24ead542562e1a1b02be64e4aa5a10639bf
--- /dev/null
+++ b/content/common/gpu/gpu_memory_buffer_factory_x11.cc
@@ -0,0 +1,56 @@
+// 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.
+
+#include "content/common/gpu/gpu_memory_buffer_factory.h"
+
+#include "content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h"
+
+namespace content {
+
+// static
+void GpuMemoryBufferFactory::Initialize() {
+ GpuMemoryBufferFactoryX11Pixmap::Initialize();
+}
+
+// static
+bool GpuMemoryBufferFactory::CreateGpuMemoryBuffer(
+ const gfx::GpuMemoryBufferHandle& handle,
+ const gfx::Size& size,
+ unsigned internalformat,
+ unsigned usage) {
+ switch (handle.type) {
+ case gfx::X11_PIXMAP_BUFFER:
+ GpuMemoryBufferFactoryX11Pixmap::CreateGpuMemoryBuffer(handle);
+ return true;
+ default:
+ return false;
+ }
+}
+
+// static
+void GpuMemoryBufferFactory::DestroyGpuMemoryBuffer(
+ const gfx::GpuMemoryBufferHandle& handle) {
+ switch (handle.type) {
+ case gfx::X11_PIXMAP_BUFFER:
+ GpuMemoryBufferFactoryX11Pixmap::DestroyGpuMemoryBuffer(handle);
+ break;
+ default:
+ break;
+ }
+}
+
+// static
+bool GpuMemoryBufferFactory::RequestAccessToGpuMemoryBuffer(
+ const gfx::GpuMemoryBufferHandle& handle,
+ int client_id) {
+ switch (handle.type) {
+ case gfx::X11_PIXMAP_BUFFER:
+ return GpuMemoryBufferFactoryX11Pixmap::RequestAccessToGpuMemoryBuffer(
+ handle, client_id);
+ default:
+ return true;
+ }
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698