Re: Drawing with cairo



On Thu, 2008-05-15 at 12:05 -0300, Diego A. Fons wrote:

> Like Theodore I'm using gtkmm. This is an extrac of the code which 
> doesn't work:
> void Plotter::on_realize( void )
> {
>     // Create the GDK window
>     refGdkWindow = Gdk::Window::create(get_window(), &attributes,
>             GDK_WA_X | GDK_WA_Y);
> 
>     // Create Cairo context
>     Cairo::RefPtr<Cairo::Context> cr = refGdkWindow->create_cairo_context();
> }

you're all thinking too hard. Cairo drawing contexts are supposed to be
created as necessary. They are cheap. Don't try to cache them. Create
them in an expose handler and get rid of them.

my attitude towards Cairo is to assume that its been handcoded in SSE9
assembler unless i come across particular hotspots.




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