| 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 (m_display == ((EGLDisplay)0)
| 0 | ||||||||||||
| 57 | QMessageLogger(__FILE__, 120, __PRETTY_FUNCTION__).fatal("Could not open egl display"); never executed: QMessageLogger(__FILE__, 120, __PRETTY_FUNCTION__).fatal("Could not open egl display"); | 0 | ||||||||||||
| 58 | - | |||||||||||||
| 59 | EGLint major, minor; | - | ||||||||||||
| 60 | if (!eglInitialize(m_display, &major, &minor)
| 0 | ||||||||||||
| 61 | QMessageLogger(__FILE__, 124, __PRETTY_FUNCTION__).fatal("Could not initialize egl display"); never executed: QMessageLogger(__FILE__, 124, __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 | QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *window) const | - | ||||||||||||
| 106 | { | - | ||||||||||||
| 107 | QOpenGLCompositorBackingStore *bs = new QOpenGLCompositorBackingStore(window); | - | ||||||||||||
| 108 | if (!window->handle()
| 0 | ||||||||||||
| 109 | window->create(); never executed: window->create(); | 0 | ||||||||||||
| 110 | static_cast<QEglFSWindow *>(window->handle())->setBackingStore(bs); | - | ||||||||||||
| 111 | return never executed: bs;return bs;never executed: return bs; | 0 | ||||||||||||
| 112 | } | - | ||||||||||||
| 113 | - | |||||||||||||
| 114 | QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const | - | ||||||||||||
| 115 | { | - | ||||||||||||
| 116 | QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); | - | ||||||||||||
| 117 | QEglFSWindow *w = qt_egl_device_integration()->createWindow(window); | - | ||||||||||||
| 118 | w->create(); | - | ||||||||||||
| 119 | if (window->type() != Qt::ToolTip
| 0 | ||||||||||||
| 120 | w->requestActivateWindow(); never executed: w->requestActivateWindow(); | 0 | ||||||||||||
| 121 | return never executed: w;return w;never executed: return w; | 0 | ||||||||||||
| 122 | } | - | ||||||||||||
| 123 | - | |||||||||||||
| 124 | QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const | - | ||||||||||||
| 125 | { | - | ||||||||||||
| 126 | EGLDisplay dpy = context->screen()
| 0 | ||||||||||||
| 127 | QPlatformOpenGLContext *share = context->shareHandle(); | - | ||||||||||||
| 128 | QVariant nativeHandle = context->nativeHandle(); | - | ||||||||||||
| 129 | - | |||||||||||||
| 130 | QEglFSContext *ctx; | - | ||||||||||||
| 131 | QSurfaceFormat adjustedFormat = qt_egl_device_integration()->surfaceFormatFor(context->format()); | - | ||||||||||||
| 132 | if (nativeHandle.isNull()
| 0 | ||||||||||||
| 133 | EGLConfig config = QEglFSIntegration::chooseConfig(dpy, adjustedFormat); | - | ||||||||||||
| 134 | ctx = new QEglFSContext(adjustedFormat, share, dpy, &config, QVariant()); | - | ||||||||||||
| 135 | } never executed: else {end of block | 0 | ||||||||||||
| 136 | ctx = new QEglFSContext(adjustedFormat, share, dpy, 0, nativeHandle); | - | ||||||||||||
| 137 | } never executed: end of block | 0 | ||||||||||||
| 138 | nativeHandle = QVariant::fromValue<QEGLNativeContext>(QEGLNativeContext(ctx->eglContext(), dpy)); | - | ||||||||||||
| 139 | - | |||||||||||||
| 140 | context->setNativeHandle(nativeHandle); | - | ||||||||||||
| 141 | return never executed: ctx;return ctx;never executed: return ctx; | 0 | ||||||||||||
| 142 | } | - | ||||||||||||
| 143 | - | |||||||||||||
| 144 | QPlatformOffscreenSurface *QEglFSIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const | - | ||||||||||||
| 145 | { | - | ||||||||||||
| 146 | EGLDisplay dpy = surface->screen()
| 0 | ||||||||||||
| 147 | QSurfaceFormat fmt = qt_egl_device_integration()->surfaceFormatFor(surface->requestedFormat()); | - | ||||||||||||
| 148 | if (qt_egl_device_integration()->supportsPBuffers()
| 0 | ||||||||||||
| 149 | QEGLPlatformContext::Flags flags = 0; | - | ||||||||||||
| 150 | if (!qt_egl_device_integration()->supportsSurfacelessContexts()
| 0 | ||||||||||||
| 151 | flags |= QEGLPlatformContext::NoSurfaceless; never executed: flags |= QEGLPlatformContext::NoSurfaceless; | 0 | ||||||||||||
| 152 | 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 | ||||||||||||
| 153 | } else { | - | ||||||||||||
| 154 | return never executed: new QEglFSOffscreenWindow(dpy, fmt, surface);return new QEglFSOffscreenWindow(dpy, fmt, surface);never executed: return new QEglFSOffscreenWindow(dpy, fmt, surface); | 0 | ||||||||||||
| 155 | } | - | ||||||||||||
| 156 | - | |||||||||||||
| 157 | } | - | ||||||||||||
| 158 | - | |||||||||||||
| 159 | bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) const | - | ||||||||||||
| 160 | { | - | ||||||||||||
| 161 | - | |||||||||||||
| 162 | if (qt_egl_device_integration()->hasCapability(cap)
| 0 | ||||||||||||
| 163 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 164 | - | |||||||||||||
| 165 | switch (cap) { | - | ||||||||||||
| 166 | case never executed: ThreadedPixmaps:case ThreadedPixmaps:never executed: returncase ThreadedPixmaps:never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 167 | case never executed: OpenGL:case OpenGL:never executed: returncase OpenGL:never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 168 | case never executed: ThreadedOpenGL:case ThreadedOpenGL:never executed: returncase ThreadedOpenGL:never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 169 | case never executed: WindowManagement:case WindowManagement:never executed: returncase WindowManagement:never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 170 | case never executed: RasterGLSurface:case RasterGLSurface:never executed: returncase RasterGLSurface:never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 171 | default never executed: :default:never executed: returndefault:never executed: QPlatformIntegration::hasCapability(cap);return QPlatformIntegration::hasCapability(cap);never executed: return QPlatformIntegration::hasCapability(cap); | 0 | ||||||||||||
| 172 | } | - | ||||||||||||
| 173 | } | - | ||||||||||||
| 174 | - | |||||||||||||
| 175 | QPlatformNativeInterface *QEglFSIntegration::nativeInterface() const | - | ||||||||||||
| 176 | { | - | ||||||||||||
| 177 | return never executed: const_cast<QEglFSIntegration *>(this);return const_cast<QEglFSIntegration *>(this);never executed: return const_cast<QEglFSIntegration *>(this); | 0 | ||||||||||||
| 178 | } | - | ||||||||||||
| 179 | - | |||||||||||||
| 180 | enum ResourceType { | - | ||||||||||||
| 181 | EglDisplay, | - | ||||||||||||
| 182 | EglWindow, | - | ||||||||||||
| 183 | EglContext, | - | ||||||||||||
| 184 | EglConfig, | - | ||||||||||||
| 185 | NativeDisplay, | - | ||||||||||||
| 186 | XlibDisplay, | - | ||||||||||||
| 187 | WaylandDisplay | - | ||||||||||||
| 188 | }; | - | ||||||||||||
| 189 | - | |||||||||||||
| 190 | static int resourceType(const QByteArray &key) | - | ||||||||||||
| 191 | { | - | ||||||||||||
| 192 | static const QByteArray names[] = { | - | ||||||||||||
| 193 | ([]() -> 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; }()), | - | ||||||||||||
| 194 | ([]() -> 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; }()), | - | ||||||||||||
| 195 | ([]() -> 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; }()), | - | ||||||||||||
| 196 | ([]() -> 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; }()), | - | ||||||||||||
| 197 | ([]() -> 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; }()), | - | ||||||||||||
| 198 | ([]() -> 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; }()), | - | ||||||||||||
| 199 | ([]() -> 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; }()) | - | ||||||||||||
| 200 | }; | - | ||||||||||||
| 201 | const QByteArray *end = names + sizeof(names) / sizeof(names[0]); | - | ||||||||||||
| 202 | const QByteArray *result = std::find(names, end, key); | - | ||||||||||||
| 203 | if (result == end
| 0 | ||||||||||||
| 204 | result = std::find(names, end, key.toLower()); never executed: result = std::find(names, end, key.toLower()); | 0 | ||||||||||||
| 205 | return never executed: int(result - names);return int(result - names);never executed: return int(result - names); | 0 | ||||||||||||
| 206 | } | - | ||||||||||||
| 207 | - | |||||||||||||
| 208 | void *QEglFSIntegration::nativeResourceForIntegration(const QByteArray &resource) | - | ||||||||||||
| 209 | { | - | ||||||||||||
| 210 | void *result = 0; | - | ||||||||||||
| 211 | - | |||||||||||||
| 212 | switch (resourceType(resource)) { | - | ||||||||||||
| 213 | case never executed: EglDisplay:case EglDisplay:never executed: case EglDisplay: | 0 | ||||||||||||
| 214 | result = display(); | - | ||||||||||||
| 215 | break; never executed: break; | 0 | ||||||||||||
| 216 | case never executed: NativeDisplay:case NativeDisplay:never executed: case NativeDisplay: | 0 | ||||||||||||
| 217 | result = reinterpret_cast<void*>(nativeDisplay()); | - | ||||||||||||
| 218 | break; never executed: break; | 0 | ||||||||||||
| 219 | case never executed: WaylandDisplay:case WaylandDisplay:never executed: case WaylandDisplay: | 0 | ||||||||||||
| 220 | result = qt_egl_device_integration()->wlDisplay(); | - | ||||||||||||
| 221 | break; never executed: break; | 0 | ||||||||||||
| 222 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 223 | break; never executed: break; | 0 | ||||||||||||
| 224 | } | - | ||||||||||||
| 225 | - | |||||||||||||
| 226 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||
| 227 | } | - | ||||||||||||
| 228 | - | |||||||||||||
| 229 | void *QEglFSIntegration::nativeResourceForScreen(const QByteArray &resource, QScreen *) | - | ||||||||||||
| 230 | { | - | ||||||||||||
| 231 | void *result = 0; | - | ||||||||||||
| 232 | - | |||||||||||||
| 233 | switch (resourceType(resource)) { | - | ||||||||||||
| 234 | case never executed: XlibDisplay:case XlibDisplay:never executed: case XlibDisplay: | 0 | ||||||||||||
| 235 | - | |||||||||||||
| 236 | - | |||||||||||||
| 237 | result = reinterpret_cast<void*>(nativeDisplay()); | - | ||||||||||||
| 238 | break; never executed: break; | 0 | ||||||||||||
| 239 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 240 | break; never executed: break; | 0 | ||||||||||||
| 241 | } | - | ||||||||||||
| 242 | - | |||||||||||||
| 243 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||
| 244 | } | - | ||||||||||||
| 245 | - | |||||||||||||
| 246 | void *QEglFSIntegration::nativeResourceForWindow(const QByteArray &resource, QWindow *window) | - | ||||||||||||
| 247 | { | - | ||||||||||||
| 248 | void *result = 0; | - | ||||||||||||
| 249 | - | |||||||||||||
| 250 | switch (resourceType(resource)) { | - | ||||||||||||
| 251 | case never executed: EglDisplay:case EglDisplay:never executed: case EglDisplay: | 0 | ||||||||||||
| 252 | if (window
| 0 | ||||||||||||
| 253 | result = static_cast<QEglFSScreen *>(window->handle()->screen())->display(); never executed: result = static_cast<QEglFSScreen *>(window->handle()->screen())->display(); | 0 | ||||||||||||
| 254 | else | - | ||||||||||||
| 255 | result = display(); never executed: result = display(); | 0 | ||||||||||||
| 256 | break; never executed: break; | 0 | ||||||||||||
| 257 | case never executed: EglWindow:case EglWindow:never executed: case EglWindow: | 0 | ||||||||||||
| 258 | if (window
| 0 | ||||||||||||
| 259 | result = reinterpret_cast<void*>(static_cast<QEglFSWindow *>(window->handle())->eglWindow()); never executed: result = reinterpret_cast<void*>(static_cast<QEglFSWindow *>(window->handle())->eglWindow()); | 0 | ||||||||||||
| 260 | break; never executed: break; | 0 | ||||||||||||
| 261 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 262 | break; never executed: break; | 0 | ||||||||||||
| 263 | } | - | ||||||||||||
| 264 | - | |||||||||||||
| 265 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||
| 266 | } | - | ||||||||||||
| 267 | - | |||||||||||||
| 268 | void *QEglFSIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) | - | ||||||||||||
| 269 | { | - | ||||||||||||
| 270 | void *result = 0; | - | ||||||||||||
| 271 | - | |||||||||||||
| 272 | switch (resourceType(resource)) { | - | ||||||||||||
| 273 | case never executed: EglContext:case EglContext:never executed: case EglContext: | 0 | ||||||||||||
| 274 | if (context->handle()
| 0 | ||||||||||||
| 275 | result = static_cast<QEglFSContext *>(context->handle())->eglContext(); never executed: result = static_cast<QEglFSContext *>(context->handle())->eglContext(); | 0 | ||||||||||||
| 276 | break; never executed: break; | 0 | ||||||||||||
| 277 | case never executed: EglConfig:case EglConfig:never executed: case EglConfig: | 0 | ||||||||||||
| 278 | if (context->handle()
| 0 | ||||||||||||
| 279 | result = static_cast<QEglFSContext *>(context->handle())->eglConfig(); never executed: result = static_cast<QEglFSContext *>(context->handle())->eglConfig(); | 0 | ||||||||||||
| 280 | break; never executed: break; | 0 | ||||||||||||
| 281 | case never executed: EglDisplay:case EglDisplay:never executed: case EglDisplay: | 0 | ||||||||||||
| 282 | if (context->handle()
| 0 | ||||||||||||
| 283 | result = static_cast<QEglFSContext *>(context->handle())->eglDisplay(); never executed: result = static_cast<QEglFSContext *>(context->handle())->eglDisplay(); | 0 | ||||||||||||
| 284 | break; never executed: break; | 0 | ||||||||||||
| 285 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 286 | break; never executed: break; | 0 | ||||||||||||
| 287 | } | - | ||||||||||||
| 288 | - | |||||||||||||
| 289 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||
| 290 | } | - | ||||||||||||
| 291 | - | |||||||||||||
| 292 | static void *eglContextForContext(QOpenGLContext *context) | - | ||||||||||||
| 293 | { | - | ||||||||||||
| 294 | ((!(context)) ? qt_assert("context",__FILE__,357) : qt_noop()); | - | ||||||||||||
| 295 | - | |||||||||||||
| 296 | QEglFSContext *handle = static_cast<QEglFSContext *>(context->handle()); | - | ||||||||||||
| 297 | if (!handle
| 0 | ||||||||||||
| 298 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 299 | - | |||||||||||||
| 300 | return never executed: handle->eglContext();return handle->eglContext();never executed: return handle->eglContext(); | 0 | ||||||||||||
| 301 | } | - | ||||||||||||
| 302 | - | |||||||||||||
| 303 | QPlatformNativeInterface::NativeResourceForContextFunction QEglFSIntegration::nativeResourceFunctionForContext(const QByteArray &resource) | - | ||||||||||||
| 304 | { | - | ||||||||||||
| 305 | QByteArray lowerCaseResource = resource.toLower(); | - | ||||||||||||
| 306 | if (lowerCaseResource == "get_egl_context"
| 0 | ||||||||||||
| 307 | return never executed: NativeResourceForContextFunction(eglContextForContext);return NativeResourceForContextFunction(eglContextForContext);never executed: return NativeResourceForContextFunction(eglContextForContext); | 0 | ||||||||||||
| 308 | - | |||||||||||||
| 309 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 310 | } | - | ||||||||||||
| 311 | - | |||||||||||||
| 312 | QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function) const | - | ||||||||||||
| 313 | { | - | ||||||||||||
| 314 | - | |||||||||||||
| 315 | if (function == QEglFSFunctions::loadKeymapTypeIdentifier()
| 0 | ||||||||||||
| 316 | return never executed: QFunctionPointer(loadKeymapStatic);return QFunctionPointer(loadKeymapStatic);never executed: return QFunctionPointer(loadKeymapStatic); | 0 | ||||||||||||
| 317 | - | |||||||||||||
| 318 | - | |||||||||||||
| 319 | - | |||||||||||||
| 320 | - | |||||||||||||
| 321 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 322 | } | - | ||||||||||||
| 323 | - | |||||||||||||
| 324 | void QEglFSIntegration::loadKeymapStatic(const QString &filename) | - | ||||||||||||
| 325 | { | - | ||||||||||||
| 326 | - | |||||||||||||
| 327 | QEglFSIntegration *self = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration()); | - | ||||||||||||
| 328 | if (self->m_kbdMgr
| 0 | ||||||||||||
| 329 | self->m_kbdMgr->loadKeymap(filename); never executed: self->m_kbdMgr->loadKeymap(filename); | 0 | ||||||||||||
| 330 | else | - | ||||||||||||
| 331 | QMessageLogger(__FILE__, 394, __PRETTY_FUNCTION__).warning("QEglFSIntegration: Cannot load keymap, no keyboard handler found"); never executed: QMessageLogger(__FILE__, 394, __PRETTY_FUNCTION__).warning("QEglFSIntegration: Cannot load keymap, no keyboard handler found"); | 0 | ||||||||||||
| 332 | - | |||||||||||||
| 333 | - | |||||||||||||
| 334 | - | |||||||||||||
| 335 | } | - | ||||||||||||
| 336 | - | |||||||||||||
| 337 | void QEglFSIntegration::createInputHandlers() | - | ||||||||||||
| 338 | { | - | ||||||||||||
| 339 | - | |||||||||||||
| 340 | - | |||||||||||||
| 341 | - | |||||||||||||
| 342 | - | |||||||||||||
| 343 | - | |||||||||||||
| 344 | - | |||||||||||||
| 345 | - | |||||||||||||
| 346 | bool useTslib = false; | - | ||||||||||||
| 347 | - | |||||||||||||
| 348 | - | |||||||||||||
| 349 | - | |||||||||||||
| 350 | - | |||||||||||||
| 351 | - | |||||||||||||
| 352 | - | |||||||||||||
| 353 | - | |||||||||||||
| 354 | m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() , this); | - | ||||||||||||
| 355 | new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() , this); | - | ||||||||||||
| 356 | if (!useTslib
| 0 | ||||||||||||
| 357 | new never executed: QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() , this);new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() , this);never executed: new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() , this); | 0 | ||||||||||||
| 358 | - | |||||||||||||
| 359 | } never executed: end of block | 0 | ||||||||||||
| 360 | - | |||||||||||||
| 361 | EGLNativeDisplayType QEglFSIntegration::nativeDisplay() const | - | ||||||||||||
| 362 | { | - | ||||||||||||
| 363 | return never executed: qt_egl_device_integration()->platformDisplay();return qt_egl_device_integration()->platformDisplay();never executed: return qt_egl_device_integration()->platformDisplay(); | 0 | ||||||||||||
| 364 | } | - | ||||||||||||
| 365 | - | |||||||||||||
| 366 | EGLConfig QEglFSIntegration::chooseConfig(EGLDisplay display, const QSurfaceFormat &format) | - | ||||||||||||
| 367 | { | - | ||||||||||||
| 368 | class Chooser : public QEglConfigChooser { | - | ||||||||||||
| 369 | public: | - | ||||||||||||
| 370 | Chooser(EGLDisplay display) | - | ||||||||||||
| 371 | : QEglConfigChooser(display) { } never executed: end of block | 0 | ||||||||||||
| 372 | bool filterConfig(EGLConfig config) const override { | - | ||||||||||||
| 373 | 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 | ||||||||||||
| 374 | && QEglConfigChooser::filterConfig(config)
never executed: return qt_egl_device_integration()->filterConfig(display(), config) && QEglConfigChooser::filterConfig(config); | 0 | ||||||||||||
| 375 | } | - | ||||||||||||
| 376 | }; | - | ||||||||||||
| 377 | - | |||||||||||||
| 378 | Chooser chooser(display); | - | ||||||||||||
| 379 | chooser.setSurfaceType(qt_egl_device_integration()->surfaceType()); | - | ||||||||||||
| 380 | chooser.setSurfaceFormat(format); | - | ||||||||||||
| 381 | return never executed: chooser.chooseConfig();return chooser.chooseConfig();never executed: return chooser.chooseConfig(); | 0 | ||||||||||||
| 382 | } | - | ||||||||||||
| 383 | - | |||||||||||||
| 384 | - | |||||||||||||
| Switch to Source code | Preprocessed file |