Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cairo Regions #19

Open
tuxor1337 opened this issue Sep 27, 2013 · 2 comments
Open

Support cairo Regions #19

tuxor1337 opened this issue Sep 27, 2013 · 2 comments
Labels

Comments

@tuxor1337
Copy link

cairocffi does not yet support cairo Regions: http://cairographics.org/manual/cairo-Regions.html

Originally reported as:


Support for cairo_region_t doesn't seem to be there (segfault)

The problem described here for pycairo doesn't seem to be resolved when using cairocffi: https://bugzilla.gnome.org/show_bug.cgi?id=667959

Just try (same with Python 3)

Python 2.7.5 (default, Aug 22 2013, 09:31:58) 
[GCC 4.8.1 20130603 (Red Hat 4.8.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gdk
>>> import cairocffi as cairo
>>> surface = cairo.ImageSurface(0,100,100)
>>> Gdk.cairo_region_create_from_surface(surface)
Segmentation fault (core dumped)

Would be great to have cairo_region_t support, e.g. for input_shape_combine_region.

@SimonSapin
Copy link
Member

Hi. Three things are going on here:

  • First, cairocffi does not support cairo_region_t and related functions. It’s not hard to add, just a bit tedious (as I want everything to be tested and documented.)

  • PyGobject (that you’re using to access GTK) doesn’t support cairocffi. One way to fix this is Pycairo C API support #18, emulate Pycairo’s C API in cairocffi. This is quite fragile and I’d rather do the alternative: change PyGObject to support cairocffi explicitly: https://bugzilla.gnome.org/show_bug.cgi?id=707196

    In the meantime, you can work around this by converting cairocffi wrappers to pycairo before giving them to PyGObject.

  • Finally, PyGObject does not support cairo_region_t, which is the bug you linked. This requires either a new pycairo release, (which is unlikely as the project is dead) or fixing the two points above.

@SimonSapin
Copy link
Member

So this issue is about the first point of my previous message: cairo Regions in cairocffi. If someone is interested in doing this work, I’d be happy to provide guidance.

@liZe liZe added the feature label Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants