Setting a background "layer"

mike e <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <KL1PR0401MB1400590B0028168C538EBC5EB07C0@KL1PR0401MB1400.apcprd04.prod.outlook.com>
Hello, I'm not that experienced with cairo.


Currently I have a program that draws a background, and then draws some text over that background.  The text moves around over the background.  The image is redrawn often (multiple times a second).


The background is generated through cairo, it is not an image or something like that.


What is the most efficient way to accomplish this?  I know that I could set the paint operator to source and redraw everything each frame, but it seems inefficient.

Is there a way to draw a layer, and then save that layer indefinitely (or have a layer dedicated to the text)?  So that then I could just clear just the text each time and draw it in a new location?


I'm using Xlib and drawing to an window through cairo_xlib_surface_create().


Heres what I'm basically trying to do:


    if (firstrun) {

        draw_background();

    }


    clear_text();

    draw_text(new_location);

-- 
cairo mailing list
[email protected]
https://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.