Hello,

> I had a look at x.org's sunffb and all they did is to rewrite
> ffb_accel.c to use XAA and add a hardware-accelerated alpha-blending
> function ( plus accompanying changes in ffb_driver.c to load relevant
> modules and a few more or less trivial ones in other files ). Now I
> have something that works, is fast but for some strange reason all
> text drawn via XRender has red and blue components swapped. Only text,
> images are fine. Playing with anti-aliasing parameters seems to change
> this too, after disabling subpixel hinting newly started apps get it
> right, until next start of the Xserver... It worked fine with the old
> code and affects both KDE and GTK apps. The other changes are only
> reformatting source and renaming of some macros ( XF86* -> XORG* and
> such ).
> Any ideas?
> Looks almost like an un- or misinitialized variable somewhere,
> defaults to ARGB, gets overwritten when someone changes anti-aliasing
> parameters and nobody noticed since ARGB is almost always right.

The problem is definitely in the Xserver:
- sparc64 client with X in ARGB running on a powerpc box - text colours
  are right 
- sparc64 client and X with FFB/ABGR - wrong text colours
- sparc64 client and X with mach64 or mga in ARGB - text colours are
  right 
- client on powerpc, X on sparc64 with FFB/ABGR - text colours are
  wrong
- sparc64 without Xrender support - text colours are right
... so it should be somewhere in Xrender.

There's a bug ( or at least an inconsistency ) in xf86Helper /
xf86SetWeight():

        scrp->offset.red = ffs(mask.red);
        scrp->offset.green = ffs(mask.green);
        scrp->offset.blue = ffs(mask.blue);

this sets 1-based offsets while the rest of the code ( or at least
Xrender's PictureCreateDefaultFormats() ) expects 0-based ones.

have fun
Michael

Attachment: pgpiv1nJ6B0Ms.pgp
Description: PGP signature

Reply via email to