[cairo] integer world coordinate system

Chris Wilson chris at chris-wilson.co.uk
Wed Aug 18 00:35:20 PDT 2010


On Wed, 18 Aug 2010 14:17:04 +0800, "M.R." <makrober at gmail.com> wrote:
> We are evaluating options for graphics on a new project. Cairo is
> high on the list, with one potential problem:
> 
> The application area 2-D "world-space" is in our application in
> "display surface scaled" integer coordinates. As far as I can
> determine from the documentation, Cairo requires, with no possibility
> to circumvent this, that vertices of drawing primitives be given to
> it in doubles. Am I correct? Is there any way to circumvent this and
> communicate with Cairo directly in integer, display-surface scaled
> coordinates?

Right. You have to remember that you are not the first to wonder. And that
in the preceding years, back when FPU-less ARMs were prevalent, profiles
have been made that showed the overhead of a double-vs-integer API as
being insignificant. Therefore we choose to only maintain a double API.

Numbers talk. Converting the interface isn't a major task, so if you feel
that it would be better to use integer-only for your code, please do try
and tell us what difference it made.

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list