| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 void SynchronousCompositorOutputSurface::DetachFromClient() { | 141 void SynchronousCompositorOutputSurface::DetachFromClient() { |
| 142 DCHECK(CalledOnValidThread()); | 142 DCHECK(CalledOnValidThread()); |
| 143 if (registered_) { | 143 if (registered_) { |
| 144 registry_->UnregisterOutputSurface(routing_id_, this); | 144 registry_->UnregisterOutputSurface(routing_id_, this); |
| 145 } | 145 } |
| 146 client_->SetTreeActivationCallback(base::Closure()); | 146 client_->SetTreeActivationCallback(base::Closure()); |
| 147 cc::OutputSurface::DetachFromClient(); | 147 cc::OutputSurface::DetachFromClient(); |
| 148 CancelFallbackTick(); | 148 CancelFallbackTick(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void SynchronousCompositorOutputSurface::Reshape(const gfx::Size& size, | 151 void SynchronousCompositorOutputSurface::Reshape( |
| 152 float scale_factor, | 152 const gfx::Size& size, |
| 153 bool has_alpha) { | 153 float scale_factor, |
| 154 const gfx::ColorProfile& color_profile, |
| 155 bool has_alpha) { |
| 154 // Intentional no-op: surface size is controlled by the embedder. | 156 // Intentional no-op: surface size is controlled by the embedder. |
| 155 } | 157 } |
| 156 | 158 |
| 157 void SynchronousCompositorOutputSurface::SwapBuffers( | 159 void SynchronousCompositorOutputSurface::SwapBuffers( |
| 158 cc::CompositorFrame frame) { | 160 cc::CompositorFrame frame) { |
| 159 DCHECK(CalledOnValidThread()); | 161 DCHECK(CalledOnValidThread()); |
| 160 DCHECK(sync_client_); | 162 DCHECK(sync_client_); |
| 161 if (!fallback_tick_running_) { | 163 if (!fallback_tick_running_) { |
| 162 sync_client_->SwapBuffers(output_surface_id_, std::move(frame)); | 164 sync_client_->SwapBuffers(output_surface_id_, std::move(frame)); |
| 163 DeliverMessages(); | 165 DeliverMessages(); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 bool SynchronousCompositorOutputSurface::Send(IPC::Message* message) { | 319 bool SynchronousCompositorOutputSurface::Send(IPC::Message* message) { |
| 318 DCHECK(CalledOnValidThread()); | 320 DCHECK(CalledOnValidThread()); |
| 319 return sender_->Send(message); | 321 return sender_->Send(message); |
| 320 } | 322 } |
| 321 | 323 |
| 322 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 324 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
| 323 return thread_checker_.CalledOnValidThread(); | 325 return thread_checker_.CalledOnValidThread(); |
| 324 } | 326 } |
| 325 | 327 |
| 326 } // namespace content | 328 } // namespace content |
| OLD | NEW |