Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwidgetrepaintmanager_p.h
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#ifndef QWIDGETREPAINTMANAGER_P_H
5#define QWIDGETREPAINTMANAGER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtWidgets/private/qtwidgetsglobal_p.h>
19#include <QDebug>
20#include <QtWidgets/qwidget.h>
21#include <private/qwidget_p.h>
22#include <QtGui/qbackingstore.h>
23
25
29class QRhi;
30class QRhiSwapChain;
31
32class Q_WIDGETS_EXPORT QWidgetRepaintManager
33{
35public:
38 UpdateLater
39 };
40 Q_ENUM(UpdateTime)
41
44 BufferInvalid
45 };
47
50
51 QBackingStore *backingStore() const { return store; }
52 void setBackingStore(QBackingStore *backingStore) { store = backingStore; }
53
54 template <class T>
55 void markDirty(const T &r, QWidget *widget, UpdateTime updateTime = UpdateLater,
56 BufferState bufferState = BufferValid);
57
58 void removeDirtyWidget(QWidget *w);
59
60 void sync(QWidget *exposedWidget, const QRegion &exposedRegion);
61 void sync();
62
63 void markNeedsFlush(QWidget *widget, const QRegion &region, const QPoint &topLevelOffset);
64
65 void addStaticWidget(QWidget *widget);
66 void moveStaticWidgets(QWidget *reparented);
67 void removeStaticWidget(QWidget *widget);
68 QRegion staticContents(QWidget *widget = nullptr, const QRect &withinClipRect = QRect()) const;
69 QRegion dirtyRegion() const { return dirty; }
70 QList<QWidget *> dirtyWidgetList() const { return dirtyWidgets; }
71 bool isDirty() const;
72
73 bool bltRect(const QRect &rect, int dx, int dy, QWidget *widget);
74
75 QRhi *rhi() const;
76
77private:
78 void updateLists(QWidget *widget);
79
80 void addDirtyWidget(QWidget *widget, const QRegion &rgn);
81 void resetWidget(QWidget *widget);
82
83 void addDirtyRenderToTextureWidget(QWidget *widget);
84
85 void sendUpdateRequest(QWidget *widget, UpdateTime updateTime);
86
87 bool syncAllowed();
88 void paintAndFlush();
89
90 void markNeedsFlush(QWidget *widget, const QRegion &region = QRegion());
91
92 void flush();
93 void flush(QWidget *widget, const QRegion &region, QPlatformTextureList *widgetTextures);
94
95 bool hasStaticContents() const;
96 void updateStaticContentsSize();
97
98 QWidget *tlw = nullptr;
99 QBackingStore *store = nullptr;
100
101 QRegion dirty; // needsRepaint
102 QList<QWidget *> dirtyWidgets;
103 QList<QWidget *> dirtyRenderToTextureWidgets;
104
105 QRegion topLevelNeedsFlush;
106 QList<QWidget *> needsFlushWidgets;
107
108 QList<QWidget *> staticWidgets;
109
110 QPlatformTextureListWatcher *textureListWatcher = nullptr;
111
112 bool updateRequestSent = false;
113
114 QElapsedTimer perfTime;
115 int perfFrames = 0;
116
117 Q_DISABLE_COPY_MOVE(QWidgetRepaintManager)
118};
119
121
122#endif // QWIDGETREPAINTMANAGER_P_H
The QBackingStore class provides a drawing area for QWindow.
\inmodule QtCore
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\inmodule QtGui
Definition qrhi.h:1549
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
QBackingStore * backingStore() const
void setBackingStore(QBackingStore *backingStore)
QList< QWidget * > dirtyWidgetList() const
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QOpenGLWidget * widget
[1]
rect
[4]
Combined button and popup list for selecting options.
GLfloat GLfloat GLfloat w
[0]
GLboolean r
[2]
GLdouble GLdouble t
Definition qopenglext.h:243
#define Q_ENUM(x)
#define Q_GADGET