Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qminimalbackingstore.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
7#include "qscreen.h"
8#include <QtCore/qdebug.h>
9#include <qpa/qplatformscreen.h>
10#include <private/qguiapplication_p.h>
11
13
14using namespace Qt::StringLiterals;
15
16QMinimalBackingStore::QMinimalBackingStore(QWindow *window)
17 : QPlatformBackingStore(window)
19{
20 if (mDebug)
21 qDebug() << "QMinimalBackingStore::QMinimalBackingStore:" << (quintptr)this;
22}
23
24QMinimalBackingStore::~QMinimalBackingStore()
25{
26}
27
28QPaintDevice *QMinimalBackingStore::paintDevice()
29{
30 if (mDebug)
31 qDebug("QMinimalBackingStore::paintDevice");
32
33 return &mImage;
34}
35
36void QMinimalBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
37{
38 Q_UNUSED(window);
39 Q_UNUSED(region);
40 Q_UNUSED(offset);
41
42 if (mDebug) {
43 static int c = 0;
44 QString filename = QString("output%1.png").arg(c++, 4, 10, QChar(u'0'));
45 qDebug() << "QMinimalBackingStore::flush() saving contents to" << filename.toLocal8Bit().constData();
46 mImage.save(filename);
47 }
48}
49
50void QMinimalBackingStore::resize(const QSize &size, const QRegion &)
51{
52 QImage::Format format = QGuiApplication::primaryScreen()->handle()->format();
53 if (mImage.size() != size)
54 mImage = QImage(size, format);
55}
56
57QT_END_NAMESPACE
unsigned options() const
static QMinimalIntegration * instance()