<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - raster source pattern callback weirdness"
href="https://bugs.freedesktop.org/show_bug.cgi?id=101866#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - raster source pattern callback weirdness"
href="https://bugs.freedesktop.org/show_bug.cgi?id=101866">bug 101866</a>
from <span class="vcard"><a class="email" href="mailto:reiter.christoph@gmail.com" title="Christoph Reiter <reiter.christoph@gmail.com>"> <span class="fn">Christoph Reiter</span></a>
</span></b>
<pre>(In reply to Uli Schlachter from <a href="show_bug.cgi?id=101866#c1">comment #1</a>)
<span class="quote">> Use cairo_raster_source_pattern_set_callback_data() to set the closure
> argument of your callback:
> <a href="https://www.cairographics.org/manual/cairo-Raster-Sources.html#cairo-raster">https://www.cairographics.org/manual/cairo-Raster-Sources.html#cairo-raster</a>-
> source-pattern-set-callback-data</span >
Thanks. I'm using that now. I'd would have preferred to use
cairo_pattern_get/set_user_data() so there can be no conflict if Python gets
passed an existing object with configured callbacks/callback data from C. But I
guess that's unlikely to happen anyway.
<span class="quote">> The pattern argument is a static, stack-allocated copy that cairo creates
> internally. I have to admit that I am not sure why this pattern is given to
> the callback at all. The backtrace for the creation of the copy looks like
> that (I guess that both calls create copies of the raster pattern):</span >
If there is no use for it I'll just not pass it to the Python callback then,
thanks.
<span class="quote">> For this bug report: I would argue that your expected behavior just is not
> the behavior that cairo provides, so there is no bug here. I'm not sure what
> you mean exactly with "it is dead, so doing anything with it crashes". Your
> example program does not crash here.</span >
I meant that the object has a reference count of 0 and wrapping it, which
involved refing/unrefing it, made it crash if I remember correctly. The example
program should not crash but show a reference count of 0.
Closing is fine with me, thanks.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>