| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/eglfs/qeglfsintegration.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | - | |||||||||||||
| 8 | - | |||||||||||||
| 9 | - | |||||||||||||
| 10 | - | |||||||||||||
| 11 | - | |||||||||||||
| 12 | - | |||||||||||||
| 13 | - | |||||||||||||
| 14 | - | |||||||||||||
| 15 | - | |||||||||||||
| 16 | - | |||||||||||||
| 17 | - | |||||||||||||
| 18 | - | |||||||||||||
| 19 | static void initResources() | - | ||||||||||||
| 20 | { | - | ||||||||||||
| 21 | - | |||||||||||||
| 22 | do { extern int qInitResources_cursor (); qInitResources_cursor (); } while (0); | - | ||||||||||||
| 23 | - | |||||||||||||
| 24 | } never executed: end of block | 0 | ||||||||||||
| 25 | - | |||||||||||||
| 26 | - | |||||||||||||
| 27 | - | |||||||||||||
| 28 | QEglFSIntegration::QEglFSIntegration() | - | ||||||||||||
| 29 | : m_display(((EGLDisplay)0)), | - | ||||||||||||
| 30 | m_inputContext(0), | - | ||||||||||||
| 31 | m_fontDb(new QGenericUnixFontDatabase), | - | ||||||||||||
| 32 | m_services(new QGenericUnixServices), | - | ||||||||||||
| 33 | m_kbdMgr(0), | - | ||||||||||||
| 34 | m_disableInputHandlers(false) | - | ||||||||||||
| 35 | { | - | ||||||||||||
| 36 | m_disableInputHandlers = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DISABLE_INPUT"); | - | ||||||||||||
| 37 | - | |||||||||||||
| 38 | initResources(); | - | ||||||||||||
| 39 | } never executed: end of block | 0 | ||||||||||||
| 40 | - | |||||||||||||
| 41 | void QEglFSIntegration::addScreen(QPlatformScreen *screen) | - | ||||||||||||
| 42 | { | - | ||||||||||||
| 43 | screenAdded(screen); | - | ||||||||||||
| 44 | } never executed: end of block | 0 | ||||||||||||
| 45 | - | |||||||||||||
| 46 | void QEglFSIntegration::removeScreen(QPlatformScreen *screen) | - | ||||||||||||
| 47 | { | - | ||||||||||||
| 48 | destroyScreen(screen); | - | ||||||||||||
| 49 | } never executed: end of block | 0 | ||||||||||||
| 50 | - | |||||||||||||
| 51 | void QEglFSIntegration::initialize() | - | ||||||||||||
| 52 | { | - | ||||||||||||
| 53 | qt_egl_device_integration()->platformInit(); | - | ||||||||||||
| 54 | - | |||||||||||||
| 55 | m_display = qt_egl_device_integration()->createDisplay(nativeDisplay()); | - | ||||||||||||
| 56 | if (__builtin_expect(!!(m_display == ((EGLDisplay)0)), false)
| 0 | ||||||||||||
| 57 | QMessageLogger(__FILE__, 127, __PRETTY_FUNCTION__).fatal("Could not open egl display"); never executed: QMessageLogger(__FILE__, 127, __PRETTY_FUNCTION__).fatal("Could not open egl display"); | 0 | ||||||||||||
| 58 | - | |||||||||||||
| 59 | EGLint major, minor; | - | ||||||||||||
| 60 | if (__builtin_expect(!!(!eglInitialize(m_display, &major, &minor)), false)
| 0 | ||||||||||||
| 61 | QMessageLogger(__FILE__, 131, __PRETTY_FUNCTION__).fatal("Could not initialize egl display"); never executed: QMessageLogger(__FILE__, 131, __PRETTY_FUNCTION__).fatal("Could not initialize egl display"); | 0 | ||||||||||||
| 62 | - | |||||||||||||
| 63 | m_inputContext = QPlatformInputContextFactory::create(); | - | ||||||||||||
| 64 | - | |||||||||||||
| 65 | m_vtHandler.reset(new QFbVtHandler); | - | ||||||||||||
| 66 | - | |||||||||||||
| 67 | if (qt_egl_device_integration()->usesDefaultScreen()
| 0 | ||||||||||||
| 68 | addScreen(new QEglFSScreen(display())); never executed: addScreen(new QEglFSScreen(display())); | 0 | ||||||||||||
| 69 | else | - | ||||||||||||
| 70 | qt_egl_device_integration()->screenInit(); never executed: qt_egl_device_integration()->screenInit(); | 0 | ||||||||||||
| 71 | - | |||||||||||||
| 72 | - | |||||||||||||
| 73 | if (!m_disableInputHandlers
| 0 | ||||||||||||
| 74 | createInputHandlers(); never executed: createInputHandlers(); | 0 | ||||||||||||
| 75 | } never executed: end of block | 0 | ||||||||||||
| 76 | - | |||||||||||||
| 77 | void QEglFSIntegration::destroy() | - | ||||||||||||
| 78 | { | - | ||||||||||||
| 79 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype((static_cast<QGuiApplication *>(QCoreApplication::instance()))->topLevelWindows())>::type> _container_(((static_cast<QGuiApplication *>(QCoreApplication::instance()))->topLevelWindows())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QWindow *w = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||
| 80 | w->destroy(); never executed: w->destroy(); | 0 | ||||||||||||
| 81 | - | |||||||||||||
| 82 | qt_egl_device_integration()->screenDestroy(); | - | ||||||||||||
| 83 | - | |||||||||||||
| 84 | if (m_display != ((EGLDisplay)0)
| 0 | ||||||||||||
| 85 | eglTerminate(m_display); never executed: eglTerminate(m_display); | 0 | ||||||||||||
| 86 | - | |||||||||||||
| 87 | qt_egl_device_integration()->platformDestroy(); | - | ||||||||||||
| 88 | } never executed: end of block | 0 | ||||||||||||
| 89 | - | |||||||||||||
| 90 | QAbstractEventDispatcher *QEglFSIntegration::createEventDispatcher() const | - | ||||||||||||
| 91 | { | - | ||||||||||||
| 92 | return never executed: createUnixEventDispatcher();return createUnixEventDispatcher();never executed: return createUnixEventDispatcher(); | 0 | ||||||||||||
| 93 | } | - | ||||||||||||
| 94 | - | |||||||||||||
| 95 | QPlatformServices *QEglFSIntegration::services() const | - | ||||||||||||
| 96 | { | - | ||||||||||||
| 97 | return never executed: m_services.data();return m_services.data();never executed: return m_services.data(); | 0 | ||||||||||||
| 98 | } | - | ||||||||||||
| 99 | - | |||||||||||||
| 100 | QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const | - | ||||||||||||
| 101 | { | - | ||||||||||||
| 102 | return never executed: m_fontDb.data();return m_fontDb.data();never executed: return m_fontDb.data(); | 0 | ||||||||||||
| 103 | } | - | ||||||||||||
| 104 | - | |||||||||||||
| 105 | QPlatformTheme *QEglFSIntegration::createPlatformTheme(const QString &name) const | - | ||||||||||||
| 106 | { | - | ||||||||||||
| 107 | return never executed: QGenericUnixTheme::createUnixTheme(name);return QGenericUnixTheme::createUnixTheme(name);never executed: return QGenericUnixTheme::createUnixTheme(name); | 0 | ||||||||||||
| 108 | } | - | ||||||||||||
| 109 | - | |||||||||||||
| 110 | QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *window) const | - | ||||||||||||
| 111 | { | - | ||||||||||||
| 112 | QOpenGLCompositorBackingStore *bs = new QOpenGLCompositorBackingStore(window); | - | ||||||||||||
| 113 | if (!window->handle()
| 0 | ||||||||||||
| 114 | window->create(); never executed: window->create(); | 0 | ||||||||||||
| 115 | static_cast<QEglFSWindow *>(window->handle())->setBackingStore(bs); | - | ||||||||||||
| 116 | return never executed: bs;return bs;never executed: return bs; | 0 | ||||||||||||
| 117 | } | - | ||||||||||||
| 118 | - | |||||||||||||
| 119 | QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const | - | ||||||||||||
| 120 | { | - | ||||||||||||
| 121 | QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); | - | ||||||||||||
| 122 | QEglFSWindow *w = qt_egl_device_integration()->createWindow(window); | - | ||||||||||||
| 123 | w->create(); | - | ||||||||||||
| 124 | if (window->type() != Qt::ToolTip
| 0 | ||||||||||||
| 125 | w->requestActivateWindow(); never executed: w->requestActivateWindow(); | 0 | ||||||||||||
| 126 | return never executed: w;return w;never executed: return w; | 0 | ||||||||||||
| 127 | } | - | ||||||||||||
| 128 | - | |||||||||||||
| 129 | QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const | - | ||||||||||||
| 130 | { | - | ||||||||||||
| 131 | EGLDisplay dpy = context->screen()
| 0 | ||||||||||||
| 132 | QPlatformOpenGLContext *share = context->shareHandle(); | - | ||||||||||||
| 133 | QVariant nativeHandle = context->nativeHandle(); | - | ||||||||||||
| 134 | - | |||||||||||||
| 135 | QEglFSContext *ctx; | - | ||||||||||||
| 136 | QSurfaceFormat adjustedFormat = qt_egl_device_integration()->surfaceFormatFor(context->format()); | - | ||||||||||||
| 137 | if (nativeHandle.isNull()
| 0 | ||||||||||||
| 138 | EGLConfig config = QEglFSIntegration::chooseConfig(dpy, adjustedFormat); | - | ||||||||||||
| 139 | ctx = new QEglFSContext(adjustedFormat, share, dpy, &config, QVariant()); | - | ||||||||||||
| 140 | } never executed: else {end of block | 0 | ||||||||||||
| 141 | ctx = new QEglFSContext(adjustedFormat, share, dpy, 0, nativeHandle); | - | ||||||||||||
| 142 | } never executed: end of block | 0 | ||||||||||||
| 143 | nativeHandle = QVariant::fromValue<QEGLNativeContext>(QEGLNativeContext(ctx->eglContext(), dpy)); | - | ||||||||||||
| 144 | - | |||||||||||||
| 145 | context->setNativeHandle(nativeHandle); | - | ||||||||||||
| 146 | return never executed: ctx;return ctx;never executed: return ctx; | 0 | ||||||||||||
| 147 | } | - | ||||||||||||
| 148 | - | |||||||||||||
| 149 | QPlatformOffscreenSurface *QEglFSIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const | - | ||||||||||||
| 150 | { | - | ||||||||||||
| 151 | EGLDisplay dpy = surface->screen()
| 0 | ||||||||||||
| 152 | QSurfaceFormat fmt = qt_egl_device_integration()->surfaceFormatFor(surface->requestedFormat()); | - | ||||||||||||
| 153 | if (qt_egl_device_integration()->supportsPBuffers()
| 0 | ||||||||||||
| 154 | QEGLPlatformContext::Flags flags = 0; | - | ||||||||||||
| 155 | if (!qt_egl_device_integration()->supportsSurfacelessContexts()
| 0 | ||||||||||||
| 156 | flags |= QEGLPlatformContext::NoSurfaceless; never executed: flags |= QEGLPlatformContext::NoSurfaceless; | 0 | ||||||||||||
| 157 | return never executed: new QEGLPbuffer(dpy, fmt, surface, flags);return new QEGLPbuffer(dpy, fmt, surface, flags);never executed: return new QEGLPbuffer(dpy, fmt, surface, flags); | 0 | ||||||||||||
| 158 | } else { | - | ||||||||||||
| 159 | return never executed: new QEglFSOffscreenWindow(dpy, fmt, surface);return new QEglFSOffscreenWindow(dpy, fmt, surface);never executed: return new QEglFSOffscreenWindow(dpy, fmt, surface); | 0 | ||||||||||||
| 160 | } | - | ||||||||||||
| 161 | - | |||||||||||||
| 162 | } | - | ||||||||||||
| 163 | - | |||||||||||||
| 164 | bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) const | - | ||||||||||||
| 165 | { | - | ||||||||||||
| 166 | - | |||||||||||||
| 167 | if (qt_egl_device_integration()->hasCapability(cap)
| 0 | ||||||||||||
| 168 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 169 | - | |||||||||||||
| 170 | switch (cap) { | - | ||||||||||||
| 171 | case never executed: ThreadedPixmaps:case ThreadedPixmaps:never executed: returncase ThreadedPixmaps:never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 172 | case never executed: OpenGL:case OpenGL:never executed: returncase OpenGL:never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 173 | case never executed: ThreadedOpenGL:case ThreadedOpenGL:never executed: returncase ThreadedOpenGL:never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 174 | case never executed: WindowManagement:case WindowManagement:never executed: returncase WindowManagement:never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 175 | case never executed: RasterGLSurface:case RasterGLSurface:never executed: returncase RasterGLSurface:never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 176 | default never executed: :default:never executed: returndefault:never executed: QPlatformIntegration::hasCapability(cap);return QPlatformIntegration::hasCapability(cap);never executed: return QPlatformIntegration::hasCapability(cap); | 0 | ||||||||||||
| 177 | } | - | ||||||||||||
| 178 | } | - | ||||||||||||
| 179 | - | |||||||||||||
| 180 | QPlatformNativeInterface *QEglFSIntegration::nativeInterface() const | - | ||||||||||||
| 181 | { | - | ||||||||||||
| 182 | return never executed: const_cast<QEglFSIntegration *>(this);return const_cast<QEglFSIntegration *>(this);never executed: return const_cast<QEglFSIntegration *>(this); | 0 | ||||||||||||
| 183 | } | - | ||||||||||||
| 184 | - | |||||||||||||
| 185 | enum ResourceType { | - | ||||||||||||
| 186 | EglDisplay, | - | ||||||||||||
| 187 | EglWindow, | - | ||||||||||||
| 188 | EglContext, | - | ||||||||||||
| 189 | EglConfig, | - | ||||||||||||
| 190 | NativeDisplay, | - | ||||||||||||
| 191 | XlibDisplay, | - | ||||||||||||
| 192 | WaylandDisplay | - | ||||||||||||
| 193 | }; | - | ||||||||||||
| 194 | - | |||||||||||||
| 195 | static int resourceType(const QByteArray &key) | - | ||||||||||||
| 196 | { | - | ||||||||||||
| 197 | static const QByteArray names[] = { | - | ||||||||||||
| 198 | ([]() -> QByteArray { enum { Size = sizeof("egldisplay") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "egldisplay" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 199 | ([]() -> QByteArray { enum { Size = sizeof("eglwindow") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "eglwindow" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 200 | ([]() -> QByteArray { enum { Size = sizeof("eglcontext") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "eglcontext" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 201 | ([]() -> QByteArray { enum { Size = sizeof("eglconfig") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "eglconfig" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 202 | ([]() -> QByteArray { enum { Size = sizeof("nativedisplay") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "nativedisplay" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 203 | ([]() -> QByteArray { enum { Size = sizeof("display") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "display" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 204 | ([]() -> QByteArray { enum { Size = sizeof("server_wl_display") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "server_wl_display" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()) | - | ||||||||||||
| 205 | }; | - | ||||||||||||
| 206 | const QByteArray *end = names + sizeof(names) / sizeof(names[0]); | - | ||||||||||||
| 207 | const QByteArray *result = std::find(names, end, key); | - | ||||||||||||
| 208 | if (result == end
| 0 | ||||||||||||
| 209 | result = std::find(names, end, key.toLower()); never executed: result = std::find(names, end, key.toLower()); | 0 | ||||||||||||
| 210 | return never executed: int(result - names);return int(result - names);never executed: return int(result - names); | 0 | ||||||||||||
| 211 | } | - | ||||||||||||
| 212 | - | |||||||||||||
| 213 | void *QEglFSIntegration::nativeResourceForIntegration(const QByteArray &resource) | - | ||||||||||||
| 214 | { | - | ||||||||||||
| 215 | void *result = 0; | - | ||||||||||||
| 216 | - | |||||||||||||
| 217 | switch (resourceType(resource)) { | - | ||||||||||||
| 218 | case never executed: EglDisplay:case EglDisplay:never executed: case EglDisplay: | 0 | ||||||||||||
| 219 | result = display(); | - | ||||||||||||
| 220 | break; never executed: break; | 0 | ||||||||||||
| 221 | case never executed: NativeDisplay:case NativeDisplay:never executed: case NativeDisplay: | 0 | ||||||||||||
| 222 | result = reinterpret_cast<void*>(nativeDisplay()); | - | ||||||||||||
| 223 | break; never executed: break; | 0 | ||||||||||||
| 224 | case never executed: WaylandDisplay:case WaylandDisplay:never executed: case WaylandDisplay: | 0 | ||||||||||||
| 225 | result = qt_egl_device_integration()->wlDisplay(); | - | ||||||||||||
| 226 | break; never executed: break; | 0 | ||||||||||||
| 227 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 228 | break; never executed: break; | 0 | ||||||||||||
| 229 | } | - | ||||||||||||
| 230 | - | |||||||||||||
| 231 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||
| 232 | } | - | ||||||||||||
| 233 | - | |||||||||||||
| 234 | void *QEglFSIntegration::nativeResourceForScreen(const QByteArray &resource, QScreen *) | - | ||||||||||||
| 235 | { | - | ||||||||||||
| 236 | void *result = 0; | - | ||||||||||||
| 237 | - | |||||||||||||
| 238 | switch (resourceType(resource)) { | - | ||||||||||||
| 239 | case never executed: XlibDisplay:case XlibDisplay:never executed: case XlibDisplay: | 0 | ||||||||||||
| 240 | - | |||||||||||||
| 241 | - | |||||||||||||
| 242 | result = reinterpret_cast<void*>(nativeDisplay()); | - | ||||||||||||
| 243 | break; never executed: break; | 0 | ||||||||||||
| 244 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 245 | break; never executed: break; | 0 | ||||||||||||
| 246 | } | - | ||||||||||||
| 247 | - | |||||||||||||
| 248 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||
| 249 | } | - | ||||||||||||
| 250 | - | |||||||||||||
| 251 | void *QEglFSIntegration::nativeResourceForWindow(const QByteArray &resource, QWindow *window) | - | ||||||||||||
| 252 | { | - | ||||||||||||
| 253 | void *result = 0; | - | ||||||||||||
| 254 | - | |||||||||||||
| 255 | switch (resourceType(resource)) { | - | ||||||||||||
| 256 | case never executed: EglDisplay:case EglDisplay:never executed: case EglDisplay: | 0 | ||||||||||||
| 257 | if (window
| 0 | ||||||||||||
| 258 | result = static_cast<QEglFSScreen *>(window->handle()->screen())->display(); never executed: result = static_cast<QEglFSScreen *>(window->handle()->screen())->display(); | 0 | ||||||||||||
| 259 | else | - | ||||||||||||
| 260 | result = display(); never executed: result = display(); | 0 | ||||||||||||
| 261 | break; never executed: break; | 0 | ||||||||||||
| 262 | case never executed: EglWindow:case EglWindow:never executed: case EglWindow: | 0 | ||||||||||||
| 263 | if (window
| 0 | ||||||||||||
| 264 | result = reinterpret_cast<void*>(static_cast<QEglFSWindow *>(window->handle())->eglWindow()); never executed: result = reinterpret_cast<void*>(static_cast<QEglFSWindow *>(window->handle())->eglWindow()); | 0 | ||||||||||||
| 265 | break; never executed: break; | 0 | ||||||||||||
| 266 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 267 | break; never executed: break; | 0 | ||||||||||||
| 268 | } | - | ||||||||||||
| 269 | - | |||||||||||||
| 270 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||
| 271 | } | - | ||||||||||||
| 272 | - | |||||||||||||
| 273 | void *QEglFSIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) | - | ||||||||||||
| 274 | { | - | ||||||||||||
| 275 | void *result = 0; | - | ||||||||||||
| 276 | - | |||||||||||||
| 277 | switch (resourceType(resource)) { | - | ||||||||||||
| 278 | case never executed: EglContext:case EglContext:never executed: case EglContext: | 0 | ||||||||||||
| 279 | if (context->handle()
| 0 | ||||||||||||
| 280 | result = static_cast<QEglFSContext *>(context->handle())->eglContext(); never executed: result = static_cast<QEglFSContext *>(context->handle())->eglContext(); | 0 | ||||||||||||
| 281 | break; never executed: break; | 0 | ||||||||||||
| 282 | case never executed: EglConfig:case EglConfig:never executed: case EglConfig: | 0 | ||||||||||||
| 283 | if (context->handle()
| 0 | ||||||||||||
| 284 | result = static_cast<QEglFSContext *>(context->handle())->eglConfig(); never executed: result = static_cast<QEglFSContext *>(context->handle())->eglConfig(); | 0 | ||||||||||||
| 285 | break; never executed: break; | 0 | ||||||||||||
| 286 | case never executed: EglDisplay:case EglDisplay:never executed: case EglDisplay: | 0 | ||||||||||||
| 287 | if (context->handle()
| 0 | ||||||||||||
| 288 | result = static_cast<QEglFSContext *>(context->handle())->eglDisplay(); never executed: result = static_cast<QEglFSContext *>(context->handle())->eglDisplay(); | 0 | ||||||||||||
| 289 | break; never executed: break; | 0 | ||||||||||||
| 290 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 291 | break; never executed: break; | 0 | ||||||||||||
| 292 | } | - | ||||||||||||
| 293 | - | |||||||||||||
| 294 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||
| 295 | } | - | ||||||||||||
| 296 | - | |||||||||||||
| 297 | static void *eglContextForContext(QOpenGLContext *context) | - | ||||||||||||
| 298 | { | - | ||||||||||||
| 299 | ((!(context)) ? qt_assert("context",__FILE__,369) : qt_noop()); | - | ||||||||||||
| 300 | - | |||||||||||||
| 301 | QEglFSContext *handle = static_cast<QEglFSContext *>(context->handle()); | - | ||||||||||||
| 302 | if (!handle
| 0 | ||||||||||||
| 303 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 304 | - | |||||||||||||
| 305 | return never executed: handle->eglContext();return handle->eglContext();never executed: return handle->eglContext(); | 0 | ||||||||||||
| 306 | } | - | ||||||||||||
| 307 | - | |||||||||||||
| 308 | QPlatformNativeInterface::NativeResourceForContextFunction QEglFSIntegration::nativeResourceFunctionForContext(const QByteArray &resource) | - | ||||||||||||
| 309 | { | - | ||||||||||||
| 310 | QByteArray lowerCaseResource = resource.toLower(); | - | ||||||||||||
| 311 | if (lowerCaseResource == "get_egl_context"
| 0 | ||||||||||||
| 312 | return never executed: NativeResourceForContextFunction(eglContextForContext);return NativeResourceForContextFunction(eglContextForContext);never executed: return NativeResourceForContextFunction(eglContextForContext); | 0 | ||||||||||||
| 313 | - | |||||||||||||
| 314 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 315 | } | - | ||||||||||||
| 316 | - | |||||||||||||
| 317 | QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function) const | - | ||||||||||||
| 318 | { | - | ||||||||||||
| 319 | - | |||||||||||||
| 320 | if (function == QEglFSFunctions::loadKeymapTypeIdentifier()
| 0 | ||||||||||||
| 321 | return never executed: QFunctionPointer(loadKeymapStatic);return QFunctionPointer(loadKeymapStatic);never executed: return QFunctionPointer(loadKeymapStatic); | 0 | ||||||||||||
| 322 | - | |||||||||||||
| 323 | - | |||||||||||||
| 324 | - | |||||||||||||
| 325 | - | |||||||||||||
| 326 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 327 | } | - | ||||||||||||
| 328 | - | |||||||||||||
| 329 | void QEglFSIntegration::loadKeymapStatic(const QString &filename) | - | ||||||||||||
| 330 | { | - | ||||||||||||
| 331 | - | |||||||||||||
| 332 | QEglFSIntegration *self = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration()); | - | ||||||||||||
| 333 | if (self->m_kbdMgr
| 0 | ||||||||||||
| 334 | self->m_kbdMgr->loadKeymap(filename); never executed: self->m_kbdMgr->loadKeymap(filename); | 0 | ||||||||||||
| 335 | else | - | ||||||||||||
| 336 | QMessageLogger(__FILE__, 406, __PRETTY_FUNCTION__).warning("QEglFSIntegration: Cannot load keymap, no keyboard handler found"); never executed: QMessageLogger(__FILE__, 406, __PRETTY_FUNCTION__).warning("QEglFSIntegration: Cannot load keymap, no keyboard handler found"); | 0 | ||||||||||||
| 337 | - | |||||||||||||
| 338 | - | |||||||||||||
| 339 | - | |||||||||||||
| 340 | } | - | ||||||||||||
| 341 | - | |||||||||||||
| 342 | void QEglFSIntegration::createInputHandlers() | - | ||||||||||||
| 343 | { | - | ||||||||||||
| 344 | - | |||||||||||||
| 345 | - | |||||||||||||
| 346 | - | |||||||||||||
| 347 | - | |||||||||||||
| 348 | - | |||||||||||||
| 349 | - | |||||||||||||
| 350 | - | |||||||||||||
| 351 | bool useTslib = false; | - | ||||||||||||
| 352 | - | |||||||||||||
| 353 | - | |||||||||||||
| 354 | - | |||||||||||||
| 355 | - | |||||||||||||
| 356 | - | |||||||||||||
| 357 | - | |||||||||||||
| 358 | - | |||||||||||||
| 359 | m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() , this); | - | ||||||||||||
| 360 | new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() , this); | - | ||||||||||||
| 361 | if (!useTslib
| 0 | ||||||||||||
| 362 | new never executed: QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() , this);new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() , this);never executed: new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() , this); | 0 | ||||||||||||
| 363 | - | |||||||||||||
| 364 | } never executed: end of block | 0 | ||||||||||||
| 365 | - | |||||||||||||
| 366 | EGLNativeDisplayType QEglFSIntegration::nativeDisplay() const | - | ||||||||||||
| 367 | { | - | ||||||||||||
| 368 | return never executed: qt_egl_device_integration()->platformDisplay();return qt_egl_device_integration()->platformDisplay();never executed: return qt_egl_device_integration()->platformDisplay(); | 0 | ||||||||||||
| 369 | } | - | ||||||||||||
| 370 | - | |||||||||||||
| 371 | EGLConfig QEglFSIntegration::chooseConfig(EGLDisplay display, const QSurfaceFormat &format) | - | ||||||||||||
| 372 | { | - | ||||||||||||
| 373 | class Chooser : public QEglConfigChooser { | - | ||||||||||||
| 374 | public: | - | ||||||||||||
| 375 | Chooser(EGLDisplay display) | - | ||||||||||||
| 376 | : QEglConfigChooser(display) { } never executed: end of block | 0 | ||||||||||||
| 377 | bool filterConfig(EGLConfig config) const override { | - | ||||||||||||
| 378 | return never executed: qt_egl_device_integration()->filterConfig(display(), config)return qt_egl_device_integration()->filterConfig(display(), config) && QEglConfigChooser::filterConfig(config);never executed: return qt_egl_device_integration()->filterConfig(display(), config) && QEglConfigChooser::filterConfig(config); | 0 | ||||||||||||
| 379 | && QEglConfigChooser::filterConfig(config); never executed: return qt_egl_device_integration()->filterConfig(display(), config) && QEglConfigChooser::filterConfig(config); | 0 | ||||||||||||
| 380 | } | - | ||||||||||||
| 381 | }; | - | ||||||||||||
| 382 | - | |||||||||||||
| 383 | Chooser chooser(display); | - | ||||||||||||
| 384 | chooser.setSurfaceType(qt_egl_device_integration()->surfaceType()); | - | ||||||||||||
| 385 | chooser.setSurfaceFormat(format); | - | ||||||||||||
| 386 | return never executed: chooser.chooseConfig();return chooser.chooseConfig();never executed: return chooser.chooseConfig(); | 0 | ||||||||||||
| 387 | } | - | ||||||||||||
| 388 | - | |||||||||||||
| 389 | - | |||||||||||||
| Switch to Source code | Preprocessed file |