[cairo] cairo as an immediate base for retained API and gsave/grestore

Jost Boekemeier jost2345 at yahoo.de
Fri Jul 23 09:35:53 PDT 2004


> I just tried to imagine how would I implement it and
> what in my opinion helps it, in contrast to 
> using cairo directly in immediate mode.

For example by associating each shape with a
cairo_surface and then let the user draw to the shape.
 The only difference between the direct mode and the
retained mode is that the retained mode keeps the
drawing commands and only draws on demand, then
composes the surface(s) onto the top-level drawable:

 forAll
  cairo_save(ctx); 
  cairo_set_target_surface(ctx, parent);
  cairo_apply_transformation(ctx, transformation); 
  cairo_show_surface(ctx, surface, x, y, w, h); 
  cairo_restore(ctx);

[I don't have the cairo API at the moment, so the API
calls might be a bit different]

> Re calculating paths twice. The amount of 
> calculation depends heavily on the path 
> complexity. 

99% have a rectangular input area anyway.  Even the
desktop icons. -- I think an old version of gnome made
this mistake and used a non-rectangular area.  This
was a usability nightmare, if you clicked right in the
middle hole of the CD icon, nothing happened.

However, once it is finished, it would be interesting
to port Dia to test the implementation.


Input handling is a separate issue:

> it is definitely not very wise to
> instantiate/consume path on every mouse move

I think the X server has to handle this through
InputOnly windows and the shape extension (not sure if
that works, though). I'd say that if the server cannot
handle say 10.000 shaped InputOnly windows
efficiently, then there is something wrong with it. 


Jost



	

	
		
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de



More information about the cairo mailing list