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

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

Issue 11293121: Add latency measurement system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor input event changes Created 8 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
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 30982bb0a2b193ee006d17cfb5a976b8f1e2071a..bc42f937a379b0bb2413c8eb02ab6c499c5c4ec5 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -133,6 +133,7 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
context_lost_reason_(GL_NO_ERROR),
error_message_callback_(0),
swapbuffers_complete_callback_(0),
+ latency_info_callback_(0),
gpu_preference_(gfx::PreferIntegratedGpu),
cached_width_(0),
cached_height_(0),
@@ -235,6 +236,10 @@ bool WebGraphicsContext3DCommandBufferImpl::MaybeInitializeGL(
base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnErrorMessage,
weak_ptr_factory_.GetWeakPtr()));
+ command_buffer_->SetLatencyInfoCallback(
+ base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnSetLatencyInfo,
+ weak_ptr_factory_.GetWeakPtr()));
+
client_error_message_callback_.reset(
new WebGraphicsContext3DErrorMessageCallback(this));
gl_->SetErrorMessageCallback(client_error_message_callback_.get());
@@ -551,6 +556,24 @@ void WebGraphicsContext3DCommandBufferImpl::postSubBufferCHROMIUM(
weak_ptr_factory_.GetWeakPtr()));
}
+void WebGraphicsContext3DCommandBufferImpl::setLatencyInfoCHROMIUM(
+ const WebKit::WebLatencyInfo& latency_info) {
+ command_buffer_->SetLatencyInfo(
+ static_cast<const WebKit::WebLatencyInfoImpl&>(latency_info));
+}
+
+void WebGraphicsContext3DCommandBufferImpl::setLatencyInfoCallbackCHROMIUM(
+ WebGraphicsContext3D::WebGraphicsLatencyInfoCallbackCHROMIUM* cb) {
+ latency_info_callback_ = cb;
+}
+
+void WebGraphicsContext3DCommandBufferImpl::OnSetLatencyInfo(
+ const WebKit::WebLatencyInfoImpl& latency_info) {
+ if (latency_info_callback_)
+ latency_info_callback_->onReceivedLatencyInfo(
+ static_cast<const WebKit::WebLatencyInfo&>(latency_info));
+}
+
void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) {
cached_width_ = width;
cached_height_ = height;

Powered by Google App Engine
This is Rietveld 408576698