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 ContextProvider; |
16 class OutputSurface; | 17 class OutputSurface; |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
21 class InputHandlerManagerClient; | 22 class InputHandlerManagerClient; |
22 | 23 |
23 // Decouples creation from usage of the parts needed for the synchonous | 24 // Decouples creation from usage of the parts needed for the synchonous |
24 // compositor rendering path. In practice this is only used in single | 25 // compositor rendering path. In practice this is only used in single |
25 // process mode (namely, for Android WebView) hence the implementation of | 26 // process mode (namely, for Android WebView) hence the implementation of |
26 // this will be injected from the logical 'browser' side code. | 27 // this will be injected from the logical 'browser' side code. |
27 class SynchronousCompositorFactory { | 28 class SynchronousCompositorFactory { |
28 public: | 29 public: |
29 // Must only be called once, e.g. on startup. Ownership of |instance| remains | 30 // Must only be called once, e.g. on startup. Ownership of |instance| remains |
30 // with the caller. | 31 // with the caller. |
31 static void SetInstance(SynchronousCompositorFactory* instance); | 32 static void SetInstance(SynchronousCompositorFactory* instance); |
32 static SynchronousCompositorFactory* GetInstance(); | 33 static SynchronousCompositorFactory* GetInstance(); |
33 | 34 |
34 virtual scoped_refptr<base::MessageLoopProxy> | 35 virtual scoped_refptr<base::MessageLoopProxy> |
35 GetCompositorMessageLoop() = 0; | 36 GetCompositorMessageLoop() = 0; |
36 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( | 37 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( |
37 int routing_id) = 0; | 38 int routing_id) = 0; |
38 | 39 |
39 // The factory maintains ownership of the returned interface. | 40 // The factory maintains ownership of the returned interface. |
40 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() = 0; | 41 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() = 0; |
41 | 42 |
| 43 virtual scoped_refptr<cc::ContextProvider> |
| 44 GetOffscreenContextProviderForMainThread() = 0; |
| 45 virtual scoped_refptr<cc::ContextProvider> |
| 46 GetOffscreenContextProviderForCompositorThread() = 0; |
| 47 |
42 protected: | 48 protected: |
43 SynchronousCompositorFactory() {} | 49 SynchronousCompositorFactory() {} |
44 ~SynchronousCompositorFactory() {} | 50 ~SynchronousCompositorFactory() {} |
45 }; | 51 }; |
46 | 52 |
47 } | 53 } |
48 | 54 |
49 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ | 55 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ |
OLD | NEW |