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
qeglfsvivintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 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#include <EGL/eglvivante.h>
7#include <QDebug>
8
9#ifdef Q_OS_INTEGRITY
10extern "C" void VivanteInit(void);
11#endif
12
14
15void QEglFSVivIntegration::platformInit()
16{
17 QEglFSDeviceIntegration::platformInit();
18
19 int width, height;
20
21 bool multiBufferNotEnabledYet = qEnvironmentVariableIsEmpty("FB_MULTI_BUFFER");
22 bool multiBuffer = qEnvironmentVariableIsEmpty("QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER");
23 if (multiBufferNotEnabledYet && multiBuffer) {
24 qWarning() << "QEglFSVivIntegration will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.\n"
25 << "If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1";
26 qputenv("FB_MULTI_BUFFER", "2");
27 }
28
29#ifdef Q_OS_INTEGRITY
30 VivanteInit();
31 mNativeDisplay = fbGetDisplay();
32#else
33 mNativeDisplay = static_cast<EGLNativeDisplayType>(fbGetDisplayByIndex(framebufferIndex()));
34#endif
35
36 fbGetDisplayGeometry(mNativeDisplay, &width, &height);
37 mScreenSize.setHeight(height);
38 mScreenSize.setWidth(width);
39}
40
41QSize QEglFSVivIntegration::screenSize() const
42{
43 return mScreenSize;
44}
45
46EGLNativeDisplayType QEglFSVivIntegration::platformDisplay() const
47{
48 return mNativeDisplay;
49}
50
51EGLNativeWindowType QEglFSVivIntegration::createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format)
52{
53 Q_UNUSED(window);
54 Q_UNUSED(format);
55
56 EGLNativeWindowType eglWindow = static_cast<EGLNativeWindowType>(fbCreateWindow(mNativeDisplay, 0, 0, size.width(), size.height()));
57 return eglWindow;
58}
59
60void QEglFSVivIntegration::destroyNativeWindow(EGLNativeWindowType window)
61{
62 fbDestroyWindow(window);
63}
64
65QT_END_NAMESPACE
Combined button and popup list for selecting options.