| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/eglfs/qeglfshooks.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | extern const QLoggingCategory &qLcEglDevDebug(); | - | ||||||||||||
| 5 | class DeviceIntegration | - | ||||||||||||
| 6 | { | - | ||||||||||||
| 7 | public: | - | ||||||||||||
| 8 | DeviceIntegration(); | - | ||||||||||||
| 9 | ~DeviceIntegration() { delete m_integration; } | - | ||||||||||||
| 10 | QEGLDeviceIntegration *integration() { return m_integration; } | - | ||||||||||||
| 11 | private: | - | ||||||||||||
| 12 | QEGLDeviceIntegration *m_integration; | - | ||||||||||||
| 13 | }; | - | ||||||||||||
| 14 | - | |||||||||||||
| 15 | namespace { namespace Q_QGS_deviceIntegration { typedef DeviceIntegration Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized) guard.store(QtGlobalStatic::Destroyed); } }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return &holder.value; } } } static QGlobalStatic<DeviceIntegration, Q_QGS_deviceIntegration::innerFunction, Q_QGS_deviceIntegration::guard> deviceIntegration; | - | ||||||||||||
| 16 | - | |||||||||||||
| 17 | DeviceIntegration::DeviceIntegration() | - | ||||||||||||
| 18 | : m_integration(nullptr) | - | ||||||||||||
| 19 | { | - | ||||||||||||
| 20 | QStringList pluginKeys = QEGLDeviceIntegrationFactory::keys(); | - | ||||||||||||
| 21 | if (!pluginKeys.isEmpty()
| 0 | ||||||||||||
| 22 | - | |||||||||||||
| 23 | if (qEnvironmentVariableIsSet("DISPLAY")
| 0 | ||||||||||||
| 24 | const QString x11key = ([]() -> QString { enum { Size = sizeof(u"" "eglfs_x11")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "eglfs_x11" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||
| 25 | if (pluginKeys.contains(x11key)
| 0 | ||||||||||||
| 26 | pluginKeys.removeOne(x11key); | - | ||||||||||||
| 27 | pluginKeys.prepend(x11key); | - | ||||||||||||
| 28 | } never executed: end of block | 0 | ||||||||||||
| 29 | } never executed: else {end of block | 0 | ||||||||||||
| 30 | const QString kmskey = ([]() -> QString { enum { Size = sizeof(u"" "eglfs_kms")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "eglfs_kms" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||
| 31 | if (pluginKeys.contains(kmskey)
| 0 | ||||||||||||
| 32 | pluginKeys.removeOne(kmskey); | - | ||||||||||||
| 33 | pluginKeys.prepend(kmskey); | - | ||||||||||||
| 34 | } never executed: end of block | 0 | ||||||||||||
| 35 | } never executed: end of block | 0 | ||||||||||||
| 36 | - | |||||||||||||
| 37 | QByteArray requested; | - | ||||||||||||
| 38 | - | |||||||||||||
| 39 | - | |||||||||||||
| 40 | if (qEnvironmentVariableIsSet("QT_QPA_EGLFS_INTEGRATION")
| 0 | ||||||||||||
| 41 | requested = qgetenv("QT_QPA_EGLFS_INTEGRATION"); | - | ||||||||||||
| 42 | } never executed: else {end of block | 0 | ||||||||||||
| 43 | - | |||||||||||||
| 44 | - | |||||||||||||
| 45 | - | |||||||||||||
| 46 | - | |||||||||||||
| 47 | - | |||||||||||||
| 48 | - | |||||||||||||
| 49 | - | |||||||||||||
| 50 | } never executed: end of block | 0 | ||||||||||||
| 51 | - | |||||||||||||
| 52 | - | |||||||||||||
| 53 | - | |||||||||||||
| 54 | - | |||||||||||||
| 55 | if (requested != ([]() -> QByteArray { enum { Size = sizeof("none") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "none" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }())
| 0 | ||||||||||||
| 56 | if (!requested.isEmpty()
| 0 | ||||||||||||
| 57 | QString reqStr = QString::fromLocal8Bit(requested); | - | ||||||||||||
| 58 | pluginKeys.removeOne(reqStr); | - | ||||||||||||
| 59 | pluginKeys.prepend(reqStr); | - | ||||||||||||
| 60 | } never executed: end of block | 0 | ||||||||||||
| 61 | for (bool qt_category_enabled = qLcEglDevDebug().isDebugEnabled(); qt_category_enabled
never executed: QMessageLogger(__FILE__, 113, __PRETTY_FUNCTION__, qLcEglDevDebug().categoryName()).debug() << "EGL device integration plugin keys (sorted):" << pluginKeys; | 0 | ||||||||||||
| 62 | while (!m_integration
| 0 | ||||||||||||
| 63 | QString key = pluginKeys.takeFirst(); | - | ||||||||||||
| 64 | for (bool qt_category_enabled = qLcEglDevDebug().isDebugEnabled(); qt_category_enabled
never executed: QMessageLogger(__FILE__, 116, __PRETTY_FUNCTION__, qLcEglDevDebug().categoryName()).debug() << "Trying to load device EGL integration" << key; | 0 | ||||||||||||
| 65 | m_integration = QEGLDeviceIntegrationFactory::create(key); | - | ||||||||||||
| 66 | } never executed: end of block | 0 | ||||||||||||
| 67 | } never executed: end of block | 0 | ||||||||||||
| 68 | } never executed: end of block | 0 | ||||||||||||
| 69 | - | |||||||||||||
| 70 | if (!m_integration
| 0 | ||||||||||||
| 71 | - | |||||||||||||
| 72 | - | |||||||||||||
| 73 | for (bool qt_category_enabled = qLcEglDevDebug().isDebugEnabled(); qt_category_enabled
never executed: QMessageLogger(__FILE__, 125, __PRETTY_FUNCTION__, qLcEglDevDebug().categoryName()).debug() << "Using base device integration"; | 0 | ||||||||||||
| 74 | m_integration = new QEGLDeviceIntegration; | - | ||||||||||||
| 75 | } never executed: end of block | 0 | ||||||||||||
| 76 | } never executed: end of block | 0 | ||||||||||||
| 77 | - | |||||||||||||
| 78 | QEGLDeviceIntegration *qt_egl_device_integration() | - | ||||||||||||
| 79 | { | - | ||||||||||||
| 80 | return deviceIntegration()->integration(); | - | ||||||||||||
| 81 | } | - | ||||||||||||
| 82 | - | |||||||||||||
| 83 | - | |||||||||||||
| 84 | - | |||||||||||||
| 85 | - | |||||||||||||
| Switch to Source code | Preprocessed file |