[cairo] Clear Screen command?

Mj Mendoza IV mjmendoza at konsolscript.org
Fri May 28 01:17:47 PDT 2010


Maarten Bosmans <mkbosmans <at> gmail.com> writes:

> I'm wondering why you would want to clear the screen first. Wouldn't
> drawing the buffer to the screen overwrite any existing content?
> 
> If I understand your procedure correctly, this approach would cause
> screen flicker, because drawing stuff to the buffer takes some time.
> 
> Maarten
> --
> cairo mailing list
> cairo <at> cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

IIRC, clearing the screen first will make sure that any image/graphics rendered
with alpha won't _blend in_ with whatever is currently on the screen.


Anyway, I found the answer on Cairo's FAQ page -- silly me.

cairo_save (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
cairo_paint (cr);
cairo_restore (cr);


Regards.

Mj Mendoza IV,
Developer, KonsolScript
http://www.konsolscript.org




More information about the cairo mailing list