Layering of multiple images

Blagoj Kupev <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAB=Grm0Txw5ij=iMfcBN+u8HPbvBUuYpBBYPrnN1Qy_RkEMONQ@mail.gmail.com>
Hello,
I need to layer several images one on top of the others, so I'm using
background image and the others on top of it are with transparency. But
when I need to change the pictures they are flicker, and it is noticeable
that pictures are redrawn.
The sequence that i'm using is:
1. First I"m loading all images from disk using
cairo_image_surface_create_from_png
2. Then i'm layering them:
cr = gdk_cairo_create (widget->window);
  cairo_translate(cr, PIC1_X_ORIGIN, PIC1_Y_ORIGIN); // Background image
  cairo_set_source_surface(cr, pic1_p, 0, 0);
  cairo_paint(cr);

  cairo_translate(cr, PIC2_X_ORIGIN, PIC2_Y_ORIGIN); //Some graphics and
the rest is transparent
  cairo_set_source_surface(cr, pic2_p, 0, 0);
  cairo_paint(cr);
....

I assume that in most of the cases the time between drawing the pic1 and
then pic2 on top of it is more than 30ms so the second image flickers.

Is there a way to paint both images at once so the flicker is avoided? Or
maybe combine them in background and then paint at once?

Best regards,
Blagoj

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.