rev 8690 - in trunk/packages/qt4-x11/debian: . patches

Fathi Boudra fabo at alioth.debian.org
Wed Jan 2 08:48:47 UTC 2008


Author: fabo
Date: 2008-01-02 08:48:47 +0000 (Wed, 02 Jan 2008)
New Revision: 8690

Added:
   trunk/packages/qt4-x11/debian/patches/0205-fast-qpixmap-fill.diff
Modified:
   trunk/packages/qt4-x11/debian/changelog
   trunk/packages/qt4-x11/debian/patches/series
Log:
* Add 0205-fast-qpixmap-fill qt-copy patch:
  Fix a performance issue in QPixmap::fill()


Modified: trunk/packages/qt4-x11/debian/changelog
===================================================================
--- trunk/packages/qt4-x11/debian/changelog	2008-01-02 08:37:25 UTC (rev 8689)
+++ trunk/packages/qt4-x11/debian/changelog	2008-01-02 08:48:47 UTC (rev 8690)
@@ -1,3 +1,10 @@
+qt4-x11 (4.3.3-3) UNRELEASED; urgency=low
+
+  * Add 0205-fast-qpixmap-fill qt-copy patch:
+    Fix a performance issue in QPixmap::fill()
+
+ -- Fathi Boudra <fabo at debian.org>  Wed, 02 Jan 2008 09:45:31 +0100
+
 qt4-x11 (4.3.3-2) unstable; urgency=low
 
   * Update 0203-qtexthtmlparser-link-color qt-copy patch:

Added: trunk/packages/qt4-x11/debian/patches/0205-fast-qpixmap-fill.diff
===================================================================
--- trunk/packages/qt4-x11/debian/patches/0205-fast-qpixmap-fill.diff	                        (rev 0)
+++ trunk/packages/qt4-x11/debian/patches/0205-fast-qpixmap-fill.diff	2008-01-02 08:48:47 UTC (rev 8690)
@@ -0,0 +1,48 @@
+Trolltech task ID : None
+bugs.kde.org number : None
+applied: yes
+author: Fredrik Höglund <fredrik at kde.org>
+os: unix
+
+Since there's no way to specify that a QPixmap should have an alpha channel
+when it's created, it's quite common to call pixmap.fill(Qt::transparent)
+immediately after creating it, to force Qt to recreate it with an alpha
+channel. Unfortunately QPixmap::fill() does this by creating a QImage,
+filling it with the specified color, and then converting it to a QPixmap.
+
+This patch avoids the expensive image->pixmap conversion by simply discarding
+the old pixmap, creating a new one with the correct format, and doing the
+fill server side.
+
+--- a/src/gui/image/qpixmap_x11.cpp
++++ b/src/gui/image/qpixmap_x11.cpp
+@@ -440,8 +440,28 @@
+         return;
+     if (fillColor.alpha() != 255) {
+ #ifndef QT_NO_XRENDER
+-        if (data->picture && data->d == 32) {
++        if (X11->use_xrender) {
+             detach();
++            if (!data->picture || data->d != 32) {
++                if (data->picture)
++                    XRenderFreePicture(X11->display, data->picture);
++                if (data->mask_picture)
++                    XRenderFreePicture(X11->display, data->mask_picture);
++                if (data->x11_mask)
++                    XFreePixmap(X11->display, data->x11_mask);
++                if (data->hd)
++                     XFreePixmap(X11->display, data->hd);
++                if (data->hd2)
++                    XFreePixmap(X11->display, data->hd2);
++                XRenderPictFormat *format = XRenderFindStandardFormat(X11->display, PictStandardARGB32);
++                data->hd = XCreatePixmap(X11->display, RootWindow(X11->display, data->xinfo.screen()),
++                                         width(), height(), 32);
++                data->picture = XRenderCreatePicture(X11->display, data->hd, format, 0, 0);
++                data->mask_picture = 0;
++                data->x11_mask = 0;
++                data->hd2 = 0;
++                data->d = 32;
++            }
+             ::Picture src  = X11->getSolidFill(data->xinfo.screen(), fillColor);
+             XRenderComposite(X11->display, PictOpSrc, src, 0, data->picture,
+                              0, 0, width(), height(),

Modified: trunk/packages/qt4-x11/debian/patches/series
===================================================================
--- trunk/packages/qt4-x11/debian/patches/series	2008-01-02 08:37:25 UTC (rev 8689)
+++ trunk/packages/qt4-x11/debian/patches/series	2008-01-02 08:48:47 UTC (rev 8690)
@@ -14,6 +14,7 @@
 0200-fix-qsslsocket-waitfor.diff
 0203-qtexthtmlparser-link-color.diff
 0204-fix-tulip-aliasing.diff
+0205-fast-qpixmap-fill.diff
 
 # debian patches
 01_qmake_for_debian.diff




More information about the pkg-kde-commits mailing list