Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qfbbackingstore.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
4
#
include
"qfbbackingstore_p.h"
5
#
include
"qfbwindow_p.h"
6
#
include
"qfbscreen_p.h"
7
8
#
include
<
qpa
/
qplatformwindow
.
h
>
9
#
include
<
QtGui
/
qscreen
.
h
>
10
#
include
<
QtGui
/
qpainter
.
h
>
11
12
QT_BEGIN_NAMESPACE
13
14
QFbBackingStore::QFbBackingStore(QWindow *window)
15
: QPlatformBackingStore(window)
16
{
17
if
(window->handle())
18
(
static_cast
<QFbWindow *>(window->handle()))->setBackingStore(
this
);
19
else
20
(
static_cast
<QFbScreen *>(window->screen()->handle()))->addPendingBackingStore(
this
);
21
}
22
23
QFbBackingStore
::~
QFbBackingStore
()
24
{
25
}
26
27
void
QFbBackingStore
::
flush
(QWindow *window,
const
QRegion ®ion,
const
QPoint &offset)
28
{
29
Q_UNUSED(window);
30
Q_UNUSED(offset);
31
32
(
static_cast
<
QFbWindow
*>(window->handle()))->repaint(region);
33
}
34
35
void
QFbBackingStore
::
resize
(
const
QSize &size,
const
QRegion &staticContents)
36
{
37
Q_UNUSED(staticContents);
38
39
if
(mImage.size() != size)
40
mImage = QImage(size, window()->screen()->handle()->format());
41
}
42
43
const
QImage
QFbBackingStore
::
image
()
44
{
45
return
mImage;
46
}
47
48
49
QImage
QFbBackingStore
::
toImage
()
const
50
{
51
return
mImage;
52
}
53
54
void
QFbBackingStore
::
lock
()
55
{
56
mImageMutex.lock();
57
}
58
59
void
QFbBackingStore
::
unlock
()
60
{
61
mImageMutex.unlock();
62
}
63
64
void
QFbBackingStore
::
beginPaint
(
const
QRegion ®ion)
65
{
66
lock
(
)
;
67
68
if
(mImage.hasAlphaChannel()) {
69
QPainter
p(&mImage);
70
p.setCompositionMode(QPainter::CompositionMode_Source);
71
for
(
const
QRect &r : region)
72
p.fillRect(r, Qt::transparent);
73
}
74
}
75
76
void
QFbBackingStore
::
endPaint
()
77
{
78
unlock
(
)
;
79
}
80
81
QT_END_NAMESPACE
QFbBackingStore
Definition
qfbbackingstore_p.h:29
QFbBackingStore::unlock
void unlock()
Definition
qfbbackingstore.cpp:59
QFbBackingStore::resize
void resize(const QSize &size, const QRegion ®ion) override
Definition
qfbbackingstore.cpp:35
QFbBackingStore::lock
void lock()
Definition
qfbbackingstore.cpp:54
QFbBackingStore::flush
void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override
Flushes the given region from the specified window.
Definition
qfbbackingstore.cpp:27
QFbBackingStore::toImage
QImage toImage() const override
Implemented in subclasses to return the content of the backingstore as a QImage.
Definition
qfbbackingstore.cpp:49
QFbBackingStore::endPaint
void endPaint() override
This function is called after painting onto the surface has ended.
Definition
qfbbackingstore.cpp:76
QFbBackingStore::beginPaint
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
Definition
qfbbackingstore.cpp:64
QFbBackingStore::image
const QImage image()
Definition
qfbbackingstore.cpp:43
QFbBackingStore::~QFbBackingStore
~QFbBackingStore()
Definition
qfbbackingstore.cpp:23
QFbWindow
Definition
qfbwindow_p.h:27
QPaintEngine::QPainter
friend class QPainter
Definition
qpaintengine.h:220
qtbase
src
platformsupport
fbconvenience
qfbbackingstore.cpp
Generated on
for Qt by
1.18.0