[cairo] Cairo lines disappear in a certain scale range

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Thu Apr 2 04:44:14 PDT 2009

On Thu, 2 Apr 2009 robert9reen at yahoo.com wrote:

> Thanks Joonas! In fact, looking at the Cairo DLL file itself, it 
> turns out that Cairo uses GDI32's drawing functions internally 
> (LineTo, PolyBezier, etc.) and this probably (and unfortunately) 
> means that Cairo relies on Windows GDI to perform the actual drawing 
> -- Cairo is not a device interface after all you may say. 

Perhaps others can give more precise info on this, but after glancing 
at the implementation, it seems cairo is using PolyBezier only in the 
win32-printing surface, and not in win32-surface itself.

[snip geography]

> Could any existing library/subsystem for Win32 
> perform such thing, or do I still have to (re)invent the wheel?? Are 
> there any GDI32 alternatives for Windows 32 or may be the question 
> doesn't make sense? 

Ah, well I think you need to separate out the drawing parts from the 
real geometry representation.  While there are libraries that can 
represent massive geometries at fine detail faithfully you almost 
never want to feed them to the graphics system as is without 
preprocessing.  If you're looking at a m^2 in London, there's no point 
in feeding the renderer any geometry elsewhere in the world!  
Similarly, if you're looking at the entire world, some geometry 
simplification is definitely in order. :)

Having used cairo and some other systems in similar situations for 
large area rendering before, I've found that the best way to deal with 
graphics system coordinate issues is to treat the rendering system as 
a limited precision device (which it obviously is), and deal with 
geometry culling, clipping, and simplification yourself.  Fortunately 
clipping to rectangular areas is easy and fast to do.  The main 
remaining difficulty can be from needing to be much more aware of not 
overculling by accident, but that mostly refers to tracking the 
maximum extents of whatever visual representations could be rendered 
for any geometry.  Although, usually I've just punted by making a "big 
enough" cull rectangle around the viewport.

> Any enlightenment &| recommendations would be much appreciated.

There's another thread with the subject "Large image support" on 
cairo-l just now that talks more about splitting your rendering into 
tiles.  It may be helpful also.



More information about the cairo mailing list