File: qminimalbackingstore.cpp

package info (click to toggle)
dtkgui 5.7.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,340 kB
  • sloc: cpp: 19,512; ansic: 34; makefile: 15; sh: 15
file content (35 lines) | stat: -rw-r--r-- 837 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// SPDX-FileCopyrightText: 2023 Uniontech Software Technology Co.,Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#include "qminimalbackingstore.h"
#include "qminimalintegration.h"
#include "qscreen.h"
#include <QtCore/qdebug.h>
#include <qpa/qplatformscreen.h>
#include <private/qguiapplication_p.h>

MinimalBackingStore::MinimalBackingStore(QWindow *window)
    : QPlatformBackingStore(window)
{
}

MinimalBackingStore::~MinimalBackingStore()
{
}

QPaintDevice *MinimalBackingStore::paintDevice()
{
    return &mImage;
}

void MinimalBackingStore::flush(QWindow *, const QRegion &, const QPoint &)
{
}

void MinimalBackingStore::resize(const QSize &size, const QRegion &)
{
    QImage::Format format = QGuiApplication::primaryScreen()->handle()->format();
    if (mImage.size() != size)
        mImage = QImage(size, format);
}