1 // Copyright 2014 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 UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_FACTORY_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_FACTORY_H_
8 #include "ui/ozone/platform/drm/gpu/drm_surface_factory.h"
12 class DrmDeviceManager
;
17 class GbmSurfaceFactory
: public DrmSurfaceFactory
{
19 GbmSurfaceFactory(bool allow_surfaceless
);
20 ~GbmSurfaceFactory() override
;
22 void InitializeGpu(DrmDeviceManager
* drm_device_manager
,
23 ScreenManager
* screen_manager
);
26 intptr_t GetNativeDisplay() override
;
27 const int32_t* GetEGLSurfaceProperties(const int32_t* desired_list
) override
;
28 bool LoadEGLGLES2Bindings(
29 AddGLLibraryCallback add_gl_library
,
30 SetGLGetProcAddressProcCallback set_gl_get_proc_address
) override
;
31 scoped_ptr
<SurfaceOzoneCanvas
> CreateCanvasForWidget(
32 gfx::AcceleratedWidget widget
) override
;
33 scoped_ptr
<ui::SurfaceOzoneEGL
> CreateEGLSurfaceForWidget(
34 gfx::AcceleratedWidget w
) override
;
35 scoped_ptr
<SurfaceOzoneEGL
> CreateSurfacelessEGLSurfaceForWidget(
36 gfx::AcceleratedWidget widget
) override
;
37 scoped_refptr
<ui::NativePixmap
> CreateNativePixmap(
38 gfx::AcceleratedWidget widget
,
41 BufferUsage usage
) override
;
42 bool CanShowPrimaryPlaneAsOverlay() override
;
43 bool CanCreateNativePixmap(BufferUsage usage
) override
;
46 scoped_refptr
<GbmDevice
> GetGbmDevice(gfx::AcceleratedWidget widget
);
48 bool allow_surfaceless_
;
50 DrmDeviceManager
* drm_device_manager_
; // Not owned.
52 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceFactory
);
57 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_FACTORY_H_