1 // Copyright 2015 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 MANDOLINE_UI_AURA_SURFACE_CONTEXT_FACTORY_H_
6 #define MANDOLINE_UI_AURA_SURFACE_CONTEXT_FACTORY_H_
8 #include "components/mus/gles2/mojo_gpu_memory_buffer_manager.h"
9 #include "components/mus/gles2/raster_thread_helper.h"
10 #include "mandoline/ui/aura/surface_binding.h"
11 #include "ui/compositor/compositor.h"
23 class SurfaceContextFactory
: public ui::ContextFactory
{
25 SurfaceContextFactory(mojo::Shell
* shell
, mus::View
* view
);
26 ~SurfaceContextFactory() override
;
30 void CreateOutputSurface(base::WeakPtr
<ui::Compositor
> compositor
) override
;
31 scoped_ptr
<ui::Reflector
> CreateReflector(
32 ui::Compositor
* mirrored_compositor
,
33 ui::Layer
* mirroring_layer
) override
;
34 void RemoveReflector(ui::Reflector
* reflector
) override
;
35 scoped_refptr
<cc::ContextProvider
> SharedMainThreadContextProvider() override
;
36 void RemoveCompositor(ui::Compositor
* compositor
) override
;
37 bool DoesCreateTestContexts() override
;
38 uint32
GetImageTextureTarget(gfx::BufferFormat format
,
39 gfx::BufferUsage usage
) override
;
40 cc::SharedBitmapManager
* GetSharedBitmapManager() override
;
41 gpu::GpuMemoryBufferManager
* GetGpuMemoryBufferManager() override
;
42 cc::TaskGraphRunner
* GetTaskGraphRunner() override
;
43 scoped_ptr
<cc::SurfaceIdAllocator
> CreateSurfaceIdAllocator() override
;
44 void ResizeDisplay(ui::Compositor
* compositor
,
45 const gfx::Size
& size
) override
;
47 SurfaceBinding surface_binding_
;
48 uint32_t next_surface_id_namespace_
;
49 gles2::RasterThreadHelper raster_thread_helper_
;
50 mus::MojoGpuMemoryBufferManager gpu_memory_buffer_manager_
;
52 DISALLOW_COPY_AND_ASSIGN(SurfaceContextFactory
);
55 } // namespace mandoline
57 #endif // MANDOLINE_UI_AURA_SURFACE_CONTEXT_FACTORY_H_