I am back as Mr T. used to say.
I made some intensive tests of cairo. And I have something I can't do and can't explain why.
I would just want to copy one surface to another using the operator SOURCE.
Before I tested it with drawing in the same context
Code: Select all
cairo_set_source_rgba (cr, 1.0, 0.0, 0.0, 0.9);
cairo_rectangle(cr, 0, 300,150, 100);
cairo_fill(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba (cr, 0.0, 0.0, 1.0, 0.5);
cairo_rectangle(cr, 70, 350,150, 100);
cairo_fill(cr);
Now if I want to copy one surface (surface00 from a different context) to another
Code: Select all
cairo_set_source_surface(cr, surface00, 0, 600);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_paint(cr);
Here if surface00 is created by cairo_image_surface_create and surface(from cr) by cairo_amigaos_surface_create, I have a copy of surface00 in cr.
All my previous drawings in cr are deleted.
If I do the same but surface (cr) is created by cairo_pdf_surface_create, all is perfect.
So I don't know why. I thought a bug in cairo's cairo_amigaos_create but if I am right, the OS4 developpers use cairo to display windows and that works.
So if any of the OS4 developpers or any users of cairo could help, I would appreciate a lot.
YesCop