From bd8f1171ea1d564bb9b8e04b1a220e5559d60423 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Sun, 13 Sep 2009 09:40:37 +0200 Subject: Fix libiconv support on FreeBSD. For some reason iconv support was broken in Qt 4.5 on FreeBSD, and this patch was made to fix that. Original patch by Max Brazhnikov . Original message: Enable libiconv support. Didn't get where the real problem is, but using UTF-16LE/BE as default encoding (see patch) fixes the issue. Merge-request: 1480 Reviewed-by: Thiago Macieira --- src/corelib/codecs/qiconvcodec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp index 6153d70..e4389b9 100644 --- a/src/corelib/codecs/qiconvcodec.cpp +++ b/src/corelib/codecs/qiconvcodec.cpp @@ -62,7 +62,7 @@ #elif defined(Q_OS_AIX) # define NO_BOM # define UTF16 "UCS-2" -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) # define NO_BOM # if Q_BYTE_ORDER == Q_BIG_ENDIAN # define UTF16 "UTF-16BE" -- cgit v0.12 From 8d596ad475a5874c9d271799ee65e0607658c82b Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 14 Sep 2009 10:38:45 +0200 Subject: Fixed bad gradient offsets on Mac OS X When an engine supports pixmap transformations natively, there will still be a redirection offset in the matrix even after calling resetMatrix(), so this is not enough, we need to set it to an actual identity. Reviewed-by: Trond --- src/gui/painting/qpainter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index a9257c7..beda9d6 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -475,7 +475,8 @@ void QPainterPrivate::draw_helper(const QPainterPath &originalPath, DrawOperatio p.end(); q->save(); - q->resetMatrix(); + state->matrix = QTransform(); + state->dirtyFlags |= QPaintEngine::DirtyTransform; updateState(state); engine->drawImage(absPathRect, image, -- cgit v0.12 From 9d075f383597f727b0c5c1e6bdbb9646e35c0fa0 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Mon, 14 Sep 2009 11:00:01 +0200 Subject: Fix drawTiledPixmap for NPOT pixmaps on OpenGL ES 2.0 OpenGL ES does not support GL_REPEAT wrap modes for NPOT textures. So instead, we emulate GL_REPEAT by only taking the fractional part of the texture coords in the fragment shader. Task-number: 260982 Reviewed-by: Samuel --- src/opengl/gl2paintengineex/qglengineshadersource_p.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index acd4461..6bcf010 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -260,12 +260,24 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\ static const char* const qglslAffinePositionWithTextureBrushVertexShader = qglslPositionWithTextureBrushVertexShader; +#if defined(QT_OPENGL_ES_2) +// OpenGL ES does not support GL_REPEAT wrap modes for NPOT textures. So instead, +// we emulate GL_REPEAT by only taking the fractional part of the texture coords. +// TODO: Special case POT textures which don't need this emulation +static const char* const qglslTextureBrushSrcFragmentShader = "\ + varying highp vec2 brushTextureCoords; \ + uniform lowp sampler2D brushTexture; \ + lowp vec4 srcPixel() { \ + return texture2D(brushTexture, fract(brushTextureCoords)); \ + }"; +#else static const char* const qglslTextureBrushSrcFragmentShader = "\ varying highp vec2 brushTextureCoords; \ uniform lowp sampler2D brushTexture; \ lowp vec4 srcPixel() { \ return texture2D(brushTexture, brushTextureCoords); \ }"; +#endif static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\ varying highp vec2 brushTextureCoords; \ -- cgit v0.12