Cairo composing

This forum is for general developer support questions.
Post Reply
User avatar
YesCop
Posts: 44
Joined: Wed Oct 26, 2011 12:45 am
Location: Caen, France

Cairo composing

Post by YesCop »

Hi everybody,
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);
Here the copy works as it must.
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);
The result is, in fact depends on the surfaces.
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
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: Cairo composing

Post by chris »

cairo_amigaos_surface_create() needs to be supplied with an ARGB32 BitMap. If you pass anything else to it you tend to get no output.
User avatar
YesCop
Posts: 44
Joined: Wed Oct 26, 2011 12:45 am
Location: Caen, France

Re: Cairo composing

Post by YesCop »

Hi Chris,

Yes it is done. Imagine that i make a drawing and use the operator OVER. All is fine.
But if I replace OVER by SOURCE, there is a problem, that's the purpose of my post.
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: Cairo composing

Post by chris »

If it's definitely ARGB32 then I've exhausted my Cairo knowledge, sorry.
User avatar
YesCop
Posts: 44
Joined: Wed Oct 26, 2011 12:45 am
Location: Caen, France

Re: Cairo composing

Post by YesCop »

Hi Chris,
First, I will thank you for your interest, you were the only one. :?

I hope this time that someone could explain me what is the problem with cairo. A few months ago, I posted about cairo in the sdk forum without answer neither. Is it cairo a taboo ? 8-)
I sincerally hope that some (OS or not) developpers could answer to me. :!:

Cheers,
YesCop
Post Reply