Fix search results being clipped in app list.
[chromium-blink-merge.git] / ui / ozone / platform / drm / gbm_surface_factory.h
blob355a0ad1d812e18a322c542ae67915f3cad8949e
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_GBM_SURFACE_FACTORY_H_
6 #define UI_OZONE_PLATFORM_DRM_GBM_SURFACE_FACTORY_H_
8 #include "ui/ozone/platform/drm/drm_surface_factory.h"
10 namespace ui {
12 class DrmDeviceManager;
13 class DrmWindow;
14 class GbmDevice;
15 class ScreenManager;
17 class GbmSurfaceFactory : public DrmSurfaceFactory {
18 public:
19 GbmSurfaceFactory(bool allow_surfaceless);
20 ~GbmSurfaceFactory() override;
22 void InitializeGpu(DrmDeviceManager* drm_device_manager,
23 ScreenManager* screen_manager);
25 // DrmSurfaceFactory:
26 intptr_t GetNativeDisplay() override;
27 int GetDrmFd() override;
28 const int32_t* GetEGLSurfaceProperties(const int32_t* desired_list) override;
29 bool LoadEGLGLES2Bindings(
30 AddGLLibraryCallback add_gl_library,
31 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
32 scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
33 gfx::AcceleratedWidget widget) override;
34 scoped_ptr<ui::SurfaceOzoneEGL> CreateEGLSurfaceForWidget(
35 gfx::AcceleratedWidget w) override;
36 scoped_ptr<SurfaceOzoneEGL> CreateSurfacelessEGLSurfaceForWidget(
37 gfx::AcceleratedWidget widget) override;
38 scoped_refptr<ui::NativePixmap> CreateNativePixmap(
39 gfx::AcceleratedWidget widget,
40 gfx::Size size,
41 BufferFormat format,
42 BufferUsage usage) override;
43 OverlayCandidatesOzone* GetOverlayCandidates(
44 gfx::AcceleratedWidget w) override;
45 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
46 int plane_z_order,
47 gfx::OverlayTransform plane_transform,
48 scoped_refptr<NativePixmap> buffer,
49 const gfx::Rect& display_bounds,
50 const gfx::RectF& crop_rect) override;
51 bool CanShowPrimaryPlaneAsOverlay() override;
52 bool CanCreateNativePixmap(BufferUsage usage) override;
54 private:
55 scoped_refptr<GbmDevice> GetGbmDevice(gfx::AcceleratedWidget widget);
57 bool allow_surfaceless_;
59 DrmDeviceManager* drm_device_manager_; // Not owned.
61 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceFactory);
64 } // namespace ui
66 #endif // UI_OZONE_PLATFORM_DRM_GBM_SURFACE_FACTORY_H_