OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ |
6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ | 6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 class MessageLoopProxy; | 12 class MessageLoopProxy; |
13 } | 13 } |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 class OutputSurface; | 16 class OutputSurface; |
17 class ContextProvider; | |
joth
2013/06/07 17:41:18
alpha order
| |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
21 // Decouples creation from usage of the parts needed for the synchonous | 22 // Decouples creation from usage of the parts needed for the synchonous |
22 // compositor rendering path. In practice this is only used in single | 23 // compositor rendering path. In practice this is only used in single |
23 // process mode (namely, for Android WebView) hence the implementation of | 24 // process mode (namely, for Android WebView) hence the implementation of |
24 // this will be injected from the logical 'browser' side code. | 25 // this will be injected from the logical 'browser' side code. |
25 class SynchronousCompositorFactory { | 26 class SynchronousCompositorFactory { |
26 public: | 27 public: |
27 // Must only be called once, e.g. on startup. Ownership of |instance| remains | 28 // Must only be called once, e.g. on startup. Ownership of |instance| remains |
28 // with the caller. | 29 // with the caller. |
29 static void SetInstance(SynchronousCompositorFactory* instance); | 30 static void SetInstance(SynchronousCompositorFactory* instance); |
30 static SynchronousCompositorFactory* GetInstance(); | 31 static SynchronousCompositorFactory* GetInstance(); |
31 | 32 |
32 virtual scoped_refptr<base::MessageLoopProxy> | 33 virtual scoped_refptr<base::MessageLoopProxy> |
33 GetCompositorMessageLoop() = 0; | 34 GetCompositorMessageLoop() = 0; |
34 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( | 35 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( |
35 int routing_id) = 0; | 36 int routing_id) = 0; |
36 | 37 |
38 virtual scoped_refptr<cc::ContextProvider> | |
39 GetOffscreenContextProviderForMainThread() = 0; | |
40 virtual scoped_refptr<cc::ContextProvider> | |
41 GetOffscreenContextProviderForCompositorThread() = 0; | |
42 | |
37 protected: | 43 protected: |
38 SynchronousCompositorFactory() {} | 44 SynchronousCompositorFactory() {} |
39 ~SynchronousCompositorFactory() {} | 45 ~SynchronousCompositorFactory() {} |
40 }; | 46 }; |
41 | 47 |
42 } | 48 } |
43 | 49 |
44 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ | 50 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ |
OLD | NEW |