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{
17}
18
19void QOhosEGLPlatformContext::swapBuffers(QPlatformSurface *surface)
20{
21 QEGLPlatformContext::swapBuffers(surface);
22
23 auto *ohosWindow = static_cast<QOhosFloatingWindow *>(surface);
24 auto *ohosView = ohosWindow != nullptr
25 ? ohosWindow->ownedViewOrNull()
26 : nullptr;
27 if (ohosView != nullptr)
28 ohosView->handleSurfaceContentsUpdated();
29}
30
31EGLSurface QOhosEGLPlatformContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
32{
33 if (surface->surface()->surfaceClass() != QSurface::Window)
34 return static_cast<QEGLPbuffer *>(surface)->pbuffer();
35
36 auto *ohosWindow = static_cast<QOhosFloatingWindow *>(surface);
37 auto *ohosWindowSurface = ohosWindow->ownedSurfaceOrNull();
38
39 return ohosWindowSurface != nullptr
40 ? ohosWindowSurface->tryGetOrCreateEGLWindowSurface(eglDisplay(), eglConfig())
41 : EGL_NO_SURFACE;
42}
43
44QT_END_NAMESPACE
Combined button and popup list for selecting options.