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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 Compositor* compositor, bool software_fallback) = 0; | 75 Compositor* compositor, bool software_fallback) = 0; |
76 | 76 |
77 // Creates a reflector that copies the content of the |mirrored_compositor| | 77 // Creates a reflector that copies the content of the |mirrored_compositor| |
78 // onto |mirroing_layer|. | 78 // onto |mirroing_layer|. |
79 virtual scoped_refptr<Reflector> CreateReflector( | 79 virtual scoped_refptr<Reflector> CreateReflector( |
80 Compositor* mirrored_compositor, | 80 Compositor* mirrored_compositor, |
81 Layer* mirroring_layer) = 0; | 81 Layer* mirroring_layer) = 0; |
82 // Removes the reflector, which stops the mirroring. | 82 // Removes the reflector, which stops the mirroring. |
83 virtual void RemoveReflector(scoped_refptr<Reflector> reflector) = 0; | 83 virtual void RemoveReflector(scoped_refptr<Reflector> reflector) = 0; |
84 | 84 |
85 // Returns a reference to the offscreen context provider used by the | |
86 // compositor. This provider is bound and used on whichever thread the | |
87 // compositor is rendering from. | |
88 virtual scoped_refptr<cc::ContextProvider> | |
89 OffscreenCompositorContextProvider() = 0; | |
90 | |
91 // Return a reference to a shared offscreen context provider usable from the | 85 // Return a reference to a shared offscreen context provider usable from the |
92 // main thread. This may be the same as OffscreenCompositorContextProvider() | 86 // main thread. |
93 // depending on the compositor's threading configuration. This provider will | |
94 // be bound to the main thread. | |
95 virtual scoped_refptr<cc::ContextProvider> | 87 virtual scoped_refptr<cc::ContextProvider> |
96 SharedMainThreadContextProvider() = 0; | 88 SharedMainThreadContextProvider() = 0; |
97 | 89 |
98 // Destroys per-compositor data. | 90 // Destroys per-compositor data. |
99 virtual void RemoveCompositor(Compositor* compositor) = 0; | 91 virtual void RemoveCompositor(Compositor* compositor) = 0; |
100 | 92 |
101 // When true, the factory uses test contexts that do not do real GL | 93 // When true, the factory uses test contexts that do not do real GL |
102 // operations. | 94 // operations. |
103 virtual bool DoesCreateTestContexts() = 0; | 95 virtual bool DoesCreateTestContexts() = 0; |
104 }; | 96 }; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 virtual void Layout() OVERRIDE; | 218 virtual void Layout() OVERRIDE; |
227 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, | 219 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, |
228 float page_scale) OVERRIDE {} | 220 float page_scale) OVERRIDE {} |
229 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) | 221 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) |
230 OVERRIDE; | 222 OVERRIDE; |
231 virtual void DidInitializeOutputSurface(bool success) OVERRIDE {} | 223 virtual void DidInitializeOutputSurface(bool success) OVERRIDE {} |
232 virtual void WillCommit() OVERRIDE {} | 224 virtual void WillCommit() OVERRIDE {} |
233 virtual void DidCommit() OVERRIDE; | 225 virtual void DidCommit() OVERRIDE; |
234 virtual void DidCommitAndDrawFrame() OVERRIDE; | 226 virtual void DidCommitAndDrawFrame() OVERRIDE; |
235 virtual void DidCompleteSwapBuffers() OVERRIDE; | 227 virtual void DidCompleteSwapBuffers() OVERRIDE; |
236 virtual scoped_refptr<cc::ContextProvider> | |
237 OffscreenContextProvider() OVERRIDE; | |
238 | 228 |
239 // cc::LayerTreeHostSingleThreadClient implementation. | 229 // cc::LayerTreeHostSingleThreadClient implementation. |
240 virtual void ScheduleComposite() OVERRIDE; | 230 virtual void ScheduleComposite() OVERRIDE; |
241 virtual void ScheduleAnimation() OVERRIDE; | 231 virtual void ScheduleAnimation() OVERRIDE; |
242 virtual void DidPostSwapBuffers() OVERRIDE; | 232 virtual void DidPostSwapBuffers() OVERRIDE; |
243 virtual void DidAbortSwapBuffers() OVERRIDE; | 233 virtual void DidAbortSwapBuffers() OVERRIDE; |
244 | 234 |
245 int last_started_frame() { return last_started_frame_; } | 235 int last_started_frame() { return last_started_frame_; } |
246 int last_ended_frame() { return last_ended_frame_; } | 236 int last_ended_frame() { return last_ended_frame_; } |
247 | 237 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 SwapState swap_state_; | 290 SwapState swap_state_; |
301 | 291 |
302 base::WeakPtrFactory<Compositor> schedule_draw_factory_; | 292 base::WeakPtrFactory<Compositor> schedule_draw_factory_; |
303 | 293 |
304 DISALLOW_COPY_AND_ASSIGN(Compositor); | 294 DISALLOW_COPY_AND_ASSIGN(Compositor); |
305 }; | 295 }; |
306 | 296 |
307 } // namespace ui | 297 } // namespace ui |
308 | 298 |
309 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 299 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |