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
5
6#include <QtGui/QOpenGLContext>
7#include <QtOpenGL/QOpenGLPaintDevice>
8
10
12 : QPlatformBackingStore(window)
13 , m_context(new QOpenGLContext)
14 , m_device(nullptr)
15{
16 m_context->setFormat(window->requestedFormat());
17 m_context->setScreen(window->screen());
18 m_context->create();
19}
20
22{
23 delete m_context;
24}
25
27{
28 return m_device;
29}
30
31void QMinimalEglBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
32{
33 Q_UNUSED(region);
34 Q_UNUSED(offset);
35
36#ifdef QEGL_EXTRA_DEBUG
37 qWarning("QEglBackingStore::flush %p", window);
38#endif
39
40 m_context->swapBuffers(window);
41}
42
43void QMinimalEglBackingStore::beginPaint(const QRegion &)
44{
45 m_context->makeCurrent(window());
46 m_device = new QOpenGLPaintDevice(window()->size());
47}
48
50{
51 delete m_device;
52}
53
54void QMinimalEglBackingStore::resize(const QSize &size, const QRegion &staticContents)
55{
56 Q_UNUSED(size);
57 Q_UNUSED(staticContents);
58}
59
60QT_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:63