OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef UI_COMPOSITOR_COMPOSITOR_H_ | 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_ |
6 #define UI_COMPOSITOR_COMPOSITOR_H_ | 6 #define UI_COMPOSITOR_COMPOSITOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Compositor does not own observers. It is the responsibility of the | 184 // Compositor does not own observers. It is the responsibility of the |
185 // observer to remove itself when it is done observing. | 185 // observer to remove itself when it is done observing. |
186 void AddObserver(CompositorObserver* observer); | 186 void AddObserver(CompositorObserver* observer); |
187 void RemoveObserver(CompositorObserver* observer); | 187 void RemoveObserver(CompositorObserver* observer); |
188 bool HasObserver(CompositorObserver* observer); | 188 bool HasObserver(CompositorObserver* observer); |
189 | 189 |
190 // Returns whether a draw is pending, that is, if we're between the Draw call | 190 // Returns whether a draw is pending, that is, if we're between the Draw call |
191 // and the OnCompositingEnded. | 191 // and the OnCompositingEnded. |
192 bool DrawPending() const { return swap_posted_; } | 192 bool DrawPending() const { return swap_posted_; } |
193 | 193 |
| 194 bool CurrentlyCompositing() const { return currently_compositing_; } |
| 195 |
194 // Internal functions, called back by command-buffer contexts on swap buffer | 196 // Internal functions, called back by command-buffer contexts on swap buffer |
195 // events. | 197 // events. |
196 | 198 |
197 // Signals swap has been posted. | 199 // Signals swap has been posted. |
198 void OnSwapBuffersPosted(); | 200 void OnSwapBuffersPosted(); |
199 | 201 |
200 // Signals swap has completed. | 202 // Signals swap has completed. |
201 void OnSwapBuffersComplete(); | 203 void OnSwapBuffersComplete(); |
202 | 204 |
203 // Signals swap has aborted (e.g. lost context). | 205 // Signals swap has aborted (e.g. lost context). |
(...skipping 30 matching lines...) Expand all Loading... |
234 ObserverList<CompositorObserver> observer_list_; | 236 ObserverList<CompositorObserver> observer_list_; |
235 | 237 |
236 gfx::AcceleratedWidget widget_; | 238 gfx::AcceleratedWidget widget_; |
237 WebKit::WebLayer root_web_layer_; | 239 WebKit::WebLayer root_web_layer_; |
238 WebKit::WebLayerTreeView host_; | 240 WebKit::WebLayerTreeView host_; |
239 | 241 |
240 // This is set to true when the swap buffers has been posted and we're waiting | 242 // This is set to true when the swap buffers has been posted and we're waiting |
241 // for completion. | 243 // for completion. |
242 bool swap_posted_; | 244 bool swap_posted_; |
243 | 245 |
| 246 // This is true between OnCompositingStarted and OnCompositingEnded |
| 247 bool currently_compositing_; |
| 248 |
244 // The device scale factor of the monitor that this compositor is compositing | 249 // The device scale factor of the monitor that this compositor is compositing |
245 // layers on. | 250 // layers on. |
246 float device_scale_factor_; | 251 float device_scale_factor_; |
247 }; | 252 }; |
248 | 253 |
249 } // namespace ui | 254 } // namespace ui |
250 | 255 |
251 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 256 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |