Chromium Code Reviews| 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); |
| }; |