| OLD | NEW |
| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 void CompositorOutputSurface::OnUpdateVSyncParametersFromBrowser( | 216 void CompositorOutputSurface::OnUpdateVSyncParametersFromBrowser( |
| 217 base::TimeTicks timebase, | 217 base::TimeTicks timebase, |
| 218 base::TimeDelta interval) { | 218 base::TimeDelta interval) { |
| 219 DCHECK(CalledOnValidThread()); | 219 DCHECK(CalledOnValidThread()); |
| 220 CommitVSyncParameters(timebase, interval); | 220 CommitVSyncParameters(timebase, interval); |
| 221 } | 221 } |
| 222 | 222 |
| 223 #if defined(OS_ANDROID) | 223 #if defined(OS_ANDROID) |
| 224 void CompositorOutputSurface::SetNeedsBeginFrame(bool enable) { | 224 void CompositorOutputSurface::SetNeedsBeginFrames(bool needs_begin_frames) { |
| 225 DCHECK(CalledOnValidThread()); | 225 DCHECK(CalledOnValidThread()); |
| 226 Send(new ViewHostMsg_SetNeedsBeginFrame(routing_id_, enable)); | 226 Send(new ViewHostMsg_SetNeedsBeginFrame(routing_id_, needs_begin_frames)); |
| 227 } | 227 } |
| 228 | 228 |
| 229 void CompositorOutputSurface::OnBeginFrame(const cc::BeginFrameArgs& args) { | 229 void CompositorOutputSurface::OnBeginFrame(const cc::BeginFrameArgs& args) { |
| 230 DCHECK(CalledOnValidThread()); | 230 DCHECK(CalledOnValidThread()); |
| 231 client_->BeginFrame(args); | 231 SendBeginFrame(args); |
| 232 } | 232 } |
| 233 #endif // defined(OS_ANDROID) | 233 #endif // defined(OS_ANDROID) |
| 234 | 234 |
| 235 void CompositorOutputSurface::OnSwapAck(uint32 output_surface_id, | 235 void CompositorOutputSurface::OnSwapAck(uint32 output_surface_id, |
| 236 const cc::CompositorFrameAck& ack) { | 236 const cc::CompositorFrameAck& ack) { |
| 237 // Ignore message if it's a stale one coming from a different output surface | 237 // Ignore message if it's a stale one coming from a different output surface |
| 238 // (e.g. after a lost context). | 238 // (e.g. after a lost context). |
| 239 if (output_surface_id != output_surface_id_) | 239 if (output_surface_id != output_surface_id_) |
| 240 return; | 240 return; |
| 241 ReclaimResources(&ack); | 241 ReclaimResources(&ack); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // If this is the last surface to stop preferring smoothness, | 291 // If this is the last surface to stop preferring smoothness, |
| 292 // Reset the main thread's priority to the default. | 292 // Reset the main thread's priority to the default. |
| 293 if (prefers_smoothness_ == true && | 293 if (prefers_smoothness_ == true && |
| 294 --g_prefer_smoothness_count == 0) { | 294 --g_prefer_smoothness_count == 0) { |
| 295 SetThreadPriorityToDefault(main_thread_handle_); | 295 SetThreadPriorityToDefault(main_thread_handle_); |
| 296 } | 296 } |
| 297 prefers_smoothness_ = prefers_smoothness; | 297 prefers_smoothness_ = prefers_smoothness; |
| 298 } | 298 } |
| 299 | 299 |
| 300 } // namespace content | 300 } // namespace content |
| OLD | NEW |