| 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 #include "gpu/config/gpu_info.h" | 10 #include "gpu/config/gpu_info.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class ContextProviderWebContext; | 24 class ContextProviderWebContext; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace gpu_blink { | 27 namespace gpu_blink { |
| 28 class WebGraphicsContext3DInProcessCommandBufferImpl; | 28 class WebGraphicsContext3DInProcessCommandBufferImpl; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace content { | 31 namespace content { |
| 32 | 32 |
| 33 class InputHandlerManagerClient; | 33 class InputHandlerManagerClient; |
| 34 class SynchronousInputHandlerProxyClient; |
| 34 class StreamTextureFactory; | 35 class StreamTextureFactory; |
| 35 class FrameSwapMessageQueue; | 36 class FrameSwapMessageQueue; |
| 36 | 37 |
| 37 // Decouples creation from usage of the parts needed for the synchonous | 38 // Decouples creation from usage of the parts needed for the synchonous |
| 38 // compositor rendering path. In practice this is only used in single | 39 // compositor rendering path. In practice this is only used in single |
| 39 // process mode (namely, for Android WebView) hence the implementation of | 40 // process mode (namely, for Android WebView) hence the implementation of |
| 40 // this will be injected from the logical 'browser' side code. | 41 // this will be injected from the logical 'browser' side code. |
| 41 class SynchronousCompositorFactory { | 42 class SynchronousCompositorFactory { |
| 42 public: | 43 public: |
| 43 // Must only be called once, e.g. on startup. Ownership of |instance| remains | 44 // Must only be called once, e.g. on startup. Ownership of |instance| remains |
| 44 // with the caller. | 45 // with the caller. |
| 45 static void SetInstance(SynchronousCompositorFactory* instance); | 46 static void SetInstance(SynchronousCompositorFactory* instance); |
| 46 static SynchronousCompositorFactory* GetInstance(); | 47 static SynchronousCompositorFactory* GetInstance(); |
| 47 | 48 |
| 48 virtual scoped_refptr<base::SingleThreadTaskRunner> | 49 virtual scoped_refptr<base::SingleThreadTaskRunner> |
| 49 GetCompositorTaskRunner() = 0; | 50 GetCompositorTaskRunner() = 0; |
| 50 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( | 51 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( |
| 51 int routing_id, | 52 int routing_id, |
| 52 const scoped_refptr<FrameSwapMessageQueue>& frame_swap_message_queue, | 53 const scoped_refptr<FrameSwapMessageQueue>& frame_swap_message_queue, |
| 53 const scoped_refptr<cc::ContextProvider>& onscreen_context, | 54 const scoped_refptr<cc::ContextProvider>& onscreen_context, |
| 54 const scoped_refptr<cc::ContextProvider>& worker_context) = 0; | 55 const scoped_refptr<cc::ContextProvider>& worker_context) = 0; |
| 55 | 56 |
| 56 // The factory maintains ownership of the returned interface. | 57 // The factory maintains ownership of the returned interface. |
| 57 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() = 0; | 58 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() = 0; |
| 59 virtual SynchronousInputHandlerProxyClient* |
| 60 GetSynchronousInputHandlerProxyClient() = 0; |
| 58 | 61 |
| 59 virtual scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( | 62 virtual scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( |
| 60 int routing_id) = 0; | 63 int routing_id) = 0; |
| 61 | 64 |
| 62 protected: | 65 protected: |
| 63 SynchronousCompositorFactory() {} | 66 SynchronousCompositorFactory() {} |
| 64 virtual ~SynchronousCompositorFactory() {} | 67 virtual ~SynchronousCompositorFactory() {} |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace content | 70 } // namespace content |
| 68 | 71 |
| 69 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ | 72 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_ |
| OLD | NEW |