Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
4
#
include
"qohoseglplatformcontext.h"
5
#
include
"qohosfloatingwindow.h"
6
#
include
"qohosplatformwindow.h"
7
#
include
"render/qohosegl.h"
8
9
#
include
<
QtGui
/
private
/
qeglpbuffer_p
.
h
>
10
#
include
<
QtGui
/
qsurface
.
h
>
11
12
QT_BEGIN_NAMESPACE
13
14
QOhosEGLPlatformContext::QOhosEGLPlatformContext(
const
QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display)
15
: QEGLPlatformContext(format, share, display,
nullptr
)
16
, m_isDuringSwappingBuffers(
false
)
17
{
18
}
19
20
void
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
34
EGLSurface 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
48
QT_END_NAMESPACE
QOhosFloatingWindow
Definition
qohosfloatingwindow.h:19
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
plugins
platforms
ohos
qohoseglplatformcontext.cpp
Generated on
for Qt by
1.18.0