[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    [Fwd: KPixmap patch (specially for people running on Big Endian
From:       Antonio Larrosa <antlarr () arrakis ! es>
Date:       2000-09-26 19:28:02
[Download RAW message or body]

Hi,

I'm having problems sending mails to kde-core-devel, so I'll try to
send them here and boicott kde-core-devil.

-------- Original Message --------
From: Antonio Larrosa <antonio@larrosa.org>
Subject: KPixmap patch (specially for people running on Big Endian machines)
To: kde-core-devel <kde-core-devel@kde.org>

Hi,

There's a _very_ big problem in KPixmap's kdither_32_to_8 function which
swaps red and blue channels on my machine, so I get a totally screwed
background when running on an 8 bit display (yes, I decided to use an 8 bit
display to see how KDE runs on it, and it was unusable for me before the
commited patches to hcstyle and this one)

The attached patch fixes it, but as I'm not used to work on that code and
it's a bit ... unreadable for external persons, I'd prefer someone to review
it (and possibly, test it on your machine running in 8 bit, to see that
I've not introduced any problem for other people, specially people running
KDE on big endian machines)

Note that even if I'm running KDE on a little endian, the X server for my
Mystique card seems to run in BGR mode when in 16 bits, maybe it's related.

Greetings,

--
Antonio Larrosa Jimenez
KDE Core developer
antonio@larrosa.org        larrosa@kde.org
http://www.larrosa.org
KDE - The development framework of the future, today.
["kpixmap.cpp.diff" (text/plain)]

Index: kpixmap.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kpixmap.cpp,v
retrieving revision 1.37
diff -u -r1.37 kpixmap.cpp
--- kpixmap.cpp	2000/06/03 22:47:10	1.37
+++ kpixmap.cpp	2000/09/25 19:25:48
@@ -104,7 +104,7 @@
     for ( y=0; y < src->height(); y++ ) {
 	p = (QRgb *)src->scanLine(y);
 	b = dst->scanLine(y);
-	int endian = (QImage::systemByteOrder() == QImage::BigEndian);
+	int endian = (QImage::systemBitOrder() == QImage::BigEndian);
 	int x;
 	uchar* q = src->scanLine(y);
 	uchar* q2 = src->scanLine(y+1 < src->height() ? y + 1 : 0);
@@ -156,7 +156,7 @@
 	    }
 	}
 
-	if (endian) {
+	if (!endian) {
 	    for (x=0; x<sw; x++)
 		*b++ = INDEXOF(pv[2][x],pv[1][x],pv[0][x]);
 	} else {





>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic