AntiAliased text on X [was code bloat]
Owen Taylor
otaylor at redhat.com
Mon Nov 1 18:20:24 PST 2004
On Mon, 2004-11-01 at 15:38 -0800, Kendall Bennett wrote:
> Lee Revell <rlrevell at joe-job.com> wrote:
>
> > On Mon, 2004-11-01 at 16:35 +0100, Roland Mainz wrote:
> > > That sounds more like that backing-store is turned off in your
> > > Xserver... ;-/
> >
> > Well if that is what Debian does by default, then maybe... but are
> > you really saying that a well tuned Xorg desktop can be as snappy
> > as XP (with the classic theme)? Maybe this was the case a few
> > years ago when the typical X desktop was full of pixellated ugly
> > fonts. But since antialiasing became common the performance took a
> > dive. Keep in mind MS has been doing antialiasing for a long time
> > and it does not seem to kill the performance to nearly the same
> > degree.
>
> IMHO that is mostly because X.org and all projects above it do anti-
> aliasing via RENDER, which requires hardware alpha blending. Doing alpha
> blending in software is really slow. I am pretty sure that Windows does
> cheap anti-aliased fonts without needing hardware ALPHA blending by
> breaking down the glyph into multiple layers of shaded pixels. If you
> have say 8 levels of shading, then you decompose each glyph into 7
> different mono bitmaps, each one representing the pixels that need to be
> drawn in each of the shaded colors. Then you draw them over the top of
> each other with transparency as mono bitmaps, and voila! Anit-aliased
> text.
That way is likely blazingly fast.
But it only works for solid color backgrounds - and for solid colored
backgrounds, there's a different optimization that would already make
things a lot faster and preserve full 8-bit alpha channels, and even
subpixel antialiasing: just don't fetch the underlying bits from the
framebuffer - blending solid color over solid color in software and
writing to the frame buffer is going to give you pretty close to the
magic million glyphs / second on hardware from the last few years.
I did some experiments with client side tracking of solid areas a while
ago. Implementing the same algorithms on the server shouldn't be very
hard. (Just catch a full-pixmap XDrawRectangle, initialize to "all
solid" with the paint color, then subtract out from there as the client
draws. That handles normal toolkit usage.)
Regards,
Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20041101/4c709443/attachment.pgp>
More information about the xorg
mailing list