| Index: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
|
| diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
|
| index 14fa05a598e2dc7a85372c108265cfc6289bf56a..c89cdcc21f472700e3a86aea3e320f20ad5aa4b5 100644
|
| --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
|
| +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
|
| @@ -130,6 +130,7 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
|
| active_url_(active_url),
|
| swap_client_(swap_client),
|
| memory_allocation_changed_callback_(0),
|
| + update_vsync_time_callback_(0),
|
| context_lost_callback_(0),
|
| context_lost_reason_(GL_NO_ERROR),
|
| error_message_callback_(0),
|
| @@ -704,6 +705,22 @@ void WebGraphicsContext3DCommandBufferImpl::
|
| base::Callback<void(const GpuMemoryAllocationForRenderer&)>());
|
| }
|
|
|
| +void WebGraphicsContext3DCommandBufferImpl::
|
| + setUpdateVSyncTimeCallbackCHROMIUM(
|
| + WebGraphicsUpdateVSyncTimeCallbackCHROMIUM* callback) {
|
| + update_vsync_time_callback_ = callback;
|
| +
|
| + if (!command_buffer_)
|
| + return;
|
| +
|
| + if (callback)
|
| + command_buffer_->SetUpdateVSyncTimeCallback(base::Bind(
|
| + &WebGraphicsContext3DCommandBufferImpl::OnUpdateVSyncTime,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| + else
|
| + command_buffer_->SetUpdateVSyncTimeCallback(
|
| + base::Callback<void(int64)>());
|
| +}
|
|
|
| void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM(
|
| WebGLId texture, WebGLId parentTexture) {
|
| @@ -1413,6 +1430,12 @@ void WebGraphicsContext3DCommandBufferImpl::OnMemoryAllocationChanged(
|
| allocation.suggest_have_backbuffer));
|
| }
|
|
|
| +void WebGraphicsContext3DCommandBufferImpl::OnUpdateVSyncTime(int64 time) {
|
| + if (update_vsync_time_callback_)
|
| + update_vsync_time_callback_->onUpdateVSyncTime(time);
|
| +}
|
| +
|
| +
|
| void WebGraphicsContext3DCommandBufferImpl::setErrorMessageCallback(
|
| WebGraphicsContext3D::WebGraphicsErrorMessageCallback* cb) {
|
| error_message_callback_ = cb;
|
|
|