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
qandroidplatformoffscreensurface.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 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/private/qeglconvenience_p.h>
8
10
12 ANativeWindow *nativeSurface, EGLDisplay display, QOffscreenSurface *offscreenSurface)
13 : QPlatformOffscreenSurface(offscreenSurface), m_display(display), m_surface(EGL_NO_SURFACE)
14{
15 // FIXME: Read surface format properties from native surface using ANativeWindow_getFormat
16 m_format.setAlphaBufferSize(8);
17 m_format.setRedBufferSize(8);
18 m_format.setGreenBufferSize(8);
19 m_format.setBlueBufferSize(8);
20
21 if (EGLConfig config = q_configFromGLFormat(m_display, m_format, false)) {
22 const EGLint attributes[] = { EGL_NONE };
23 m_surface = eglCreateWindowSurface(m_display, config, nativeSurface, attributes);
24 }
25}
26
28{
29 eglDestroySurface(m_display, m_surface);
30}
31
32QT_END_NAMESPACE
Combined button and popup list for selecting options.