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

fix transparency on macOS #262

Closed
wants to merge 1 commit into from

Conversation

jrmoulton
Copy link

https://developer.apple.com/documentation/coregraphics/cgimagealphainfo?language=objc

For supporting transparent windows on maOS this is all that is required. I've seen #241 which is adding alpha and it looks significantly more complicated. I might be missing why it is so complicated but this does work and I don't see why it should be any more complicated. I've tested it with tiny_skia.

Using PremultipliedFirst instead of Last because that is consistent with the where the color channels are currently stored.

@madsmtm
Copy link
Member

madsmtm commented Feb 28, 2025

Pre-multiplied is probably wrong for ARGB, should just be First.

Also, this would be incompatible with our docs and other platforms, we tell you to fill the opacity with 0, which means that with this change, the window would become completely transparent on macOS. While I'm all for progressive forward progress, I can't accept this PR as-is, sorry :/.

@madsmtm madsmtm closed this Feb 28, 2025
@madsmtm madsmtm added the CoreGraphics macOS/iOS/tvOS/watchOS/visionOS backend label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CoreGraphics macOS/iOS/tvOS/watchOS/visionOS backend
Development

Successfully merging this pull request may close these issues.

2 participants