xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/vulkan/linux/wayland/DisplayVkWayland.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2021-2022 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // DisplayVkWayland.h:
7 //    Defines the class interface for DisplayVkWayland, implementing DisplayVk for Wayland.
8 //
9 
10 #ifndef LIBANGLE_RENDERER_VULKAN_WAYLAND_DISPLAYVKWAYLAND_H_
11 #define LIBANGLE_RENDERER_VULKAN_WAYLAND_DISPLAYVKWAYLAND_H_
12 
13 #include "libANGLE/renderer/vulkan/linux/DisplayVkLinux.h"
14 
15 struct wl_display;
16 
17 namespace rx
18 {
19 
20 class DisplayVkWayland : public DisplayVkLinux
21 {
22   public:
23     DisplayVkWayland(const egl::DisplayState &state);
24 
25     egl::Error initialize(egl::Display *display) override;
26     void terminate() override;
27 
28     bool isValidNativeWindow(EGLNativeWindowType window) const override;
29 
30     SurfaceImpl *createWindowSurfaceVk(const egl::SurfaceState &state,
31                                        EGLNativeWindowType window) override;
32 
33     egl::ConfigSet generateConfigs() override;
34     void checkConfigSupport(egl::Config *config) override;
35 
36     const char *getWSIExtension() const override;
37 
38     angle::NativeWindowSystem getWindowSystem() const override;
39 
40   private:
41     bool mOwnDisplay;
42     wl_display *mWaylandDisplay;
43 };
44 
45 }  // namespace rx
46 
47 #endif  // LIBANGLE_RENDERER_VULKAN_WAYLAND_DISPLAYVKWAYLAND_H_
48