OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 return did_swap_buffer_; | 190 return did_swap_buffer_; |
191 } | 191 } |
192 | 192 |
193 void SynchronousCompositorOutputSurface::InvokeComposite( | 193 void SynchronousCompositorOutputSurface::InvokeComposite( |
194 const gfx::Transform& transform, | 194 const gfx::Transform& transform, |
195 gfx::Rect damage_area) { | 195 gfx::Rect damage_area) { |
196 // TODO(boliu): This assumes |transform| is identity and |damage_area| is the | 196 // TODO(boliu): This assumes |transform| is identity and |damage_area| is the |
197 // whole view. Tracking bug to implement this: crbug.com/230463. | 197 // whole view. Tracking bug to implement this: crbug.com/230463. |
198 client_->SetNeedsRedrawRect(damage_area); | 198 client_->SetNeedsRedrawRect(damage_area); |
199 if (vsync_enabled_) | 199 if (vsync_enabled_) |
200 client_->DidVSync(base::TimeTicks::Now()); | 200 client_->BeginImplFrame(base::TimeTicks::Now()); |
201 } | 201 } |
202 | 202 |
203 void SynchronousCompositorOutputSurface::UpdateCompositorClientSettings() { | 203 void SynchronousCompositorOutputSurface::UpdateCompositorClientSettings() { |
204 if (compositor_client_) { | 204 if (compositor_client_) { |
205 compositor_client_->SetContinuousInvalidate(vsync_enabled_); | 205 compositor_client_->SetContinuousInvalidate(vsync_enabled_); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 // Not using base::NonThreadSafe as we want to enforce a more exacting threading | 209 // Not using base::NonThreadSafe as we want to enforce a more exacting threading |
210 // requirement: SynchronousCompositorOutputSurface() must only be used by | 210 // requirement: SynchronousCompositorOutputSurface() must only be used by |
211 // embedders that supply their own compositor loop via | 211 // embedders that supply their own compositor loop via |
212 // OverrideCompositorMessageLoop(). | 212 // OverrideCompositorMessageLoop(). |
213 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 213 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
214 return base::MessageLoop::current() && (base::MessageLoop::current() == | 214 return base::MessageLoop::current() && (base::MessageLoop::current() == |
215 GetContentClient()->renderer()->OverrideCompositorMessageLoop()); | 215 GetContentClient()->renderer()->OverrideCompositorMessageLoop()); |
216 } | 216 } |
217 | 217 |
218 } // namespace content | 218 } // namespace content |
OLD | NEW |