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.
5 #ifndef COMPOSITOR_CONTEXT_FACTORY_EFL_H_
6 #define COMPOSITOR_CONTEXT_FACTORY_EFL_H_
8 #include "ui/compositor/compositor.h"
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;
17 class RenderWidgetHostViewEfl;
22 class ContextProviderInProcess;
27 class ContextProviderWebContext;
32 class ContextFactoryEfl : public ContextFactory {
34 ContextFactoryEfl(content::ContextFactoryDelegate* delegate);
36 void CreateOutputSurface(base::WeakPtr<Compositor> compositor) override;
38 scoped_ptr<Reflector> CreateReflector(Compositor* mirrored_compositor,
39 Layer* mirroring_layer) override;
41 void RemoveReflector(Reflector* reflector) override;
43 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override;
45 void RemoveCompositor(Compositor* compositor) override;
47 bool DoesCreateTestContexts() override;
49 uint32 GetImageTextureTarget(gfx::BufferFormat format,
50 gfx::BufferUsage usage) override;
52 cc::SharedBitmapManager* GetSharedBitmapManager() override;
54 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
56 cc::TaskGraphRunner* GetTaskGraphRunner() override;
58 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override;
60 void SetSurfaceID(int surface_id, gfx::AcceleratedWidget widget);
62 void GetFrameFromMailbox(gpu::Mailbox* mailbox, gfx::Size size);
64 void OnLostMainThreadSharedContextInsideCallback();
66 // Resize the display corresponding to this compositor to a particular size.
67 void ResizeDisplay(ui::Compositor* compositor,
68 const gfx::Size& size) override {};
71 content::ContextFactoryDelegate* delegate_;
73 uint32_t next_surface_id_namespace_;
74 base::WeakPtrFactory<ContextFactoryEfl> schedule_draw_factory_;
75 scoped_refptr<content::ContextProviderCommandBuffer> shared_main_thread_contexts_;
80 #endif // COMPOSITOR_CONTEXT_FACTORY_EFL_H_