| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/synchronous_compositor_output_surface.h" | 5 #include "content/renderer/android/synchronous_compositor_output_surface.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 CancelFallbackTick(); | 148 CancelFallbackTick(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void SynchronousCompositorOutputSurface::Reshape(const gfx::Size& size, | 151 void SynchronousCompositorOutputSurface::Reshape(const gfx::Size& size, |
| 152 float scale_factor, | 152 float scale_factor, |
| 153 bool has_alpha) { | 153 bool has_alpha) { |
| 154 // Intentional no-op: surface size is controlled by the embedder. | 154 // Intentional no-op: surface size is controlled by the embedder. |
| 155 } | 155 } |
| 156 | 156 |
| 157 void SynchronousCompositorOutputSurface::SwapBuffers( | 157 void SynchronousCompositorOutputSurface::SwapBuffers( |
| 158 cc::CompositorFrame* frame) { | 158 cc::CompositorFrame frame) { |
| 159 DCHECK(CalledOnValidThread()); | 159 DCHECK(CalledOnValidThread()); |
| 160 DCHECK(sync_client_); | 160 DCHECK(sync_client_); |
| 161 if (!fallback_tick_running_) { | 161 if (!fallback_tick_running_) { |
| 162 sync_client_->SwapBuffers(output_surface_id_, frame); | 162 sync_client_->SwapBuffers(output_surface_id_, std::move(frame)); |
| 163 DeliverMessages(); | 163 DeliverMessages(); |
| 164 } | 164 } |
| 165 client_->DidSwapBuffers(); | 165 client_->DidSwapBuffers(); |
| 166 did_swap_ = true; | 166 did_swap_ = true; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void SynchronousCompositorOutputSurface::CancelFallbackTick() { | 169 void SynchronousCompositorOutputSurface::CancelFallbackTick() { |
| 170 fallback_tick_.Cancel(); | 170 fallback_tick_.Cancel(); |
| 171 fallback_tick_pending_ = false; | 171 fallback_tick_pending_ = false; |
| 172 } | 172 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 bool SynchronousCompositorOutputSurface::Send(IPC::Message* message) { | 317 bool SynchronousCompositorOutputSurface::Send(IPC::Message* message) { |
| 318 DCHECK(CalledOnValidThread()); | 318 DCHECK(CalledOnValidThread()); |
| 319 return sender_->Send(message); | 319 return sender_->Send(message); |
| 320 } | 320 } |
| 321 | 321 |
| 322 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 322 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
| 323 return thread_checker_.CalledOnValidThread(); | 323 return thread_checker_.CalledOnValidThread(); |
| 324 } | 324 } |
| 325 | 325 |
| 326 } // namespace content | 326 } // namespace content |
| OLD | NEW |