| 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 dce01a234876b204cbd5f8ed3ccb2e139855893a..83872e35e68ffb132a2fa5ed837998c85ded0bd4 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)
|
| @@ -270,6 +277,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
|
| @@ -286,6 +294,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
|
| @@ -340,6 +349,16 @@ gfx::Size PassThroughImageTransportSurface::GetSize() {
|
|
|
| PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {}
|
|
|
| +void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() {
|
| +#if defined(USE_AURA)
|
| + base::TimeTicks timebase;
|
| + base::TimeDelta interval;
|
| + if (GetVSyncParameters(&timebase, &interval)) {
|
| + helper_->SendUpdateVSyncParameters(timebase, interval);
|
| + }
|
| +#endif
|
| +}
|
| +
|
| } // namespace content
|
|
|
| #endif // defined(ENABLE_GPU)
|
|
|