Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / renderer / android / synchronous_compositor_factory.h
blobc21d82acf09e2b778d5543f265647707b891d625
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.
5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_
6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
12 namespace base {
13 class MessageLoopProxy;
16 namespace cc {
17 class ContextProvider;
18 class OutputSurface;
21 namespace webkit {
22 namespace gpu {
23 class ContextProviderWebContext;
27 namespace content {
29 class InputHandlerManagerClient;
30 class StreamTextureFactory;
31 class FrameSwapMessageQueue;
33 // Decouples creation from usage of the parts needed for the synchonous
34 // compositor rendering path. In practice this is only used in single
35 // process mode (namely, for Android WebView) hence the implementation of
36 // this will be injected from the logical 'browser' side code.
37 class SynchronousCompositorFactory {
38 public:
39 // Must only be called once, e.g. on startup. Ownership of |instance| remains
40 // with the caller.
41 static void SetInstance(SynchronousCompositorFactory* instance);
42 static SynchronousCompositorFactory* GetInstance();
44 virtual scoped_refptr<base::MessageLoopProxy>
45 GetCompositorMessageLoop() = 0;
46 virtual bool RecordFullLayer() = 0;
47 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
48 int routing_id,
49 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue) = 0;
51 // The factory maintains ownership of the returned interface.
52 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() = 0;
54 virtual scoped_refptr<webkit::gpu::ContextProviderWebContext>
55 CreateOffscreenContextProvider(
56 const blink::WebGraphicsContext3D::Attributes& attributes,
57 const std::string& debug_name) = 0;
58 virtual scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory(
59 int frame_id) = 0;
60 virtual blink::WebGraphicsContext3D* CreateOffscreenGraphicsContext3D(
61 const blink::WebGraphicsContext3D::Attributes& attributes) = 0;
63 protected:
64 SynchronousCompositorFactory() {}
65 virtual ~SynchronousCompositorFactory() {}
70 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_