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

Unified Diff: content/common/gpu/image_transport_surface.cc

Issue 8498036: Delay UpdateRect until the SwapBuffers callback when accelerated compositing is on. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: allow multiple update messages in flight Created 9 years 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
« no previous file with comments | « content/common/gpu/image_transport_surface.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/image_transport_surface.cc
diff --git a/content/common/gpu/image_transport_surface.cc b/content/common/gpu/image_transport_surface.cc
index 94669cf4b5dbb5609331226caed746bbe53c069b..d1939f2a1fc4256b326537487c6ec2d54cd01f05 100644
--- a/content/common/gpu/image_transport_surface.cc
+++ b/content/common/gpu/image_transport_surface.cc
@@ -245,12 +245,46 @@ void PassThroughImageTransportSurface::OnNewSurfaceACK(
uint64 surface_id, TransportDIB::Handle surface_handle) {
}
+bool PassThroughImageTransportSurface::SwapBuffers() {
+ bool result = gfx::GLSurfaceAdapter::SwapBuffers();
+
+ // Round trip to the browser UI thread, for throttling, by sending a dummy
+ // SwapBuffers message.
+ GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;
+ params.surface_id = 0;
+#if defined(OS_WIN)
+ params.size = GetSize();
+#endif
+ helper_->SendAcceleratedSurfaceBuffersSwapped(params);
+
+ helper_->SetScheduled(false);
+ return result;
+}
+
+bool PassThroughImageTransportSurface::PostSubBuffer(
+ int x, int y, int width, int height) {
+ bool result = gfx::GLSurfaceAdapter::PostSubBuffer(x, y, width, height);
+
+ // Round trip to the browser UI thread, for throttling, by sending a dummy
+ // PostSubBuffer message.
+ GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params params;
+ params.surface_id = 0;
+ params.x = x;
+ params.y = y;
+ params.width = width;
+ params.height = height;
+ helper_->SendAcceleratedSurfacePostSubBuffer(params);
+
+ helper_->SetScheduled(false);
+ return result;
+}
+
void PassThroughImageTransportSurface::OnBuffersSwappedACK() {
- NOTREACHED();
+ helper_->SetScheduled(true);
}
void PassThroughImageTransportSurface::OnPostSubBufferACK() {
- NOTREACHED();
+ helper_->SetScheduled(true);
}
void PassThroughImageTransportSurface::OnResizeViewACK() {
« no previous file with comments | « content/common/gpu/image_transport_surface.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698