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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "cc/output/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
10 #include "content/public/renderer/android/synchronous_compositor_client.h" | 10 #include "content/public/renderer/android/synchronous_compositor_client.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 | 69 |
70 void SynchronousCompositorOutputSurface::EnableVSyncNotification( | 70 void SynchronousCompositorOutputSurface::EnableVSyncNotification( |
71 bool enable_vsync) { | 71 bool enable_vsync) { |
72 DCHECK(CalledOnValidThread()); | 72 DCHECK(CalledOnValidThread()); |
73 vsync_enabled_ = enable_vsync; | 73 vsync_enabled_ = enable_vsync; |
74 UpdateCompositorClientSettings(); | 74 UpdateCompositorClientSettings(); |
75 } | 75 } |
76 | 76 |
77 void SynchronousCompositorOutputSurface::SwapBuffers( | 77 void SynchronousCompositorOutputSurface::SwapBuffers( |
78 const cc::LatencyInfo& info) { | 78 const ui::LatencyInfo& info) { |
79 context3d()->finish(); | 79 context3d()->finish(); |
80 did_swap_buffer_ = true; | 80 did_swap_buffer_ = true; |
81 } | 81 } |
82 | 82 |
83 void SynchronousCompositorOutputSurface::SetClient( | 83 void SynchronousCompositorOutputSurface::SetClient( |
84 SynchronousCompositorClient* compositor_client) { | 84 SynchronousCompositorClient* compositor_client) { |
85 DCHECK(CalledOnValidThread()); | 85 DCHECK(CalledOnValidThread()); |
86 compositor_client_ = compositor_client; | 86 compositor_client_ = compositor_client; |
87 UpdateCompositorClientSettings(); | 87 UpdateCompositorClientSettings(); |
88 } | 88 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // Not using base::NonThreadSafe as we want to enforce a more exacting threading | 120 // Not using base::NonThreadSafe as we want to enforce a more exacting threading |
121 // requirement: SynchronousCompositorOutputSurface() must only be used by | 121 // requirement: SynchronousCompositorOutputSurface() must only be used by |
122 // embedders that supply their own compositor loop via | 122 // embedders that supply their own compositor loop via |
123 // OverrideCompositorMessageLoop(). | 123 // OverrideCompositorMessageLoop(). |
124 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 124 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
125 return base::MessageLoop::current() && (base::MessageLoop::current() == | 125 return base::MessageLoop::current() && (base::MessageLoop::current() == |
126 GetContentClient()->renderer()->OverrideCompositorMessageLoop()); | 126 GetContentClient()->renderer()->OverrideCompositorMessageLoop()); |
127 } | 127 } |
128 | 128 |
129 } // namespace content | 129 } // namespace content |
OLD | NEW |