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
qminimaleglbackingstore.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
6
7#include <QtGui/QOpenGLContext>
8#include <QtOpenGL/QOpenGLPaintDevice>
9
11
13 : QPlatformBackingStore(window)
14 , m_context(new QOpenGLContext)
15 , m_device(nullptr)
16{
17 m_context->setFormat(window->requestedFormat());
18 m_context->setScreen(window->screen());
19 m_context->create();
20}
21
23{
24 delete m_context;
25}
26
28{
29 return m_device;
30}
31
32void QMinimalEglBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
33{
34 Q_UNUSED(region);
35 Q_UNUSED(offset);
36
37#ifdef QEGL_EXTRA_DEBUG
38 qWarning("QEglBackingStore::flush %p", window);
39#endif
40
41 m_context->swapBuffers(window);
42}
43
44void QMinimalEglBackingStore::beginPaint(const QRegion &)
45{
46 m_context->makeCurrent(window());
47 m_device = new QOpenGLPaintDevice(window()->size());
48}
49
51{
52 delete m_device;
53}
54
55void QMinimalEglBackingStore::resize(const QSize &size, const QRegion &staticContents)
56{
57 Q_UNUSED(size);
58 Q_UNUSED(staticContents);
59}
60
61QT_END_NAMESPACE
void endPaint() override
This function is called after painting onto the surface has ended.
void resize(const QSize &size, const QRegion &staticContents) override
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
\inmodule QtGui
Definition qwindow.h:64
Combined button and popup list for selecting options.