From 1e413e01e06fcd3ca750dea799cb053801b96c3c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 17 Feb 2014 18:00:11 +0100 Subject: eglfs: Fix swapped red and blue with QOpenGLWidget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0793d0b53c0e7df65fecfe43ef9daaf07413ea77 Reviewed-by: Jørgen Lind --- src/platformsupport/eglconvenience/qeglcompositor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/platformsupport/eglconvenience/qeglcompositor.cpp') diff --git a/src/platformsupport/eglconvenience/qeglcompositor.cpp b/src/platformsupport/eglconvenience/qeglcompositor.cpp index a38f00d4f6..0e0a2d9375 100644 --- a/src/platformsupport/eglconvenience/qeglcompositor.cpp +++ b/src/platformsupport/eglconvenience/qeglcompositor.cpp @@ -119,16 +119,21 @@ void QEGLCompositor::render(QEGLPlatformWindow *window) glBindTexture(GL_TEXTURE_2D, textureId); QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(textures->geometry(i), targetWindowRect); - m_blitter->setSwizzleRB(window->isRaster()); if (textures->count() > 1 && i == textures->count() - 1) { + // Backingstore for a widget with QOpenGLWidget subwidgets + m_blitter->setSwizzleRB(true); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); m_blitter->blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft); glDisable(GL_BLEND); } else if (textures->count() == 1) { + // A regular QWidget window + m_blitter->setSwizzleRB(true); m_blitter->blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft); } else { + // Texture from an FBO belonging to a QOpenGLWidget + m_blitter->setSwizzleRB(false); m_blitter->blit(textureId, target, QOpenGLTextureBlitter::OriginBottomLeft); } } -- cgit v1.2.3