Fixed point cairo.. or no cairo?



Hi,

I have started working on a fully fixed point implementation of cairo,
as well as adding fixed point public API. The existing floating point
API is made to wrap the fixed point one. All this initially only of the
bits pertaining to font rendering. 

Implementation wise I have not yet hit any troubles. The problems come
in with the amount of API duplication it causes: fixed and floating
point versions of a gazillion data structures and functions. It's not
just ugly, but also causes real problems for things like cairo-matrix,
which in itself is just a struct containing 4 doubles (or ints). So all
functions operating on cairo-matrix need two versions, including the
cairo-matrix specific functions like cairo_matrix_translate() and
friends. These are actual bits of logic being implemented twice. Not
good.

An option would be designing a new floating API really on top of the
fixed point one, one that would really just wrap the basic things and
reduce code duplication to a minimum. This has the obvious major
disadvantage of breaking backwards compatibility which may not be at all
acceptable.

Then I also got thinking again whether we could not instead totally
avoid cairo on embedded systems. If PangoLayout drawing was made
overridable in GtkStyle, could theme engines not force usage of plain
xft pango? This, together with moving text selection drawing logic into
GtkStyle, should have us mostly covered. A problem here is the need to
pull in libpangoxft next to libpangocairo, which, as they both provide
more or less the same functionality, could be considered wasteful.
(libpangoxft on my system is 24K, which luckily is not too bad.)

Has anyone else been giving any thought to all this? If so, I'd love to
hear any ideas.

Thanks,

Jorn

-- 
OpenedHand Ltd.
http://o-hand.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]