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 47bb204d7d225474af46f82affacd7ae222385f9..de566748e97ec0c65303b1386e87c0f72ce1e15a 100644 |
--- a/content/common/gpu/image_transport_surface.cc |
+++ b/content/common/gpu/image_transport_surface.cc |
@@ -157,6 +157,13 @@ void ImageTransportHelper::SendResizeView(const gfx::Size& size) { |
size)); |
} |
+void ImageTransportHelper::SendUpdateVSyncParameters( |
+ base::TimeTicks timebase, base::TimeDelta interval) { |
+ manager_->Send(new GpuHostMsg_UpdateVSyncParameters(stub_->surface_id(), |
+ timebase, |
+ interval)); |
+} |
+ |
void ImageTransportHelper::SetScheduled(bool is_scheduled) { |
gpu::GpuScheduler* scheduler = Scheduler(); |
if (!scheduler) |
@@ -271,6 +278,7 @@ void PassThroughImageTransportSurface::Destroy() { |
bool PassThroughImageTransportSurface::SwapBuffers() { |
bool result = gfx::GLSurfaceAdapter::SwapBuffers(); |
+ SendVSyncUpdateIfAvailable(); |
if (transport_) { |
// Round trip to the browser UI thread, for throttling, by sending a dummy |
@@ -287,6 +295,7 @@ bool PassThroughImageTransportSurface::SwapBuffers() { |
bool PassThroughImageTransportSurface::PostSubBuffer( |
int x, int y, int width, int height) { |
bool result = gfx::GLSurfaceAdapter::PostSubBuffer(x, y, width, height); |
+ SendVSyncUpdateIfAvailable(); |
if (transport_) { |
// Round trip to the browser UI thread, for throttling, by sending a dummy |
@@ -343,6 +352,18 @@ gfx::Size PassThroughImageTransportSurface::GetSize() { |
PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} |
+void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() { |
+// TODO (ajuma): Fix up the browser-side handling of these updates on |
+// non-Aura, so we can remove this ifdef. |
+#if defined(USE_AURA) |
piman
2012/10/29 20:36:39
No ifdef AURA in the GPU-process code. Aura is a U
ajuma
2012/10/30 21:04:04
I've removed the ifdef. It turns out that not much
|
+ base::TimeTicks timebase; |
+ base::TimeDelta interval; |
+ if (GetVSyncParameters(&timebase, &interval)) { |
+ helper_->SendUpdateVSyncParameters(timebase, interval); |
+ } |
+#endif |
+} |
+ |
} // namespace content |
#endif // defined(ENABLE_GPU) |