[M47_2526] Chromium upversion to m47_2526 branch
[platform/framework/web/chromium-efl.git] / tizen_src / chromium_impl / content / browser / renderer_host / context_factory_efl.h
1 // Copyright 2015 Samsung Electronics. 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 COMPOSITOR_CONTEXT_FACTORY_EFL_H_
6 #define COMPOSITOR_CONTEXT_FACTORY_EFL_H_
7
8 #include "ui/compositor/compositor.h"
9
10 namespace content {
11 class ContextProviderCommandBuffer;
12 struct ContextFactoryDelegate {
13   // Updates new texture received from mailbox on evas gl surface
14   virtual void GetTextureFromMailbox(gpu::Mailbox* mailbox, gfx::Size size) = 0;
15 };
16
17 class RenderWidgetHostViewEfl;
18 }
19
20 namespace webkit {
21 namespace gpu {
22 class ContextProviderInProcess;
23 }
24 }
25
26 namespace cc_blink{
27 class ContextProviderWebContext;
28 }
29
30 namespace ui {
31
32 class ContextFactoryEfl : public ContextFactory {
33  public:
34   ContextFactoryEfl(content::ContextFactoryDelegate* delegate);
35
36   void CreateOutputSurface(base::WeakPtr<Compositor> compositor) override;
37
38   scoped_ptr<Reflector> CreateReflector(Compositor* mirrored_compositor,
39                                         Layer* mirroring_layer) override;
40
41   void RemoveReflector(Reflector* reflector) override;
42
43   scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override;
44
45   void RemoveCompositor(Compositor* compositor) override;
46
47   bool DoesCreateTestContexts() override;
48
49   uint32 GetImageTextureTarget(gfx::BufferFormat format,
50                                gfx::BufferUsage usage) override;
51
52   cc::SharedBitmapManager* GetSharedBitmapManager() override;
53
54   gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
55
56   cc::TaskGraphRunner* GetTaskGraphRunner() override;
57
58   scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override;
59
60   void SetSurfaceID(int surface_id, gfx::AcceleratedWidget widget);
61
62   void GetFrameFromMailbox(gpu::Mailbox* mailbox, gfx::Size size);
63
64   void OnLostMainThreadSharedContextInsideCallback();
65
66   // Resize the display corresponding to this compositor to a particular size.
67   void ResizeDisplay(ui::Compositor* compositor,
68                              const gfx::Size& size) override {};
69
70  private:
71   content::ContextFactoryDelegate* delegate_;
72   int surface_id_;
73   uint32_t next_surface_id_namespace_;
74   base::WeakPtrFactory<ContextFactoryEfl> schedule_draw_factory_;
75   scoped_refptr<content::ContextProviderCommandBuffer> shared_main_thread_contexts_;
76 };
77
78 }  // namespace ui
79
80 #endif  // COMPOSITOR_CONTEXT_FACTORY_EFL_H_