kwin/src/surfaceitem_internal.h
Vlad Zahorodnii 0ebc563e6c Drop Toplevel::bufferScale()
On Wayland, a window can have subsurfaces. The spec doesn't require the
main surface and its sub-surfaces to have the same scale factor.

Given that Toplevel::bufferScale() makes no sense with Wayland windows,
this change drops it to make code more reasonable and to prevent people
from using Toplevel::bufferScale().
2021-11-16 09:38:51 +02:00

57 lines
1.1 KiB
C++

/*
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "surfaceitem.h"
class QOpenGLFramebufferObject;
namespace KWin
{
class InternalClient;
/**
* The SurfaceItemInternal class represents an internal surface in the scene.
*/
class KWIN_EXPORT SurfaceItemInternal : public SurfaceItem
{
Q_OBJECT
public:
explicit SurfaceItemInternal(InternalClient *window, Item *parent = nullptr);
QRegion shape() const override;
private Q_SLOTS:
void handleBufferGeometryChanged(Toplevel *toplevel, const QRect &old);
protected:
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;
};
} // namespace KWin