| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 void SynchronousCompositorOutputSurface::SetNeedsBeginFrame( | 133 void SynchronousCompositorOutputSurface::SetNeedsBeginFrame( |
| 134 bool enable) { | 134 bool enable) { |
| 135 DCHECK(CalledOnValidThread()); | 135 DCHECK(CalledOnValidThread()); |
| 136 needs_begin_frame_ = enable; | 136 needs_begin_frame_ = enable; |
| 137 UpdateCompositorClientSettings(); | 137 UpdateCompositorClientSettings(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void SynchronousCompositorOutputSurface::SwapBuffers( | 140 void SynchronousCompositorOutputSurface::SwapBuffers( |
| 141 const cc::LatencyInfo& info) { | 141 const ui::LatencyInfo& info) { |
| 142 context3d()->shallowFlushCHROMIUM(); | 142 context3d()->shallowFlushCHROMIUM(); |
| 143 did_swap_buffer_ = true; | 143 did_swap_buffer_ = true; |
| 144 } | 144 } |
| 145 | 145 |
| 146 void SynchronousCompositorOutputSurface::SetClient( | 146 void SynchronousCompositorOutputSurface::SetClient( |
| 147 SynchronousCompositorClient* compositor_client) { | 147 SynchronousCompositorClient* compositor_client) { |
| 148 DCHECK(CalledOnValidThread()); | 148 DCHECK(CalledOnValidThread()); |
| 149 compositor_client_ = compositor_client; | 149 compositor_client_ = compositor_client; |
| 150 UpdateCompositorClientSettings(); | 150 UpdateCompositorClientSettings(); |
| 151 } | 151 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // Not using base::NonThreadSafe as we want to enforce a more exacting threading | 211 // Not using base::NonThreadSafe as we want to enforce a more exacting threading |
| 212 // requirement: SynchronousCompositorOutputSurface() must only be used by | 212 // requirement: SynchronousCompositorOutputSurface() must only be used by |
| 213 // embedders that supply their own compositor loop via | 213 // embedders that supply their own compositor loop via |
| 214 // OverrideCompositorMessageLoop(). | 214 // OverrideCompositorMessageLoop(). |
| 215 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 215 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
| 216 return base::MessageLoop::current() && (base::MessageLoop::current() == | 216 return base::MessageLoop::current() && (base::MessageLoop::current() == |
| 217 GetContentClient()->renderer()->OverrideCompositorMessageLoop()); | 217 GetContentClient()->renderer()->OverrideCompositorMessageLoop()); |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace content | 220 } // namespace content |
| OLD | NEW |