From bafa676d080509fcef3e1189ddc8fe06730dcac9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 9 Apr 2019 16:16:06 +0200 Subject: QEglConfigChooser: Silence warning about fallthrough Add Q_FALLTHROUGH, fixing: qeglconvenience.cpp:267:9: warning: this statement may fall through [-Wimplicit-fallthrough=] Change-Id: I764a5821f98982bc94ce5dc6a4efa81a431fd369 Reviewed-by: Laszlo Agocs --- src/platformsupport/eglconvenience/qeglconvenience.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp index 020d035bf7..5ee4773b70 100644 --- a/src/platformsupport/eglconvenience/qeglconvenience.cpp +++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp @@ -268,7 +268,7 @@ EGLConfig QEglConfigChooser::chooseConfig() configureAttributes.append(EGL_OPENGL_ES_BIT); break; } - // fall through + Q_FALLTHROUGH(); default: needsES2Plus = true; break; -- cgit v1.2.3 From 7c74048e94257c5cdc367c3144dc0e26adf06a56 Mon Sep 17 00:00:00 2001 From: wdl Date: Fri, 29 Mar 2019 18:09:13 +0800 Subject: xcb_egl: Correctly select OpenGL ES render type if user requested Fixes: QTBUG-74736 Change-Id: I8f01857c81e7a831da659102052ca73c101818cd Reviewed-by: Laszlo Agocs --- src/platformsupport/eglconvenience/qeglplatformcontext.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 9d8bf07af8..e44918823b 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -134,7 +134,7 @@ QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatform void QEGLPlatformContext::init(const QSurfaceFormat &format, QPlatformOpenGLContext *share) { - m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig); + m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig, format); // m_format now has the renderableType() resolved (it cannot be Default anymore) // but does not yet contain version, profile, options. m_shareContext = share ? static_cast(share)->m_eglContext : 0; @@ -248,6 +248,12 @@ void QEGLPlatformContext::adopt(const QVariant &nativeHandle, QPlatformOpenGLCon value = 0; eglQueryContext(m_eglDisplay, context, EGL_CONTEXT_CLIENT_TYPE, &value); if (value == EGL_OPENGL_API || value == EGL_OPENGL_ES_API) { + // if EGL config supports both OpenGL and OpenGL ES render type, + // q_glFormatFromConfig() with the default "referenceFormat" parameter + // will always figure it out as OpenGL render type. + // We can override it to match user's real render type. + if (value == EGL_OPENGL_ES_API) + m_format.setRenderableType(QSurfaceFormat::OpenGLES); m_api = value; eglBindAPI(m_api); } else { -- cgit v1.2.3 From e1167ed650afae90ab4b73036f58ae0f416ae500 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 25 Mar 2019 12:39:56 +0100 Subject: tslib: fix detection of missing release coordinates The release coordinates may be simply initialized to 0 in lower levels of the tslib. They are then passed through the calibration stage, which applies offset and multiplication to them, so they may end up even as positive numbers. Since we can't know if we can trust them or not simply ignore all release coordinates and just always use the ones from the previous event. Change-Id: Ib845b5ab1c5b81967cc089d601576893f433fa4a Reviewed-by: Martin Kepplinger Reviewed-by: Laszlo Agocs --- src/platformsupport/input/tslib/qtslib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/input/tslib/qtslib.cpp b/src/platformsupport/input/tslib/qtslib.cpp index 84a468f60c..7609416fea 100644 --- a/src/platformsupport/input/tslib/qtslib.cpp +++ b/src/platformsupport/input/tslib/qtslib.cpp @@ -114,8 +114,8 @@ void QTsLibMouseHandler::readMouseData() int x = sample.x; int y = sample.y; - // work around missing coordinates on mouse release - if (sample.pressure == 0 && sample.x == 0 && sample.y == 0) { + // coordinates on release events can contain arbitrary values, just ignore them + if (sample.pressure == 0) { x = m_x; y = m_y; } -- cgit v1.2.3 From 2593463eafcf8b3cb62dd4f8f9545359336bc005 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 12 Apr 2019 10:24:09 +0200 Subject: kms: Add support for "skip" key in the output config "off" is not quite suitable because that turns the output off, as the name suggests. Disconnected outputs are skipped automatically - it is natural to have a way to request the same for connected outputs as well. Task-number: QTBUG-74871 Change-Id: I8bea83428ae0424601b19482b6e6ef809491d0fb Reviewed-by: Johan Helsing --- src/platformsupport/kmsconvenience/qkmsdevice.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/platformsupport') diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp index ef81f6162d..5f134f5867 100644 --- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp +++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp @@ -59,6 +59,7 @@ enum OutputConfiguration { OutputConfigOff, OutputConfigPreferred, OutputConfigCurrent, + OutputConfigSkip, OutputConfigMode, OutputConfigModeline }; @@ -191,6 +192,8 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, configuration = OutputConfigPreferred; } else if (mode == "current") { configuration = OutputConfigCurrent; + } else if (mode == "skip") { + configuration = OutputConfigSkip; } else if (sscanf(mode.constData(), "%dx%d@%d", &configurationSize.rwidth(), &configurationSize.rheight(), &configurationRefresh) == 3) { @@ -229,6 +232,11 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, return nullptr; } + if (configuration == OutputConfigSkip) { + qCDebug(qLcKmsDebug) << "Skipping output" << connectorName; + return nullptr; + } + // Get the current mode on the current crtc drmModeModeInfo crtc_mode; memset(&crtc_mode, 0, sizeof crtc_mode); -- cgit v1.2.3 From 4298658bef89fb79974530bfa3723a48a6bf7efc Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 11 Apr 2019 14:37:44 +0200 Subject: Fix corner case in openglcompositor for eglfs Add 'source' window offset. This covers the cases where platform window is created besides one full screen window (like for popups), where content has qquickwidget / qopenglwidgtet. In that case fbos/textures from those widgets have offset according to 'source' window. Note backingstore texture has geometry of 'source' window. Task-number: QTBUG-69533 Change-Id: I2514b36fd3a6b9b86f51999df1c2b3e9565aafde Reviewed-by: Laszlo Agocs --- .../platformcompositor/qopenglcompositor.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/platformcompositor/qopenglcompositor.cpp b/src/platformsupport/platformcompositor/qopenglcompositor.cpp index 0f4946f81a..635bf0107f 100644 --- a/src/platformsupport/platformcompositor/qopenglcompositor.cpp +++ b/src/platformsupport/platformcompositor/qopenglcompositor.cpp @@ -188,14 +188,15 @@ static inline QRect toBottomLeftRect(const QRect &topLeftRect, int windowHeight) topLeftRect.width(), topLeftRect.height()); } -static void clippedBlit(const QPlatformTextureList *textures, int idx, const QRect &targetWindowRect, +static void clippedBlit(const QPlatformTextureList *textures, int idx, const QRect &sourceWindowRect, + const QRect &targetWindowRect, QOpenGLTextureBlitter *blitter, QMatrix4x4 *rotationMatrix) { const QRect clipRect = textures->clipRect(idx); if (clipRect.isEmpty()) return; - const QRect rectInWindow = textures->geometry(idx); + const QRect rectInWindow = textures->geometry(idx).translated(sourceWindowRect.topLeft()); const QRect clippedRectInWindow = rectInWindow & clipRect.translated(rectInWindow.topLeft()); const QRect srcRect = toBottomLeftRect(clipRect, rectInWindow.height()); @@ -218,7 +219,7 @@ void QOpenGLCompositor::render(QOpenGLCompositorWindow *window) const QRect targetWindowRect(QPoint(0, 0), m_targetWindow->geometry().size()); float currentOpacity = 1.0f; BlendStateBinder blend; - + const QRect sourceWindowRect = window->sourceWindow()->geometry(); for (int i = 0; i < textures->count(); ++i) { uint textureId = textures->textureId(i); const float opacity = window->sourceWindow()->opacity(); @@ -243,16 +244,16 @@ void QOpenGLCompositor::render(QOpenGLCompositorWindow *window) target = m_rotationMatrix * target; m_blitter.blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft); } else if (!textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) { - // Texture from an FBO belonging to a QOpenGLWidget + // Texture from an FBO belonging to a QOpenGLWidget or QQuickWidget blend.set(false); - clippedBlit(textures, i, targetWindowRect, &m_blitter, m_rotation ? &m_rotationMatrix : nullptr); + clippedBlit(textures, i, sourceWindowRect, targetWindowRect, &m_blitter, m_rotation ? &m_rotationMatrix : nullptr); } } for (int i = 0; i < textures->count(); ++i) { if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) { blend.set(true); - clippedBlit(textures, i, targetWindowRect, &m_blitter, m_rotation ? &m_rotationMatrix : nullptr); + clippedBlit(textures, i, sourceWindowRect, targetWindowRect, &m_blitter, m_rotation ? &m_rotationMatrix : nullptr); } } -- cgit v1.2.3 From 54ceb8a5f86465dcde334973dedf401b31210e63 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Mon, 15 Apr 2019 14:48:23 +0200 Subject: qglxconvenience: use QMAKE_USE instead of QMAKE_USE_PRIVATE The provided API uses Xlib types, so it should publicly link with Xlib. Fixes: QTBUG-75045 Change-Id: Ifea1e8df27cdcc57fb04cd68a7aa1e9fa339c53d Reviewed-by: Laszlo Agocs Reviewed-by: Joerg Bornemann --- src/platformsupport/glxconvenience/glxconvenience.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/glxconvenience/glxconvenience.pro b/src/platformsupport/glxconvenience/glxconvenience.pro index 8367dc5e31..1b9cf79080 100644 --- a/src/platformsupport/glxconvenience/glxconvenience.pro +++ b/src/platformsupport/glxconvenience/glxconvenience.pro @@ -6,7 +6,7 @@ CONFIG += static internal_module DEFINES += QT_NO_CAST_FROM_ASCII -QMAKE_USE_PRIVATE += xlib +QMAKE_USE += xlib HEADERS += qglxconvenience_p.h SOURCES += qglxconvenience.cpp -- cgit v1.2.3