OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ | |
6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/memory/ref_counted.h" | |
11 #include "gpu/config/gpu_info.h" | |
12 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | |
13 | |
14 namespace base { | |
15 class SingleThreadTaskRunner; | |
16 } | |
17 | |
18 namespace cc { | |
19 class BeginFrameSource; | |
20 class ContextProvider; | |
21 class OutputSurface; | |
22 } | |
23 | |
24 namespace content { | |
25 | |
26 class InputHandlerManagerClient; | |
27 class SynchronousInputHandlerProxyClient; | |
28 class FrameSwapMessageQueue; | |
29 | |
30 // Decouples creation from usage of the parts needed for the synchonous | |
31 // compositor rendering path. In practice this is only used in single | |
32 // process mode (namely, for Android WebView) hence the implementation of | |
33 // this will be injected from the logical 'browser' side code. | |
34 class SynchronousCompositorFactory { | |
35 public: | |
36 // Must only be called once, e.g. on startup. Ownership of |instance| remains | |
37 // with the caller. | |
38 static void SetInstance(SynchronousCompositorFactory* instance); | |
39 static SynchronousCompositorFactory* GetInstance(); | |
40 | |
41 virtual scoped_refptr<base::SingleThreadTaskRunner> | |
42 GetCompositorTaskRunner() = 0; | |
43 virtual std::unique_ptr<cc::OutputSurface> CreateOutputSurface( | |
44 int routing_id, | |
45 uint32_t output_surface_id, | |
46 const scoped_refptr<FrameSwapMessageQueue>& frame_swap_message_queue, | |
47 const scoped_refptr<cc::ContextProvider>& onscreen_context, | |
48 const scoped_refptr<cc::ContextProvider>& worker_context) = 0; | |
49 | |
50 // The factory maintains ownership of the returned interface. | |
51 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() = 0; | |
52 virtual SynchronousInputHandlerProxyClient* | |
53 GetSynchronousInputHandlerProxyClient() = 0; | |
54 | |
55 virtual std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( | |
56 int routing_id) = 0; | |
57 | |
58 protected: | |
59 SynchronousCompositorFactory() {} | |
60 virtual ~SynchronousCompositorFactory() {} | |
61 }; | |
62 | |
63 } // namespace content | |
64 | |
65 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ | |
OLD | NEW |