Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
32
ANativeWindow * nativeSurface() const override
QAndroidPlatformOffscreenSurface(ANativeWindow *nativeSurface, EGLDisplay display, QOffscreenSurface *offscreenSurface)
\inmodule QtGui
void setGreenBufferSize(int size)
Set the desired size in bits of the green channel of the color buffer.
void setRedBufferSize(int size)
Set the desired size in bits of the red channel of the color buffer.
void setBlueBufferSize(int size)
Set the desired size in bits of the blue channel of the color buffer.
void setAlphaBufferSize(int size)
Set the desired size in bits of the alpha channel of the color buffer.
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
EGLConfig q_configFromGLFormat(EGLDisplay display, const QSurfaceFormat &format, bool highestPixelFormat, int surfaceType)
EGLConfig config
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform