diff options
author | Liang Qi <liang.qi@qt.io> | 2019-04-24 09:52:30 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-04-24 09:52:30 +0200 |
commit | dc373186841802f2dd17fcd243efdeca7d5433e9 (patch) | |
tree | 4fff0a3366b63db97ca5a8b04a220bb0b8c56450 /src/platformsupport | |
parent | 7d646508c8219408f90103ed13613db8d01a4065 (diff) | |
parent | cb10ec56f733c34d23c9e5511b19c1e508d0f13f (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
src/gui/util/qshaderformat.cpp
src/gui/util/qshaderformat_p.h
src/widgets/graphicsview/qgraphicsitem_p.h
Change-Id: Idafd88eb9a0a15b4af29f6143d009c1ec8ceecca
Diffstat (limited to 'src/platformsupport')
6 files changed, 26 insertions, 11 deletions
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; diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index c0e528f922..94def16748 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<QEGLPlatformContext *>(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 { 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 diff --git a/src/platformsupport/input/tslib/qtslib.cpp b/src/platformsupport/input/tslib/qtslib.cpp index c4caea5c80..df57147af6 100644 --- a/src/platformsupport/input/tslib/qtslib.cpp +++ b/src/platformsupport/input/tslib/qtslib.cpp @@ -96,8 +96,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; } diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp index 4b27522976..5838c43eca 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); 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); } } |