diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-02-17 18:00:11 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-21 15:53:14 +0100 |
commit | 1e413e01e06fcd3ca750dea799cb053801b96c3c (patch) | |
tree | 2db182c079f5b973a7f7cd32c32d98c7aa05d72c /src/platformsupport/eglconvenience/qeglcompositor.cpp | |
parent | 727f50d11e33d8ae66a92bdbf932dbac14d4dcf8 (diff) |
eglfs: Fix swapped red and blue with QOpenGLWidget
Change-Id: I0793d0b53c0e7df65fecfe43ef9daaf07413ea77
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglcompositor.cpp')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglcompositor.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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); } } |