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

Unified Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 11293121: Add latency measurement system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: create cc::LatencyInfo Created 7 years, 12 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
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | content/renderer/gpu/compositor_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_output_surface.cc
diff --git a/content/renderer/gpu/compositor_output_surface.cc b/content/renderer/gpu/compositor_output_surface.cc
index 5578298470470474b8abdf10107705ad9f4a7db0..0a43d41cba12ef61c05af3a4f7f81c42148c2db4 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -7,6 +7,7 @@
#include "base/message_loop_proxy.h"
#include "cc/compositor_frame.h"
#include "cc/output_surface_client.h"
+#include "content/common/gpu/client/command_buffer_proxy_impl.h"
#include "content/common/view_messages.h"
#include "content/renderer/render_thread_impl.h"
#include "ipc/ipc_forwarding_message_filter.h"
@@ -35,13 +36,15 @@ IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter(
CompositorOutputSurface::CompositorOutputSurface(
int32 routing_id,
WebGraphicsContext3D* context3D,
+ CommandBufferProxyImpl* command_buffer_proxy,
cc::SoftwareOutputDevice* software_device)
: output_surface_filter_(
RenderThreadImpl::current()->compositor_output_surface_filter()),
client_(NULL),
routing_id_(routing_id),
context3D_(context3D),
- software_device_(software_device) {
+ software_device_(software_device),
+ command_buffer_proxy_(command_buffer_proxy) {
DCHECK(output_surface_filter_);
capabilities_.has_parent_compositor = false;
DetachFromThread();
@@ -78,6 +81,11 @@ bool CompositorOutputSurface::BindToClient(
base::Bind(&CompositorOutputSurfaceProxy::OnMessageReceived,
output_surface_proxy_));
+ if (command_buffer_proxy_)
+ command_buffer_proxy_->SetLatencyInfoCallback(
+ base::Bind(&CompositorOutputSurface::OnReceivedLatencyInfo,
+ base::Unretained(this)));
+
return true;
}
@@ -96,6 +104,19 @@ void CompositorOutputSurface::SendFrameToParentCompositor(
Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, frame));
}
+void CompositorOutputSurface::SetLatencyInfo(
+ const cc::LatencyInfo& latency_info) {
+ if (command_buffer_proxy_)
+ command_buffer_proxy_->SetLatencyInfo(latency_info);
+}
+
+void CompositorOutputSurface::OnReceivedLatencyInfo(
+ const cc::LatencyInfo& latency_info) {
+ DCHECK(CalledOnValidThread());
+ DCHECK(client_);
+ client_->OnReceivedLatencyInfo(latency_info);
+}
+
void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
DCHECK(CalledOnValidThread());
if (!client_)
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | content/renderer/gpu/compositor_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698