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

Unified Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 11195011: Send vsync timebase updates to the browser compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Send vsync timebase updates to the browser compositor Created 8 years, 2 months 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/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;

Powered by Google App Engine
This is Rietveld 408576698