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
5
6#include <QtGui/private/qeglconvenience_p.h>
7
9
11 ANativeWindow *nativeSurface, EGLDisplay display, QOffscreenSurface *offscreenSurface)
12 : QPlatformOffscreenSurface(offscreenSurface), m_display(display), m_surface(EGL_NO_SURFACE)
13{
14 // FIXME: Read surface format properties from native surface using ANativeWindow_getFormat
15 m_format.setAlphaBufferSize(8);
16 m_format.setRedBufferSize(8);
17 m_format.setGreenBufferSize(8);
18 m_format.setBlueBufferSize(8);
19
20 if (EGLConfig config = q_configFromGLFormat(m_display, m_format, false)) {
21 const EGLint attributes[] = { EGL_NONE };
22 m_surface = eglCreateWindowSurface(m_display, config, nativeSurface, attributes);
23 }
24}
25
27{
28 eglDestroySurface(m_display, m_surface);
29}
30
31QT_END_NAMESPACE