webcore 106 color handling changes

Maks Orlovich mo002j at mail.rochester.edu
Sat Oct 25 20:36:58 CEST 2003


On Saturday 25 October 2003 05:44 pm, David Hyatt wrote:
> I may have made incompatible changes here, because perhaps I don't
> understand how QRgb works in Qt.  In the Safari tree, we support the
> ability to specify rgba quadruples in CSS.  This means that a color
> with an alpha component is perfectly valid and specifiable using CSS.
>
> Our QRgb is 32 bits, with 8 bits for each of the R, G, and B values,
> and another 8 bits for the alpha value.  Looking at constructions like
> qAlpha, I assumed that's how Qt's QRgb works as well.  Was I mistaken?

QRgb does include alpha, but it's only useful when doing direct image 
manipulation client-side (and representing those images as server-side 
pixmaps might not be supported by the target X server, plus when it works 
it's generally slow);  the actual draw-on-the-screen stuff in QPainter uses 
QColor, which basically only supports RGB (in fact, on X11 it includes 
internal hacks that use the alpha bits of the color for special purposes!)

At this point we can't simply draw stuff with alpha and forget it; the 
capabilities are not consistently available, and where they are they are 
slow, and often require direct usage of XRender or Xft.



More information about the Khtml-devel mailing list