| 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/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 InvokeComposite(transform, damage_area); | 199 InvokeComposite(transform, damage_area); |
| 200 | 200 |
| 201 return did_swap_buffer_; | 201 return did_swap_buffer_; |
| 202 } | 202 } |
| 203 | 203 |
| 204 void SynchronousCompositorOutputSurface::InvokeComposite( | 204 void SynchronousCompositorOutputSurface::InvokeComposite( |
| 205 const gfx::Transform& transform, | 205 const gfx::Transform& transform, |
| 206 gfx::Rect damage_area) { | 206 gfx::Rect damage_area) { |
| 207 // TODO(boliu): This assumes |transform| is identity and |damage_area| is the | 207 // TODO(boliu): This assumes |transform| is identity and |damage_area| is the |
| 208 // whole view. Tracking bug to implement this: crbug.com/230463. | 208 // whole view. Tracking bug to implement this: crbug.com/230463. |
| 209 client_->SetNeedsRedrawRect(damage_area); | 209 SetNeedsRedrawRect(damage_area); |
| 210 if (needs_begin_frame_) | 210 if (needs_begin_frame_) |
| 211 client_->BeginFrame(base::TimeTicks::Now()); | 211 BeginFrame(base::TimeTicks::Now()); |
| 212 } | 212 } |
| 213 | 213 |
| 214 // Not using base::NonThreadSafe as we want to enforce a more exacting threading | 214 // Not using base::NonThreadSafe as we want to enforce a more exacting threading |
| 215 // requirement: SynchronousCompositorOutputSurface() must only be used on the UI | 215 // requirement: SynchronousCompositorOutputSurface() must only be used on the UI |
| 216 // thread. | 216 // thread. |
| 217 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 217 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
| 218 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 218 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
| 219 } | 219 } |
| 220 | 220 |
| 221 SynchronousCompositorOutputSurfaceDelegate* | 221 SynchronousCompositorOutputSurfaceDelegate* |
| 222 SynchronousCompositorOutputSurface::GetDelegate() { | 222 SynchronousCompositorOutputSurface::GetDelegate() { |
| 223 return SynchronousCompositorImpl::FromRoutingID(routing_id_); | 223 return SynchronousCompositorImpl::FromRoutingID(routing_id_); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace content | 226 } // namespace content |
| OLD | NEW |