kwin/plugins/platforms/x11/standalone/x11xrenderbackend.h

49 lines
1.1 KiB
C
Raw Normal View History

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2006 Lubos Lunak <l.lunak@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "xrenderbackend.h"
namespace KWin
{
2020-11-19 08:52:29 +00:00
class SoftwareVsyncMonitor;
class X11StandalonePlatform;
/**
* @brief XRenderBackend using an X11 Overlay Window as compositing target.
*/
2020-11-19 08:52:29 +00:00
class X11XRenderBackend : public QObject, public XRenderBackend
{
2020-11-19 08:52:29 +00:00
Q_OBJECT
public:
explicit X11XRenderBackend(X11StandalonePlatform *backend);
~X11XRenderBackend() override;
void present(int mask, const QRegion &damage) override;
OverlayWindow *overlayWindow() override;
void showOverlay() override;
void screenGeometryChanged(const QSize &size) override;
private:
void init(bool createOverlay);
void createBuffer();
2020-11-19 08:52:29 +00:00
void vblank(std::chrono::nanoseconds timestamp);
X11StandalonePlatform *m_backend;
2020-11-19 08:52:29 +00:00
SoftwareVsyncMonitor *m_vsyncMonitor;
QScopedPointer<OverlayWindow> m_overlayWindow;
xcb_render_picture_t m_front;
xcb_render_pictformat_t m_format;
};
} // namespace KWin