2021-02-04 09:07:20 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "surfaceitem.h"
|
|
|
|
|
2021-08-12 09:07:38 +00:00
|
|
|
class QOpenGLFramebufferObject;
|
|
|
|
|
2021-02-04 09:07:20 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2021-11-16 07:38:51 +00:00
|
|
|
class InternalClient;
|
|
|
|
|
2021-02-04 09:07:20 +00:00
|
|
|
/**
|
|
|
|
* The SurfaceItemInternal class represents an internal surface in the scene.
|
|
|
|
*/
|
|
|
|
class KWIN_EXPORT SurfaceItemInternal : public SurfaceItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-11-16 07:38:51 +00:00
|
|
|
explicit SurfaceItemInternal(InternalClient *window, Item *parent = nullptr);
|
2021-02-04 09:07:20 +00:00
|
|
|
|
|
|
|
QRegion shape() const override;
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
2022-04-18 07:42:11 +00:00
|
|
|
void handleBufferGeometryChanged(AbstractClient *toplevel, const QRect &old);
|
2021-02-04 09:07:20 +00:00
|
|
|
|
|
|
|
protected:
|
2021-04-09 07:06:04 +00:00
|
|
|
SurfacePixmap *createPixmap() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class KWIN_EXPORT SurfacePixmapInternal final : public SurfacePixmap
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit SurfacePixmapInternal(SurfaceItemInternal *item, QObject *parent = nullptr);
|
|
|
|
|
|
|
|
QOpenGLFramebufferObject *fbo() const;
|
|
|
|
QImage image() const;
|
|
|
|
|
|
|
|
void create() override;
|
|
|
|
void update() override;
|
|
|
|
bool isValid() const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
SurfaceItemInternal *m_item;
|
|
|
|
QSharedPointer<QOpenGLFramebufferObject> m_fbo;
|
|
|
|
QImage m_rasterBuffer;
|
2021-02-04 09:07:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWin
|