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

Unified Diff: content/common/gpu/gpu_channel_manager.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: have GpuChannelManager implement X11PixmapTracker 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
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel_manager.h
diff --git a/content/common/gpu/gpu_channel_manager.h b/content/common/gpu/gpu_channel_manager.h
index 73b4e59ea5756c608fd4440c29d619dfc828daa8..ee06604a5ce247360e88d73c89f3b6c1daf34ec6 100644
--- a/content/common/gpu/gpu_channel_manager.h
+++ b/content/common/gpu/gpu_channel_manager.h
@@ -22,6 +22,10 @@
#include "ui/gfx/native_widget_types.h"
#include "ui/gl/gl_surface.h"
+#if defined(USE_X11)
+#include "ui/gl/x11_pixmap_tracker.h"
+#endif
+
namespace base {
class WaitableEvent;
}
@@ -55,7 +59,12 @@ class SyncPointManager;
// managing the lifetimes of GPU channels and forwarding IPC requests from the
// browser process to them based on the corresponding renderer ID.
class GpuChannelManager : public IPC::Listener,
- public IPC::Sender {
+ public IPC::Sender
+#if defined(USE_X11)
+ ,
+ public gfx::X11PixmapTracker
alexst (slow to review) 2014/06/13 19:15:57 I like this general style, but as you mentioned th
reveman 2014/06/13 19:27:56 I agree. This was a bad idea.
reveman 2014/06/13 20:55:06 Take a look at latest patch. It adds a GpuMemoryBu
+#endif
+ {
public:
GpuChannelManager(MessageRouter* router,
GpuWatchdog* watchdog,
@@ -72,6 +81,11 @@ class GpuChannelManager : public IPC::Listener,
// Sender overrides.
virtual bool Send(IPC::Message* msg) OVERRIDE;
+#if defined(USE_X11)
+ // X11PixmapTracker overrides.
+ virtual XID AcquirePixmap(int primary_id, int secondary_id) OVERRIDE;
+#endif
+
bool HandleMessagesScheduled();
uint64 MessagesProcessed();
@@ -121,9 +135,17 @@ class GpuChannelManager : public IPC::Listener,
const GPUCreateCommandBufferConfig& init_params,
int32 route_id);
void CreateImage(
- gfx::PluginWindowHandle window, int32 client_id, int32 image_id);
+ const gfx::GpuMemoryBufferHandle& handle,
+ const gfx::Size& size,
+ unsigned internalformat,
+ int32 client_id,
+ int32 image_id);
void OnCreateImage(
- gfx::PluginWindowHandle window, int32 client_id, int32 image_id);
+ const gfx::GpuMemoryBufferHandle& handle,
+ const gfx::Size& size,
+ unsigned internalformat,
+ int32 client_id,
+ int32 image_id);
void DeleteImage(int32 client_id, int32 image_id);
void OnDeleteImage(int32 client_id, int32 image_id, int32 sync_point);
void OnDeleteImageSyncPointRetired(ImageOperation*);
@@ -137,6 +159,11 @@ class GpuChannelManager : public IPC::Listener,
void OnLoseAllContexts();
+#if defined(USE_X11)
+ void AddPixmap(XID pixmap, int pixmap_id, int client_id);
+ void RemoveAllPixmaps(int client_id);
+#endif
+
scoped_refptr<base::MessageLoopProxy> io_message_loop_;
base::WaitableEvent* shutdown_event_;
@@ -158,6 +185,13 @@ class GpuChannelManager : public IPC::Listener,
scoped_refptr<gfx::GLSurface> default_offscreen_surface_;
ImageOperationQueue image_operations_;
+#if defined(USE_X11)
+ typedef std::pair<int, int> X11PixmapMapKey;
+ typedef base::hash_map<X11PixmapMapKey, XID> X11PixmapMap;
+ X11PixmapMap pixmaps_;
+ base::ThreadChecker thread_checker_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(GpuChannelManager);
};
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698