Bug 99855 - Python3 Surface.create_for_data not implemented
Summary: Python3 Surface.create_for_data not implemented
Status: RESOLVED FIXED
Alias: None
Product: pycairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Steve Chaplin
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-18 20:40 UTC by Tobias Mueller
Modified: 2017-07-05 14:51 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch from https://lists.cairographics.org/archives/cairo/2011-December/022563.html by Jeremy Moles cubicool at gmail.com (9.43 KB, patch)
2017-02-18 20:40 UTC, Tobias Mueller
Details | Splinter Review

Description Tobias Mueller 2017-02-18 20:40:33 UTC
Created attachment 129734 [details] [review]
Patch from https://lists.cairographics.org/archives/cairo/2011-December/022563.html by  Jeremy Moles cubicool at gmail.com

I couldn't find a bug report so I create one.

It seems that python3-cairo is missing Surface.create_for_data.  There are many reports on the Web and the accepted fix seems to install python3-cairocffi.

See, for example, https://bugs.launchpad.net/ubuntu/+source/py3cairo/+bug/1330228 or https://github.com/matplotlib/matplotlib/issues/2976

There is even a patch here: https://lists.cairographics.org/archives/cairo/2011-December/022563.html
Comment 1 Tobias Mueller 2017-02-19 11:00:43 UTC
My use case is to overwrite a do_draw method of a Gtk widget.  python-gi exposes a cairo context but I cannot use cr.mask with a cairocffi.SurfacePattern.  So I seem to need python3-cairo.
Comment 2 beroal 2017-02-27 10:29:57 UTC
AFAIK, the functions are implemented in the Git repository. I guess the code will go into 'python-cairo' version 1.10.1.

I need these functions to draw to a 'mmap' object with Cairo. 'cairocffi' can do this, but it does not go along with Pango.
Comment 3 Tobias Mueller 2017-02-27 10:44:19 UTC
Ah, true. It seems that https://cgit.freedesktop.org/pycairo/log/ carries https://cgit.freedesktop.org/pycairo/commit/?id=2f9e604ac7bb5f6386179a3d0fad6f095c386f66

The commit message mentions https://bugs.freedesktop.org/show_bug.cgi?id=44935 so I guess this is a duplicate.

Are we "only" waiting for a release to happen then? Do we know what's blocking it?
Comment 4 beroal 2017-02-27 13:26:56 UTC
I concluded from the bug discussion you found that the implementation is okay. The most plausible blocking reason is lack of manpower. I wrote to the mailing list https://lists.cairographics.org/mailman/listinfo/cairo asking for a release. Let's see. In the meantime, I will use the Git version.
Comment 5 Christoph Reiter 2017-07-05 14:51:49 UTC
Fixed since 1.11: https://pycairo.readthedocs.io/en/latest/changelog.html#v1-11-0


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.