Revert "qt4: Updated to v4.7.3"
[openembedded.git] / recipes / qt4 / qt-4.6.0 / 1157-Align-GL_RGB-lines-on-a-4-byte-boundary-when-uploadi.patch
1 From 87777f7c0f4c3e338d23d2c3d368a8a484a35a6e Mon Sep 17 00:00:00 2001
2 From: Rhys Weatherley <rhys.weatherley@nokia.com>
3 Date: Fri, 18 Dec 2009 15:01:07 +1000
4 Subject: [PATCH 1157/1244] Align GL_RGB lines on a 4-byte boundary when uploading pixmap textures
5
6 Previous code was aligning lines on a 3-byte boundary.
7
8 Task-number: QTBUG-6902
9 Reviewed-by: Julian de Bhal
10 ---
11  src/opengl/qpixmapdata_gl.cpp |   15 ++-------------
12  1 files changed, 2 insertions(+), 13 deletions(-)
13
14 diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
15 index 4e1d50d..92c990b 100644
16 --- a/src/opengl/qpixmapdata_gl.cpp
17 +++ b/src/opengl/qpixmapdata_gl.cpp
18 @@ -341,22 +341,11 @@ void QGLPixmapData::ensureCreated() const
19  
20      if (!m_source.isNull()) {
21          if (external_format == GL_RGB) {
22 -            QImage tx = m_source.convertToFormat(QImage::Format_RGB32);
23 -
24 -            QVector<uchar> pixelData(w * h * 3);
25 -            uchar *p = &pixelData[0];
26 -            QRgb *src = (QRgb *)tx.bits();
27 -
28 -            for (int i = 0; i < w * h; ++i) {
29 -                *p++ = qRed(*src);
30 -                *p++ = qGreen(*src);
31 -                *p++ = qBlue(*src);
32 -                ++src;
33 -            }
34 +            const QImage tx = m_source.convertToFormat(QImage::Format_RGB888);
35  
36              glBindTexture(target, m_texture.id);
37              glTexSubImage2D(target, 0, 0, 0, w, h, external_format,
38 -                            GL_UNSIGNED_BYTE, &pixelData[0]);
39 +                            GL_UNSIGNED_BYTE, tx.bits());
40          } else {
41              const QImage tx = ctx->d_func()->convertToGLFormat(m_source, true, external_format);
42  
43 -- 
44 1.6.5
45