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
qopenglcompositorbackingstore_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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#ifndef QOPENGLCOMPOSITORBACKINGSTORE_H
6#define QOPENGLCOMPOSITORBACKINGSTORE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtOpenGL/qtopenglglobal.h>
20
21#include <qpa/qplatformbackingstore.h>
22#include <QImage>
23#include <QRegion>
24#include <private/qglobal_p.h>
25
27
28class QOpenGLContext;
29class QPlatformTextureList;
30class QRhiTexture;
31
32class Q_OPENGL_EXPORT QOpenGLCompositorBackingStore : public QPlatformBackingStore
33{
34public:
35 QOpenGLCompositorBackingStore(QWindow *window);
36 ~QOpenGLCompositorBackingStore();
37
38 QPaintDevice *paintDevice() override;
39
40 void beginPaint(const QRegion &region) override;
41
42 void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
43 void resize(const QSize &size, const QRegion &staticContents) override;
44
45 QImage toImage() const override;
46
47 FlushResult rhiFlush(QWindow *window,
48 qreal sourceDevicePixelRatio,
49 const QRegion &region,
50 const QPoint &offset,
51 QPlatformTextureList *textures,
52 bool translucentBackground,
53 qreal sourceTransformFactor = 0) override;
54
55 const QPlatformTextureList *textures() const { return m_textures; }
56
57 void notifyComposited();
58
59private:
60 void updateTexture();
61
62 QWindow *m_window;
63 QImage m_image;
64 QRegion m_dirty;
65 uint m_bsTexture;
66 QRhiTexture *m_bsTextureWrapper;
67 QOpenGLContext *m_bsTextureContext;
68 QPlatformTextureList *m_textures;
69 QPlatformTextureList *m_lockedWidgetTextures;
70 QRhi *m_rhi;
71};
72
73QT_END_NAMESPACE
74
75#endif // QOPENGLCOMPOSITORBACKINGSTORE_H
A backing store implementation for OpenGL.
Combined button and popup list for selecting options.
#define GL_UNPACK_ROW_LENGTH