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 "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 | 45 |
46 // Sets the global instance. Caller keeps ownership. | 46 // Sets the global instance. Caller keeps ownership. |
47 // If this function isn't called (for tests), a "default" factory will be | 47 // If this function isn't called (for tests), a "default" factory will be |
48 // created on the first call of GetInstance. | 48 // created on the first call of GetInstance. |
49 static void SetInstance(ContextFactory* instance); | 49 static void SetInstance(ContextFactory* instance); |
50 | 50 |
51 // Creates a context for given compositor. The factory may keep per-compositor | 51 // Creates a context for given compositor. The factory may keep per-compositor |
52 // data (e.g. a shared context), that needs to be cleaned up by calling | 52 // data (e.g. a shared context), that needs to be cleaned up by calling |
53 // RemoveCompositor when the compositor gets destroyed. | 53 // RemoveCompositor when the compositor gets destroyed. |
54 virtual WebKit::WebGraphicsContext3D* CreateContext( | 54 virtual WebKit::WebGraphicsContext3D* CreateContext( |
55 Compositor* compositor) = 0; | 55 Compositor* compositor) = 0; |
piman
2012/10/29 20:36:39
I think you don't need this one any more, since it
ajuma
2012/10/30 21:04:04
Done.
| |
56 | 56 |
57 // Creates an output surface for the given compositor. The factory may keep | |
58 // per-compositor data (e.g. a shared context), that needs to be cleaned up | |
59 // by calling RemoveCompositor when the compositor gets destroyed. | |
60 virtual WebKit::WebCompositorOutputSurface* CreateOutputSurface( | |
61 Compositor* compositor) = 0; | |
62 | |
57 // Creates a context used for offscreen rendering. This context can be shared | 63 // Creates a context used for offscreen rendering. This context can be shared |
58 // with all compositors. | 64 // with all compositors. |
59 virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() = 0; | 65 virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() = 0; |
60 | 66 |
61 // Destroys per-compositor data. | 67 // Destroys per-compositor data. |
62 virtual void RemoveCompositor(Compositor* compositor) = 0; | 68 virtual void RemoveCompositor(Compositor* compositor) = 0; |
63 }; | 69 }; |
64 | 70 |
65 // The default factory that creates in-process contexts. | 71 // The default factory that creates in-process contexts. |
66 class COMPOSITOR_EXPORT DefaultContextFactory : public ContextFactory { | 72 class COMPOSITOR_EXPORT DefaultContextFactory : public ContextFactory { |
67 public: | 73 public: |
68 DefaultContextFactory(); | 74 DefaultContextFactory(); |
69 virtual ~DefaultContextFactory(); | 75 virtual ~DefaultContextFactory(); |
70 | 76 |
71 // ContextFactory implementation | 77 // ContextFactory implementation |
72 virtual WebKit::WebGraphicsContext3D* CreateContext( | 78 virtual WebKit::WebGraphicsContext3D* CreateContext( |
73 Compositor* compositor) OVERRIDE; | 79 Compositor* compositor) OVERRIDE; |
80 virtual WebKit::WebCompositorOutputSurface* CreateOutputSurface( | |
81 Compositor* compositor) OVERRIDE; | |
74 virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() OVERRIDE; | 82 virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() OVERRIDE; |
75 virtual void RemoveCompositor(Compositor* compositor) OVERRIDE; | 83 virtual void RemoveCompositor(Compositor* compositor) OVERRIDE; |
76 | 84 |
77 bool Initialize(); | 85 bool Initialize(); |
78 | 86 |
79 void set_share_group(gfx::GLShareGroup* share_group) { | 87 void set_share_group(gfx::GLShareGroup* share_group) { |
80 share_group_ = share_group; | 88 share_group_ = share_group; |
81 } | 89 } |
82 | 90 |
83 private: | 91 private: |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 bool disable_schedule_composite_; | 302 bool disable_schedule_composite_; |
295 | 303 |
296 CompositorLock* compositor_lock_; | 304 CompositorLock* compositor_lock_; |
297 | 305 |
298 DISALLOW_COPY_AND_ASSIGN(Compositor); | 306 DISALLOW_COPY_AND_ASSIGN(Compositor); |
299 }; | 307 }; |
300 | 308 |
301 } // namespace ui | 309 } // namespace ui |
302 | 310 |
303 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 311 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |