cairo drawing commands to gdk_invalidate_region

Assume I have a routine:

    int draw(cairo_t *cr)

used to draw an overlay in a GdkWindow.

In order to minimize redrawing, I would like to get the minimal (up to some accuracy to be determined) set of GdkRegion's that encompasses all the drawing of draw().

I thought of doing this by creating a low resolution cairo image surface that I pass to draw() and check if pixels are "dirty" in which case it indicates that the corresponding rectangle in the source GdkWindow needs to redrawn.

Is there a better method?


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