summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/render_widget_host_view_aura.cc
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-17 20:11:26 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-17 20:11:26 +0000
commit1269f0c982d224953bf85bb0a10610eeec5ee8ea (patch)
tree2588f1683e1180e69b814866782e5f3339a06a9a /content/browser/renderer_host/render_widget_host_view_aura.cc
parent05fcb9c7b86c1348d7ee3b37cc4aed26399542e1 (diff)
downloadchromium_src-1269f0c982d224953bf85bb0a10610eeec5ee8ea.zip
chromium_src-1269f0c982d224953bf85bb0a10610eeec5ee8ea.tar.gz
chromium_src-1269f0c982d224953bf85bb0a10610eeec5ee8ea.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. Review URL: http://codereview.chromium.org/8060045 TBR=cpu@chromium.org Review URL: http://codereview.chromium.org/8591006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/render_widget_host_view_aura.cc')
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc49
1 files changed, 26 insertions, 23 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index fe07237..c680595 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -285,45 +285,48 @@ BackingStore* RenderWidgetHostViewAura::AllocBackingStore(
void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() {
}
-
-#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
-void RenderWidgetHostViewAura::AcceleratedSurfaceNew(
- int32 width,
- int32 height,
- uint64* surface_id,
- TransportDIB::Handle* surface_handle) {
- scoped_refptr<AcceleratedSurfaceContainerLinux> surface(
- AcceleratedSurfaceContainerLinux::Create(gfx::Size(width, height)));
- if (!surface->Initialize(surface_id)) {
- LOG(ERROR) << "Failed to create AcceleratedSurfaceContainer";
- return;
- }
- *surface_handle = surface->Handle();
-
- accelerated_surface_containers_[*surface_id] = surface;
-}
-
void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(
- uint64 surface_id,
- int32 route_id,
+ const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
int gpu_host_id) {
+#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
window_->layer()->SetExternalTexture(
- accelerated_surface_containers_[surface_id]->GetTexture());
+ accelerated_surface_containers_[params.surface_id]->GetTexture());
glFlush();
if (!window_->layer()->GetCompositor()) {
// We have no compositor, so we have no way to display the surface
- AcknowledgeSwapBuffers(route_id, gpu_host_id); // Must still send the ACK
+ // Must still send the ACK.
+ AcknowledgeSwapBuffers(params.route_id, gpu_host_id);
} else {
window_->layer()->ScheduleDraw();
// Add sending an ACK to the list of things to do OnCompositingEnded
on_compositing_ended_callbacks_.push_back(
- base::Bind(AcknowledgeSwapBuffers, route_id, gpu_host_id));
+ base::Bind(AcknowledgeSwapBuffers, params.route_id, gpu_host_id));
ui::Compositor* compositor = window_->layer()->GetCompositor();
if (!compositor->HasObserver(this))
compositor->AddObserver(this);
}
+#else
+ NOTREACHED();
+#endif
+}
+
+#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
+void RenderWidgetHostViewAura::AcceleratedSurfaceNew(
+ int32 width,
+ int32 height,
+ uint64* surface_id,
+ TransportDIB::Handle* surface_handle) {
+ scoped_refptr<AcceleratedSurfaceContainerLinux> surface(
+ AcceleratedSurfaceContainerLinux::Create(gfx::Size(width, height)));
+ if (!surface->Initialize(surface_id)) {
+ LOG(ERROR) << "Failed to create AcceleratedSurfaceContainer";
+ return;
+ }
+ *surface_handle = surface->Handle();
+
+ accelerated_surface_containers_[*surface_id] = surface;
}
void RenderWidgetHostViewAura::AcceleratedSurfaceRelease(uint64 surface_id) {