Mittwoch, 9. Juli 2008

About Gradients and Traps...

Radial and Linear Gradients:

Today I started Linear- and RadialGradients (that stuff that was introduced in JDK6). As far as I know LinearGradients are quite complete, Radial Gradients are still missing some functionality.
I guess the Gradient-Stuff is almost complete now :)

No more Traps!
Lines cause many troubles because Java relies on fast lines for shapes, however XRender simply does not support lines at all.
A line can be composed out of 3 trapezoids (and a huge amount of code and runtime-work is needed to get it done right), the traps generate a mask which can be used for composition - however thats really slow for something which is expected to be almost a no-op. For now there is not even a single driver which is able to rasterize traps in hardware.

While playing with the mask-tile-approach I had the idea to draw to my mask with Core-Drawing, which has support for pretty lines.
This would remove the burden of all those trapezoids :)
In theory it should work very well, in reality its not that bad - because EXA doesn't provide driver hooks for lines at all, but because traps aren't accalerated too, nothing is lost - its therefor as fast as the old pipeline on EXA.

The sad news is that its quite slow with Xorg-1.5, but worked ok on 1.3, and it really flies with the proprietary nvidia driver (I guess it has hw line accaleration).
I filed a bug-report, hoping that the situation can be improved.

I really hope I get the mask-tile stuff integrated soon, I am quite curious how it will perform.

Keine Kommentare: