[cairo] cairo on winXp

Oleg Smolsky oleg.smolsky at pacific-simulators.co.nz
Tue Mar 1 20:34:53 PST 2005


Hi all,

I'm playing with cairo on winXp and it seems that the win32 backend
allocates memory every time an area of the screen is redrawn. This
becomes a noticeable problem (IMHO generates a significant delay) when
trying to repaint a surface that's about 2000x2000 pixels.

My application looks approximately like this:

// This is invoked during startup (first time the DC is available)
void Setup(HDC dc)
{
        cairo_t *pc = cairo_create();
        cairo_set_target_win32(pc, dc);
}

// This is invoked from WM_PAINT message handler
void OnPaint(cairo_t *pc)
{
        cairo_rectangle(cr,......
        cairo_stroke(cr);
        .............
}

// This is invoked on cleanup
void Cleanup()
{
     cairo_destroy(pc);
}

So, the question is - what do I need to invoke (or rewrite) to perform
these allocations once? Ie so backend's operation is split into three
phases - setup&allocation, operation and destroy?

Thanks,
Oleg.




More information about the cairo mailing list