Project
Loading...
Searching...
No Matches
GPUDisplayFrontendWayland.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef GPUDISPLAYFRONTENDWAYLAND_H
16#define GPUDISPLAYFRONTENDWAYLAND_H
17
18#include "GPUDisplayFrontend.h"
19#include <pthread.h>
20#include <wayland-client.h>
21
22struct xdg_wm_base;
23struct xdg_toplevel;
24struct xdg_surface;
25struct zxdg_decoration_manager_v1;
26struct zxdg_toplevel_decoration_v1;
27struct xkb_context;
28struct xkb_keymap;
29struct xkb_state;
30
31namespace o2::gpu
32{
34{
35 public:
37 ~GPUDisplayFrontendWayland() override = default;
38
39 void DisplayExit() override;
40 void SwitchFullscreen(bool set) override;
41 void ToggleMaximized(bool set) override;
42 void SetVSync(bool enable) override;
43 void OpenGLPrint(const char* s, float x, float y, float r, float g, float b, float a, bool fromBotton = true) override;
44 void getSize(int32_t& width, int32_t& height) override;
45 int32_t getVulkanSurface(void* instance, void* surface) override;
46 uint32_t getReqVulkanExtensions(const char**& p) override;
47
48 private:
49 int32_t FrontendMain() override;
50 int32_t GetKey(uint32_t key, uint32_t state);
51 void createBuffer(uint32_t width, uint32_t height);
52 void recreateBuffer(uint32_t width, uint32_t height);
53
54 pthread_mutex_t mSemLockExit = PTHREAD_MUTEX_INITIALIZER;
55 volatile bool mDisplayRunning = false;
56
57 wl_display* mWayland = nullptr;
58 wl_registry* mRegistry = nullptr;
59
60 wl_compositor* mCompositor = nullptr;
61 wl_seat* mSeat = nullptr;
62 wl_pointer* mPointer = nullptr;
63 wl_keyboard* mKeyboard = nullptr;
64 xdg_wm_base* mXdgBase = nullptr;
65 wl_shm* mShm = nullptr;
66
67 wl_surface* mSurface = nullptr;
68 xdg_surface* mXdgSurface = nullptr;
69 xdg_toplevel* mXdgToplevel = nullptr;
70
71 wl_output* mOutput = nullptr;
72
73 int32_t mFd = 0;
74 wl_shm_pool* mPool;
75 wl_buffer* mBuffer;
76
77 xkb_context* mXKBcontext = nullptr;
78 xkb_keymap* mXKBkeymap = nullptr;
79 xkb_state* mXKBstate = nullptr;
80
81 zxdg_decoration_manager_v1* mDecManager = nullptr;
82 // zxdg_toplevel_decoration_v1* mXdgDecoration = nullptr;
83
84 int32_t mWidthRequested = 0;
85 int32_t mHeightRequested = 0;
86};
87} // namespace o2::gpu
88
89#endif
benchmark::State & state
StringRef key
~GPUDisplayFrontendWayland() override=default
int32_t getVulkanSurface(void *instance, void *surface) override
void getSize(int32_t &width, int32_t &height) override
void OpenGLPrint(const char *s, float x, float y, float r, float g, float b, float a, bool fromBotton=true) override
uint32_t getReqVulkanExtensions(const char **&p) override
GLint GLenum GLint x
Definition glcorearb.h:403
GLint GLsizei GLsizei height
Definition glcorearb.h:270
GLint GLsizei width
Definition glcorearb.h:270
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean g
Definition glcorearb.h:1233
GLboolean enable
Definition glcorearb.h:3991
GLboolean r
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
HANDLE pthread_mutex_t