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

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

Issue 16833003: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | no next file » | 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 c570f51d75aeb8d3bbfefdde89c86addb130ef1b..30fbc3079d85d642c806df0bff5fb6b691ac5968 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -68,7 +68,7 @@ CompositorOutputSurface::CompositorOutputSurface(
CompositorOutputSurface::~CompositorOutputSurface() {
DCHECK(CalledOnValidThread());
- if (!client_)
+ if (!HasClient())
return;
UpdateSmoothnessTakesPriority(false);
if (output_surface_proxy_.get())
@@ -95,6 +95,7 @@ bool CompositorOutputSurface::BindToClient(
void CompositorOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
if (use_swap_compositor_frame_message_) {
Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, *frame));
+ DidSwapBuffers();
return;
}
@@ -113,7 +114,7 @@ void CompositorOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
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);
@@ -127,23 +128,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_->OnSwapBuffersComplete(&ack);
+ OnSwapBuffersComplete(&ack);
}
bool CompositorOutputSurface::Send(IPC::Message* message) {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698