feat: add vaapi path for video wallpapers on generic gpus
C++ / fmt (pull_request) Failing after 6s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 11s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Failing after 32s
Rust / build (pull_request) Successful in 52s
Python / verify (pull_request) Failing after 1m23s
Rust / fmt (pull_request) Successful in 51s
Rust / clippy (pull_request) Successful in 1m2s

This commit is contained in:
2026-10-27 02:15:16 +01:00
parent e655ec5bc7
commit b0cb43f75c
39 changed files with 1670 additions and 599 deletions
@@ -0,0 +1,73 @@
#pragma once
#include <EGL/egl.h>
#include <wayland-egl.h>
#include <atomic>
#include <QSize>
#include <QString>
#include <qwayland-fractional-scale-v1.h>
#include <qwayland-viewporter.h>
#include <qwayland-wlr-layer-shell-unstable-v1.h>
#include <wayland-client-protocol.h>
namespace ZShell::wallpaper {
class WallpaperService;
class WallpaperSurface : public QtWayland::zwlr_layer_surface_v1,
public QtWayland::wp_viewport,
public QtWayland::wp_fractional_scale_v1 {
public:
WallpaperSurface(
WallpaperService* service,
wl_surface* surface,
wl_output* output,
const QString& screen);
~WallpaperSurface() override;
[[nodiscard]] const QString& screen() const { return m_screen; }
[[nodiscard]] const QSize& size() const { return m_size; }
[[nodiscard]] const QSize& bufferSize() const { return m_bufferSize; }
[[nodiscard]] EGLSurface eglSurface() const { return m_eglSurface; }
void markDirty();
[[nodiscard]] bool needsDraw() const;
[[nodiscard]] bool frameReady() const;
void requestFrame();
void endDraw();
private:
void zwlr_layer_surface_v1_configure(
uint32_t serial, uint32_t width, uint32_t height) override;
void zwlr_layer_surface_v1_closed() override;
void wp_fractional_scale_v1_preferred_scale(uint32_t scale) override;
void updateBuffer();
void onFrameDone();
WallpaperService* m_service;
QString m_screen;
wl_surface* m_surface;
wl_egl_window* m_window = nullptr;
EGLSurface m_eglSurface = EGL_NO_SURFACE;
QSize m_size;
QSize m_bufferSize;
qreal m_scale = 1.0;
bool configured = false;
std::atomic<bool> m_dirty{false};
std::atomic<bool> m_frameReady{true};
struct wl_callback* m_frameCallback = nullptr;
};
} // namespace ZShell::wallpaper