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

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

Issue 12614013: Plumb cc::LatencyInfo through command buffer and output surface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/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 da0bd2a87607a19343181c0a9ad2ef1c38a8dcc9..7d20525bfc837cf1fd6805ef64a4b642043872cb 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -9,6 +9,7 @@
#include "cc/compositor_frame.h"
#include "cc/compositor_frame_ack.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/public/common/content_switches.h"
#include "content/renderer/render_thread_impl.h"
@@ -53,6 +54,7 @@ IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter(
CompositorOutputSurface::CompositorOutputSurface(
int32 routing_id,
WebGraphicsContext3D* context3D,
+ CommandBufferProxyImpl* command_buffer_proxy,
cc::SoftwareOutputDevice* software_device)
: OutputSurface(make_scoped_ptr(context3D),
make_scoped_ptr(software_device)),
@@ -60,7 +62,8 @@ CompositorOutputSurface::CompositorOutputSurface(
RenderThreadImpl::current()->compositor_output_surface_filter()),
routing_id_(routing_id),
prefers_smoothness_(false),
- main_thread_id_(base::PlatformThread::CurrentId()) {
+ main_thread_id_(base::PlatformThread::CurrentId()),
+ command_buffer_proxy_(command_buffer_proxy) {
DCHECK(output_surface_filter_);
CommandLine* command_line = CommandLine::ForCurrentProcess();
capabilities_.has_parent_compositor = command_line->HasSwitch(
@@ -91,6 +94,11 @@ bool CompositorOutputSurface::BindToClient(
base::Bind(&CompositorOutputSurfaceProxy::OnMessageReceived,
output_surface_proxy_));
+ if (command_buffer_proxy_)
apatrick_chromium 2013/03/15 19:09:35 nit: braces
+ command_buffer_proxy_->SetLatencyInfoCallback(
+ base::Bind(&CompositorOutputSurface::OnReceivedLatencyInfo,
+ base::Unretained(this)));
+
return true;
}
@@ -100,6 +108,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_)

Powered by Google App Engine
This is Rietveld 408576698