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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 8060045: Use shared D3D9 texture to transport the compositor's backing buffer to the browser... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
===================================================================
--- content/browser/renderer_host/render_widget_host_view_aura.cc (revision 108480)
+++ content/browser/renderer_host/render_widget_host_view_aura.cc (working copy)
@@ -279,7 +279,32 @@
return new BackingStoreSkia(host_, size);
}
+void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(
+ const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
+ int gpu_host_id) {
jonathan.backer 2011/11/03 23:09:07 Bad merge? Diff shows edit in place below. Can we
#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
+ window_->layer()->SetExternalTexture(
+ 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
+ // 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, params.route_id, gpu_host_id));
+ ui::Compositor* compositor = window_->layer()->GetCompositor();
+ if (!compositor->HasObserver(this))
+ compositor->AddObserver(this);
+ }
+#endif
+}
+
+#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
void RenderWidgetHostViewAura::AcceleratedSurfaceNew(
int32 width,
int32 height,
@@ -297,22 +322,22 @@
}
void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(
- uint64 surface_id,
- int32 route_id,
+ const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
int gpu_host_id) {
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);

Powered by Google App Engine
This is Rietveld 408576698