File indexing completed on 2024-11-10 04:56:56

0001 /*
0002     SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "scene/surfaceitem.h"
0010 
0011 #include <QImage>
0012 
0013 namespace KWin
0014 {
0015 
0016 class QPainterBackend;
0017 
0018 class KWIN_EXPORT QPainterSurfaceTexture : public SurfaceTexture
0019 {
0020 public:
0021     explicit QPainterSurfaceTexture(QPainterBackend *backend);
0022 
0023     bool isValid() const override;
0024 
0025     QPainterBackend *backend() const;
0026     QImage image() const;
0027 
0028     virtual bool create() = 0;
0029     virtual void update(const QRegion &region) = 0;
0030 
0031 protected:
0032     QPainterBackend *m_backend;
0033     QImage m_image;
0034 };
0035 
0036 } // namespace KWin