summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 23:25:23 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 23:25:23 +0000
commit290fc49d46142b94f9c7754c8c3cf36408b9a269 (patch)
treed42113d9b5be8c7e8e7ef94dbdb6d949a5325d69 /content/browser/gpu
parent5902f29b579cba7f1a11b2b6d02b5d3a1f4516cf (diff)
downloadchromium_src-290fc49d46142b94f9c7754c8c3cf36408b9a269.zip
chromium_src-290fc49d46142b94f9c7754c8c3cf36408b9a269.tar.gz
chromium_src-290fc49d46142b94f9c7754c8c3cf36408b9a269.tar.bz2
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. Original Review URL: http://codereview.chromium.org/8060045 Review URL: http://codereview.chromium.org/8622004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu')
-rw-r--r--content/browser/gpu/gpu_process_host_ui_shim.cc30
-rw-r--r--content/browser/gpu/gpu_process_host_ui_shim.h7
2 files changed, 13 insertions, 24 deletions
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index 04c2f67..c565484 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -172,12 +172,12 @@ bool GpuProcessHostUIShim::OnControlMessageReceived(
IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage,
OnLogMessage)
#if defined(TOOLKIT_USES_GTK) || defined(OS_WIN)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
+ OnAcceleratedSurfaceBuffersSwapped)
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
@@ -186,6 +186,7 @@ bool GpuProcessHostUIShim::OnControlMessageReceived(
IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceRelease,
OnAcceleratedSurfaceRelease)
#endif
+
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
@@ -207,15 +208,14 @@ void GpuProcessHostUIShim::OnLogMessage(
void GpuProcessHostUIShim::OnResizeView(int32 renderer_id,
int32 render_view_id,
- int32 command_buffer_route_id,
+ int32 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 GpuMsg_ResizeViewACK(renderer_id,
- command_buffer_route_id));
+ new AcceleratedSurfaceMsg_ResizeViewACK(route_id));
RenderViewHost* host = RenderViewHost::FromID(renderer_id, render_view_id);
if (!host)
@@ -312,6 +312,8 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceNew(
params.route_id, surface_id, surface_handle));
}
+#endif
+
void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) {
TRACE_EVENT0("renderer",
@@ -332,24 +334,10 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
delayed_send.Cancel();
-#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
+ // View must send ACK message after next composite.
+ view->AcceleratedSurfaceBuffersSwapped(params, host_id_);
}
-#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 ca54d2e..d4f566f 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.h
+++ b/content/browser/gpu/gpu_process_host_ui_shim.h
@@ -90,15 +90,16 @@ class GpuProcessHostUIShim
#if defined(TOOLKIT_USES_GTK) || defined(OS_WIN)
void OnResizeView(int32 renderer_id,
int32 render_view_id,
- int32 command_buffer_route_id,
+ int32 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)