[cairo] operator CAIRO_OPERATOR_XOR

Roman Bednarek roman at mikronika.com.pl
Mon Jul 12 01:09:48 PDT 2004


On Wed, 7 Jul 2004, Carl Worth wrote:

> On Wed, 7 Jul 2004 10:03:52 +0200 (CEST), Roman Bednarek wrote:
> >    Thanks for explanation. The bitwise xor operator was used mainly for
> > achiving "rubber-band" effect, when you draw something twice it
> > disappears. Is it possible to achive the same effect with cairo API? I
> > hope yes, so is there an example of this?
>
> No, there is not any way to implicitly save the background contents due
> to an operator side-effect, (at least as far as I can tell). But we're
> optimistic that things will be plenty fast enough that application
> authors won't feel compelled to resort to hacks like that anyway.
>
> For example, even apart from cairo, I'm beginning to notice that
> applications are now often drawing selection boxes with things like
> filled translucent rectangles rather than XORred outlines.
>

   I was reading some explanations why XOR is not neeeded anymore, when I
was trying to port our application to GDI+, which does not have xor too.
It all seemed qiute reasonable and I was almost convinced, but at the same
time our program was tested on mulitmonitor setup: 2 Geforce Quadro cards
and 6 (later 8) 1280x1024 LCD monitors. All BitBlt operations between
cards were noticeably slow. I had to disable drawing to back buffer on
that setup, because BitBlt from backbuffer to screen was too slow. Of
course xor drawing was as fast as always. I had to postpone GDI+ port.
 In our program we use XOR operations for many things and changing this
would require considerable changes to the program. I hoped that I could
only port our graphics library and the program could remain unchanged.
   I do not know if there are many programs out there which rely on xor
support, but for them porting too cairo will not be easy.

   Roman Bednarek




More information about the cairo mailing list