cairo-windows
cairo-windows copied to clipboard
Enable Tee Surface ?
Is there an easy way to see which features cairo-windows had enabled when Cairo was built?
Maybe include\cairo-features.h in the zipfile contains the info you're looking for?
Thanks, that is helpful.
I was comparing cairo-windows to the MingW version and it looks like they enable TeeSurface. Can we enable it here (or is there a blocker, like it's not actually implemented on Windows) ?
This would make it possible to use with pycairo without updating one of the unit tests there that expects TeeSurface to exist.
TBH, I have no idea if there are any issues with TeeSurface, pycairo only started assuming it was there after 0.16.0 so maybe it just wasn't a default here.
cairo-windows include\features.h
#define CAIRO_HAS_WIN32_SURFACE 1
#define CAIRO_HAS_WIN32_FONT 1
#define CAIRO_HAS_PNG_FUNCTIONS 1
#define CAIRO_HAS_SCRIPT_SURFACE 1
#define CAIRO_HAS_FT_FONT 1
#define CAIRO_HAS_PS_SURFACE 1
#define CAIRO_HAS_PDF_SURFACE 1
#define CAIRO_HAS_SVG_SURFACE 1
#define CAIRO_HAS_IMAGE_SURFACE 1
#define CAIRO_HAS_MIME_SURFACE 1
#define CAIRO_HAS_RECORDING_SURFACE 1
#define CAIRO_HAS_OBSERVER_SURFACE 1
#define CAIRO_HAS_USER_FONT 1
#define CAIRO_HAS_INTERPRETER 1
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-cairo/PKGBUILD#L59-L76
CFLAGS=...
--enable-win32 \
--enable-win32-font \
--enable-png \
--enable-shared \
--enable-static \
--enable-gobject \
--enable-tee \
--disable-xlib \
--disable-xcb \
--enable-fc \
--enable-ft \
--disable-silent-rules \
...
I guess it's a matter of adding --enable-tee
somewhere?
Yep, and adding the header file.
Though I'm wondering now, why msys gets this and this project doesn't, maybe they are using two different Makefiles with different defaults.
Maybe we it should change in the upstream Makefile for Windows (Assuming Msys doesn't manually enable it).
Looks like changing build\Makefile.win32.features
in the downloaded folder changing CAIRO_HAS_TEE_SURFACE=0
in the line 35 to CAIRO_HAS_TEE_SURFACE=1
will work. I think. @stuaxo
Thanks - I'll try it when I next get a bit of time - I'm on VS2017 now so should be more straightforward.
@stuaxo or @preshing Have you tried the one I told?
I should be able to try it later, but not going to have time to work on it until at least 9PM BST
@preshing If you could, and problably have some time, can you try the option I told here ? And upload the dll file in release if there was no errors? Kinda I'm interested to know whether thank works and we can solve this problem. :)
Sure. I made the changes here. And the release is here. I didn't test it, but let me know if it works for you! If all goes well I'll merge it into the main branch.
I didn't test it, but let me know if it works for you!
I will test in an hour or so and thanks for your help.
@preshing Looks like it is working with test I run in GitHub Actions. https://github.com/naveen521kk/pycairo/actions/runs/230850470 Let @stuaxo again confirm it. Finally, make it so that the last version released to have that. Because we are using CI for building it and we would just get it from version. Thank You for that. @preshing
Impressive work, I'll catch up on all this later and have a proper look :)
@stuaxo Can the tee surface work be merged in master?
Yes, I tested the pycairo wheel that uses this in a fresh install of python, so LGTM.