[cairo-bugs] [Bug 101866] raster source pattern callback weirdness

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jul 22 11:25:15 UTC 2017


--- Comment #2 from Christoph Reiter <reiter.christoph at gmail.com> ---
(In reply to Uli Schlachter from comment #1)
> Use cairo_raster_source_pattern_set_callback_data() to set the closure
> argument of your callback:
> https://www.cairographics.org/manual/cairo-Raster-Sources.html#cairo-raster-
> source-pattern-set-callback-data

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.

> 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):

If there is no use for it I'll just not pass it to the Python callback then,

> 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.

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.

You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20170722/119e422c/attachment.html>

More information about the cairo-bugs mailing list