[cairo] Threading: painting from the same source_surface

Arjen Nienhuis a.g.nienhuis at gmail.com
Fri Nov 6 09:12:22 PST 2009


On Fri, Nov 6, 2009 at 2:33 PM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> Excerpts from Arjen Nienhuis's message of Fri Nov 06 13:18:52 +0000 2009:
>> The result from thread 1 is T1_bad.jpg but should be T1_ok.jpg. (What
>> happened to the text?)
>> Thread 2 is fine and results in T2.jpg.
>
> What is the connection of this bug to the shared source? What you have
> described should work fine with cairo. What requires serialisation is
> writing to the same objects (cairo_t and cairo_surface_t).
>
> If you could provide a long snippet of code, or ideally a minimal test
> case, we could help you further diagnose the issue.
> -ickle
> --
> Chris Wilson, Intel Open Source Technology Centre
>

I'm afraid that the bug is in that short snippet of code. The attached
test case shows the same problem.

As a minimal test case needs thraeding, I can only do this in python.
If you need anything in C, can you please point me to a simple C
program with threads?

The example png here is one of 9 broken pngs in the result of 200.

I run Ubuntu 8.10 with cairo 1.8.8.

Met vriendelijke groet,
Arjen Nienhuis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 840 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091106/dff2f30a/attachment-0001.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: f1_034.png
Type: image/png
Size: 171687 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091106/dff2f30a/attachment-0001.png 


More information about the cairo mailing list