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
qohoseglplatformcontext.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 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
7#include "render/qohosegl.h"
8
9#include <QtGui/private/qeglpbuffer_p.h>
10#include <QtGui/qsurface.h>
11
13
14QOhosEGLPlatformContext::QOhosEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display)
15 : QEGLPlatformContext(format, share, display, nullptr)
16 , m_isDuringSwappingBuffers(false)
17{
18}
19
20void QOhosEGLPlatformContext::swapBuffers(QPlatformSurface *surface)
21{
22 m_isDuringSwappingBuffers = true;
23 QEGLPlatformContext::swapBuffers(surface);
24 m_isDuringSwappingBuffers = false;
25
26 auto *ohosWindow = static_cast<QOhosFloatingWindow *>(surface);
27 auto *ohosView = ohosWindow != nullptr
28 ? ohosWindow->ownedViewOrNull()
29 : nullptr;
30 if (ohosView != nullptr)
31 ohosView->handleSurfaceContentsUpdated();
32}
33
34EGLSurface QOhosEGLPlatformContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
35{
36 if (surface->surface()->surfaceClass() != QSurface::Window)
37 return static_cast<QEGLPbuffer *>(surface)->pbuffer();
38
39 auto *ohosWindow = static_cast<QOhosFloatingWindow *>(surface);
40 auto *ohosWindowSurface = ohosWindow->ownedSurfaceOrNull();
41
42 return ohosWindowSurface != nullptr
43 ? ohosWindowSurface->tryGetOrCreateEGLWindowSurface(
44 eglDisplay(), eglConfig(), m_isDuringSwappingBuffers)
45 : EGL_NO_SURFACE;
46}
47
48QT_END_NAMESPACE
Combined button and popup list for selecting options.