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

Side by Side Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 138903025: Read compositor VSync information from platform, when possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 287efe04 Rebase, oshima@ nits. Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/gpu/compositor_output_surface.h" 5 #include "content/renderer/gpu/compositor_output_surface.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/compositor_frame_ack.h" 10 #include "cc/output/compositor_frame_ack.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 OutputSurface::SwapBuffers(frame); 133 OutputSurface::SwapBuffers(frame);
134 } 134 }
135 135
136 void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) { 136 void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
137 DCHECK(CalledOnValidThread()); 137 DCHECK(CalledOnValidThread());
138 if (!HasClient()) 138 if (!HasClient())
139 return; 139 return;
140 IPC_BEGIN_MESSAGE_MAP(CompositorOutputSurface, message) 140 IPC_BEGIN_MESSAGE_MAP(CompositorOutputSurface, message)
141 IPC_MESSAGE_HANDLER(ViewMsg_UpdateVSyncParameters, OnUpdateVSyncParameters); 141 IPC_MESSAGE_HANDLER(ViewMsg_UpdateVSyncParameters,
142 OnUpdateVSyncParametersFromBrowser);
142 IPC_MESSAGE_HANDLER(ViewMsg_SwapCompositorFrameAck, OnSwapAck); 143 IPC_MESSAGE_HANDLER(ViewMsg_SwapCompositorFrameAck, OnSwapAck);
143 IPC_MESSAGE_HANDLER(ViewMsg_ReclaimCompositorResources, OnReclaimResources); 144 IPC_MESSAGE_HANDLER(ViewMsg_ReclaimCompositorResources, OnReclaimResources);
144 #if defined(OS_ANDROID) 145 #if defined(OS_ANDROID)
145 IPC_MESSAGE_HANDLER(ViewMsg_BeginFrame, OnBeginImplFrame); 146 IPC_MESSAGE_HANDLER(ViewMsg_BeginFrame, OnBeginImplFrame);
146 #endif 147 #endif
147 IPC_END_MESSAGE_MAP() 148 IPC_END_MESSAGE_MAP()
148 } 149 }
149 150
150 void CompositorOutputSurface::OnUpdateVSyncParameters( 151 void CompositorOutputSurface::OnUpdateVSyncParametersFromBrowser(
151 base::TimeTicks timebase, base::TimeDelta interval) { 152 base::TimeTicks timebase,
153 base::TimeDelta interval) {
152 DCHECK(CalledOnValidThread()); 154 DCHECK(CalledOnValidThread());
153 OnVSyncParametersChanged(timebase, interval); 155 CommitVSyncParameters(timebase, interval);
154 } 156 }
155 157
156 #if defined(OS_ANDROID) 158 #if defined(OS_ANDROID)
157 void CompositorOutputSurface::SetNeedsBeginImplFrame(bool enable) { 159 void CompositorOutputSurface::SetNeedsBeginImplFrame(bool enable) {
158 DCHECK(CalledOnValidThread()); 160 DCHECK(CalledOnValidThread());
159 if (needs_begin_impl_frame_ != enable) 161 if (needs_begin_impl_frame_ != enable)
160 Send(new ViewHostMsg_SetNeedsBeginFrame(routing_id_, enable)); 162 Send(new ViewHostMsg_SetNeedsBeginFrame(routing_id_, enable));
161 OutputSurface::SetNeedsBeginImplFrame(enable); 163 OutputSurface::SetNeedsBeginImplFrame(enable);
162 } 164 }
163 165
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 // If this is the last surface to stop preferring smoothness, 228 // If this is the last surface to stop preferring smoothness,
227 // Reset the main thread's priority to the default. 229 // Reset the main thread's priority to the default.
228 if (prefers_smoothness_ == true && 230 if (prefers_smoothness_ == true &&
229 --g_prefer_smoothness_count == 0) { 231 --g_prefer_smoothness_count == 0) {
230 SetThreadPriorityToDefault(main_thread_handle_); 232 SetThreadPriorityToDefault(main_thread_handle_);
231 } 233 }
232 prefers_smoothness_ = prefers_smoothness; 234 prefers_smoothness_ = prefers_smoothness;
233 } 235 }
234 236
235 } // namespace content 237 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698