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
5
#
include
"qminimalbackingstore.h"
6
#
include
"qminimalintegration.h"
7
#
include
"qscreen.h"
8
#
include
<
QtCore
/
qdebug
.
h
>
9
#
include
<
qpa
/
qplatformscreen
.
h
>
10
#
include
<
private
/
qguiapplication_p
.
h
>
11
12
QT_BEGIN_NAMESPACE
13
14
using
namespace
Qt::StringLiterals;
15
16
QMinimalBackingStore::QMinimalBackingStore(QWindow *window)
17
: QPlatformBackingStore(window)
18
, mDebug(
QMinimalIntegration
::
instance
(
)
->
options
(
)
&
QMinimalIntegration
::
DebugBackingStore
)
19
{
20
if
(mDebug)
21
qDebug() <<
"QMinimalBackingStore::QMinimalBackingStore:"
<< (quintptr)
this
;
22
}
23
24
QMinimalBackingStore::~QMinimalBackingStore()
25
{
26
}
27
28
QPaintDevice *QMinimalBackingStore::paintDevice()
29
{
30
if
(mDebug)
31
qDebug(
"QMinimalBackingStore::paintDevice"
);
32
33
return
&mImage;
34
}
35
36
void
QMinimalBackingStore::flush(QWindow *window,
const
QRegion ®ion,
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
50
void
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
57
QT_END_NAMESPACE
QMinimalIntegration
Definition
qminimalintegration.h:33
QMinimalIntegration::options
unsigned options() const
Definition
qminimalintegration.h:54
QMinimalIntegration::DebugBackingStore
@ DebugBackingStore
Definition
qminimalintegration.h:36
QMinimalIntegration::instance
static QMinimalIntegration * instance()
Definition
qminimalintegration.cpp:169
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtbase
src
plugins
platforms
minimal
qminimalbackingstore.cpp
Generated on
for Qt by
1.14.0