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

Enable Tee Surface ? #7

Open
stuaxo opened this issue Aug 20, 2020 · 15 comments
Open

Enable Tee Surface ? #7

stuaxo opened this issue Aug 20, 2020 · 15 comments

Comments

@stuaxo
Copy link
Contributor

stuaxo commented Aug 20, 2020

Is there an easy way to see which features cairo-windows had enabled when Cairo was built?

@stuaxo stuaxo changed the title What features are e a le What features are enna Aug 20, 2020
@stuaxo stuaxo changed the title What features are enna What features are enabled Aug 20, 2020
@preshing
Copy link
Owner

Maybe include\cairo-features.h in the zipfile contains the info you're looking for?

@stuaxo stuaxo changed the title What features are enabled Enable Tee Surface ? Aug 21, 2020
@stuaxo
Copy link
Contributor Author

stuaxo commented Aug 21, 2020

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

@preshing
Copy link
Owner

I guess it's a matter of adding --enable-tee somewhere?

@stuaxo
Copy link
Contributor Author

stuaxo commented Aug 25, 2020

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

@naveen521kk
Copy link

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

@stuaxo
Copy link
Contributor Author

stuaxo commented Aug 27, 2020

Thanks - I'll try it when I next get a bit of time - I'm on VS2017 now so should be more straightforward.

@naveen521kk
Copy link

@stuaxo or @preshing Have you tried the one I told?

@stuaxo
Copy link
Contributor Author

stuaxo commented Aug 28, 2020

I should be able to try it later, but not going to have time to work on it until at least 9PM BST

@naveen521kk
Copy link

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

@preshing
Copy link
Owner

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.

@naveen521kk
Copy link

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.

@naveen521kk
Copy link

naveen521kk commented Aug 30, 2020

@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

@stuaxo
Copy link
Contributor Author

stuaxo commented Aug 30, 2020

Impressive work, I'll catch up on all this later and have a proper look :)

@naveen521kk
Copy link

@stuaxo Can the tee surface work be merged in master?

@stuaxo
Copy link
Contributor Author

stuaxo commented Sep 1, 2020

Yes, I tested the pycairo wheel that uses this in a fresh install of python, so LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants