diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 20:47:53 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 20:47:53 +0000 |
commit | f47eab90bd93f070e2e0bacadcc5ab6e3a6c72a4 (patch) | |
tree | 29fd2fd64e5e034c08e014eb40b0d65aede17a45 /content/browser/gpu | |
parent | 57cb8724500e883bce61d1fe9abbef3b423c9af7 (diff) | |
download | chromium_src-f47eab90bd93f070e2e0bacadcc5ab6e3a6c72a4.zip chromium_src-f47eab90bd93f070e2e0bacadcc5ab6e3a6c72a4.tar.gz chromium_src-f47eab90bd93f070e2e0bacadcc5ab6e3a6c72a4.tar.bz2 |
Revert 110548 - Reland 110355 - Use shared D3D9 texture to transport the compositor's backing buffer to the browser process for presentation.
Implemented ImageTransportSurface for Linux (without texture sharing), XP, Vista and 7. XP. The non-texture sharing Linux and XP paths just present directly to the compositing child window owned by the browser process as before.
PassThroughImageTransportSurface still needs a proper name. I will move it into its own file once that is decided.
I moved AcceleratedSurfaceBuffersSwapped outside of the platform specific ifdefs and made the signature the same on all platforms for greater consistency.
I removed the code related to sharing surfaces between processes and synchronizing resize and swapping out of GpuCommandBufferStub. It is all now in ImageTransportSurface implementations.
Review URL: http://codereview.chromium.org/8060045
TBR=cpu@chromium.org
Review URL: http://codereview.chromium.org/8591006
TBR=apatrick@chromium.org
Review URL: http://codereview.chromium.org/8574071
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110551 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu')
-rw-r--r-- | content/browser/gpu/gpu_process_host_ui_shim.cc | 31 | ||||
-rw-r--r-- | content/browser/gpu/gpu_process_host_ui_shim.h | 12 |
2 files changed, 29 insertions, 14 deletions
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc index 0615c42..de484b3 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.cc +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc @@ -173,14 +173,13 @@ bool GpuProcessHostUIShim::OnControlMessageReceived( IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, OnLogMessage) - IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, - OnAcceleratedSurfaceBuffersSwapped) - #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) || defined(OS_WIN) IPC_MESSAGE_HANDLER(GpuHostMsg_ResizeView, OnResizeView) #endif #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) + IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, + OnAcceleratedSurfaceBuffersSwapped) IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceNew, OnAcceleratedSurfaceNew) #endif @@ -189,7 +188,6 @@ bool GpuProcessHostUIShim::OnControlMessageReceived( IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceRelease, OnAcceleratedSurfaceRelease) #endif - IPC_MESSAGE_UNHANDLED_ERROR() IPC_END_MESSAGE_MAP() @@ -211,14 +209,15 @@ void GpuProcessHostUIShim::OnLogMessage( void GpuProcessHostUIShim::OnResizeView(int32 renderer_id, int32 render_view_id, - int32 route_id, + int32 command_buffer_route_id, gfx::Size size) { // Always respond even if the window no longer exists. The GPU process cannot // make progress on the resizing command buffer until it receives the // response. ScopedSendOnIOThread delayed_send( host_id_, - new AcceleratedSurfaceMsg_ResizeViewACK(route_id)); + new GpuMsg_ResizeViewACK(renderer_id, + command_buffer_route_id)); RenderViewHost* host = RenderViewHost::FromID(renderer_id, render_view_id); if (!host) @@ -315,8 +314,6 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceNew( params.route_id, surface_id, surface_handle)); } -#endif - void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { TRACE_EVENT0("renderer", @@ -337,10 +334,24 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( delayed_send.Cancel(); - // View must send ACK message after next composite. - view->AcceleratedSurfaceBuffersSwapped(params, host_id_); +#if defined (OS_MACOSX) + view->AcceleratedSurfaceBuffersSwapped( + // Parameters needed to swap the IOSurface. + params.window, + params.surface_id, + // Parameters needed to formulate an acknowledgment. + params.renderer_id, + params.route_id, + host_id_); +#else // defined(UI_COMPOSITOR_IMAGE_TRANSPORT) + // view must send ACK message after next composite + view->AcceleratedSurfaceBuffersSwapped( + params.surface_id, params.route_id, host_id_); +#endif } +#endif + #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( diff --git a/content/browser/gpu/gpu_process_host_ui_shim.h b/content/browser/gpu/gpu_process_host_ui_shim.h index 0cbcb3a..6a1f057 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.h +++ b/content/browser/gpu/gpu_process_host_ui_shim.h @@ -74,7 +74,12 @@ class CONTENT_EXPORT GpuProcessHostUIShim // actually received on the IO thread. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; +#if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) + // TODO(apatrick): Remove this when mac does not use AcceleratedSurfaces for + // when running the GPU thread in the browser process. + // This is now also used in TOUCH_UI builds. static void SendToGpuHost(int host_id, IPC::Message* msg); +#endif private: explicit GpuProcessHostUIShim(int host_id); @@ -89,16 +94,15 @@ class CONTENT_EXPORT GpuProcessHostUIShim defined(OS_WIN) void OnResizeView(int32 renderer_id, int32 render_view_id, - int32 route_id, + int32 command_buffer_route_id, gfx::Size size); #endif - void OnAcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); - #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) void OnAcceleratedSurfaceNew( const GpuHostMsg_AcceleratedSurfaceNew_Params& params); + void OnAcceleratedSurfaceBuffersSwapped( + const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); #endif #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |