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

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

Issue 8513013: Plumb the partial swap though image transport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with a few compile fixes (tested Win, Mac, Linux, and Aura) 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
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 62b1d27e6375d47a86366c894f084b756cfb5b75..3dbf57247d50b9bdc051636cb38e5d847f663490 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -277,8 +277,8 @@ void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() {
}
void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(
- const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
- int gpu_host_id) {
+ const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
+ int gpu_host_id) {
#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
window_->layer()->SetExternalTexture(
accelerated_surface_containers_[params.surface_id]->GetTexture());
@@ -287,14 +287,44 @@ void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(
if (!window_->layer()->GetCompositor()) {
// We have no compositor, so we have no way to display the surface.
// Must still send the ACK.
- host_->AcknowledgeSwapBuffers(params.route_id, gpu_host_id);
+ RenderWidgetHost::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(&RenderWidgetHost::AcknowledgeSwapBuffers,
- base::Unretained(host_), params.route_id, gpu_host_id));
+ params.route_id, gpu_host_id));
+ ui::Compositor* compositor = window_->layer()->GetCompositor();
+ if (!compositor->HasObserver(this))
+ compositor->AddObserver(this);
+ }
+#else
+ NOTREACHED();
+#endif
+}
+
+void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(
+ const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
+ int gpu_host_id) {
+#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
+ RenderWidgetHost::AcknowledgePostSubBuffer(params.route_id, gpu_host_id);
+ } else {
+ // TODO(backer): Plumb the damage rect to the ui compositor so that we
+ // can do a partial swap to display.
+ window_->layer()->ScheduleDraw();
+
+ // Add sending an ACK to the list of things to do OnCompositingEnded
+ on_compositing_ended_callbacks_.push_back(
+ base::Bind(&RenderWidgetHost::AcknowledgePostSubBuffer,
+ 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