[cairo] Re: SVG Spacewar

Steve Chaplin stevech1097 at yahoo.com.au
Mon Apr 4 19:37:52 PDT 2005


On Sun, 2005-04-03 at 12:00 -0700, cairo-request at cairographics.org
wrote:
> On Fri, 2005-04-01 at 21:21 +0800, Steve Chaplin wrote:
> > You could put the gtkcairo widget inside a gtk_aspect_frame
> > and then remove scale_for_aspect_ratio()
> > - let gtk maintain the gtkcairo widget with the correct aspect ratio,
> > and just scale to fit the widget width and height, without needing
> > to use cairo_translate() to offset into the gtkcairo window, patch
> > attached.
> 
> I tried your patch, and it mostly works, except the resultant window is
> not quite right - there's a border or something somewhere that gets in
> the way.  I added the two lines below, but I am not enough of a GTK guru
> to know why the gtkCairo object inside the gtkAspectFrame ends up being
> 798 x 598 pixels rather than 800 x 600.
> 
> gtk_frame_set_shadow_type (GTK_FRAME (aframe), GTK_SHADOW_NONE);
> g_object_set (G_OBJECT(aframe), "border-width", 0, NULL);
> 
> This leads to massive slow-down (my reported effective frame rate drops
> from 200fps to 15fps) but I am not sure why - whether it's the non-1
> scale factor or non-pixel-aligned clipping rectangle or something else.
> I haven't really got around to poking too hard at it yet.

Looks like using gtkAspectFrame was not a good idea. I don't know why it
should slow everything down so much, or use a few pixels when its border
is 0 and SHADOW_NONE.

Steve






More information about the cairo mailing list