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