From a1ada382ff00a8e1599aba22ee06ff53ce478666 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 30 Apr 2015 15:09:59 +0200 Subject: Handle parsing of GL_VERSION as reported by Nexus 6 The Nexus 6 device reports a GL_VERSION which is strictly not conformant to what is expected from GL_VERSION, so a check is added for this case so that it correctly detects the right OpenGL ES version. Change-Id: I00297dd7c1e505dd7f9ab8a7fa480f514162b488 Reviewed-by: Laszlo Agocs --- src/gui/kernel/qplatformopenglcontext.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qplatformopenglcontext.cpp b/src/gui/kernel/qplatformopenglcontext.cpp index 527bfdd983..364c1a5c0e 100644 --- a/src/gui/kernel/qplatformopenglcontext.cpp +++ b/src/gui/kernel/qplatformopenglcontext.cpp @@ -121,6 +121,10 @@ bool QPlatformOpenGLContext::parseOpenGLVersion(const QByteArray &versionString, if (versionParts.size() >= 2) { major = versionParts.at(0).toInt(&majorOk); minor = versionParts.at(1).toInt(&minorOk); + // Nexus 6 has "OpenGL ES 3.0V@95.0 (GIT@I86da836d38)" + if (!minorOk) + if (int idx = versionParts.at(1).indexOf('V')) + minor = versionParts.at(1).left(idx).toInt(&minorOk); } else { qWarning("Unrecognized OpenGL ES version"); } -- cgit v1.2.3 From d4a296b538da93f5c915fc7e886c6995f1b41169 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 20 May 2015 13:35:07 +0200 Subject: Do not modify decoder when determining image-format We should not configure the decoder when just determining the image- format. Doing so can cause all versions of libpng to print a warning, and some versions to fail to decode. The code appears to be a leftover from when the image-format logic was copied out of the introduction of the decoding method, where the proper settings are still applied. Task-number: QTBUG-46233 Change-Id: I6619728804f040ae6c9d637c7298a8586e22499e Reviewed-by: Andy Shaw Reviewed-by: aavit --- src/gui/image/qpnghandler.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/gui') diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 17a0dd3eb9..304ab0cf3e 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -674,16 +674,9 @@ QImage::Format QPngHandlerPrivate::readImageFormat() && num_palette <= 256) { // 1-bit and 8-bit color - if (bit_depth != 1) - png_set_packing(png_ptr); - png_read_update_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); format = bit_depth == 1 ? QImage::Format_Mono : QImage::Format_Indexed8; } else { // 32-bit - if (bit_depth == 16) - png_set_strip_16(png_ptr); - format = QImage::Format_ARGB32; // Only add filler if no alpha, or we can get 5 channel data. if (!(color_type & PNG_COLOR_MASK_ALPHA) -- cgit v1.2.3