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

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

Issue 15836005: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc
Patch Set: Ignore last patch set: bad upload. Created 7 years, 6 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 55af86511874200491b0fe4375394b73aa1c2948..74a6dc25e6db9e88c4894659e4b62b6e39fadc65 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -69,7 +69,7 @@ CompositorOutputSurface::CompositorOutputSurface(
CompositorOutputSurface::~CompositorOutputSurface() {
DCHECK(CalledOnValidThread());
- if (!client_)
+ if (!hasClient())
return;
UpdateSmoothnessTakesPriority(false);
if (output_surface_proxy_.get())
@@ -97,6 +97,7 @@ void CompositorOutputSurface::SendFrameToParentCompositor(
cc::CompositorFrame* frame) {
DCHECK(CalledOnValidThread());
Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, *frame));
+ DidSwapBuffers();
}
void CompositorOutputSurface::SwapBuffers(
@@ -125,7 +126,7 @@ void CompositorOutputSurface::PostSubBuffer(
void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
DCHECK(CalledOnValidThread());
- if (!client_)
+ if (!hasClient())
return;
IPC_BEGIN_MESSAGE_MAP(CompositorOutputSurface, message)
IPC_MESSAGE_HANDLER(ViewMsg_UpdateVSyncParameters, OnUpdateVSyncParameters);
@@ -139,23 +140,24 @@ void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
void CompositorOutputSurface::OnUpdateVSyncParameters(
base::TimeTicks timebase, base::TimeDelta interval) {
DCHECK(CalledOnValidThread());
- client_->OnVSyncParametersChanged(timebase, interval);
+ OnVSyncParametersChanged(timebase, interval);
}
#if defined(OS_ANDROID)
void CompositorOutputSurface::SetNeedsBeginFrame(bool enable) {
DCHECK(CalledOnValidThread());
Send(new ViewHostMsg_SetNeedsBeginFrame(routing_id_, enable));
+ OutputSurface::SetNeedsBeginFrame(enable);
}
void CompositorOutputSurface::OnBeginFrame(base::TimeTicks frame_time) {
DCHECK(CalledOnValidThread());
- client_->BeginFrame(frame_time);
+ BeginFrame(frame_time);
}
#endif // defined(OS_ANDROID)
void CompositorOutputSurface::OnSwapAck(const cc::CompositorFrameAck& ack) {
- client_->OnSendFrameToParentCompositorAck(ack);
+ OnSendFrameToParentCompositorAck(ack);
}
bool CompositorOutputSurface::Send(IPC::Message* message) {
« cc/scheduler/scheduler.cc ('K') | « content/browser/renderer_host/image_transport_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698