From fdf85116102ed03a56dae3947f4251bf0f889f33 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 10 Mar 2010 13:37:36 +0100 Subject: Do qFatal() on unsupported screen format instead of crashing later MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: Related to QTBUG-5117 Reviewed-by: Jørgen Lind --- src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp index e78fec1..f5ad70c 100644 --- a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp +++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp @@ -2163,6 +2163,9 @@ bool QVNCScreen::connect(const QString &displaySpec) if (QScreenDriverFactory::keys().contains(driver, Qt::CaseInsensitive)) { const int id = getDisplayId(dspec); QScreen *s = qt_get_screen(id, dspec.toLatin1().constData()); + if (s->pixelFormat() == QImage::Format_Indexed8 + || s->pixelFormat() == QImage::Format_Invalid && s->depth() == 8) + qFatal("QVNCScreen: unsupported screen format"); setScreen(s); } else { // create virtual screen #if Q_BYTE_ORDER == Q_BIG_ENDIAN -- cgit v0.12 From 7dc470fd96f50eff923208cdc6e273161062e2a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 10 Mar 2010 15:13:25 +0100 Subject: Worked around driver bug causing clipping errors on N900. Apparently the driver does some optimization which causes it to behave erratically when stencil testing is enabled. Multiplying the return value from the texture lookup by 1.0 disables the optimization. Task-number: QTBUG-8753 Reviewed-by: Trond --- src/opengl/gl2paintengineex/qglengineshadersource_p.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index ee04166..c88c041 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -331,9 +331,14 @@ static const char* const qglslImageSrcFragmentShader = "\n\ varying highp vec2 textureCoords; \n\ uniform lowp sampler2D imageTexture; \n\ lowp vec4 srcPixel() \n\ - { \n\ - return texture2D(imageTexture, textureCoords); \n\ - }\n"; + { \n" +#ifdef QT_OPENGL_ES_2 + // work-around for driver bug + "return 1.0 * texture2D(imageTexture, textureCoords); \n" +#else + "return texture2D(imageTexture, textureCoords); \n" +#endif + "}\n"; static const char* const qglslCustomSrcFragmentShader = "\n\ varying highp vec2 textureCoords; \n\ -- cgit v0.12