19 Commits

Author SHA1 Message Date
Mitchell Hashimoto
5ad8ea6b22 pkg/macos: clean up for Zig 0.14, consolidate C imports into one decl
Fixes #6727

The major change in this commit is to consolidate all the C imports in
a single decl in main.zig. This is required for Zig 0.14. Without it,
the problem in #6727 will happen. I was never able to minimize why this
happens in order to open a Zig bug.

Beyond this, I fixed the build.zig and build.zig.zon to work with Zig
0.14 so that we can test building `pkg/macos` in isolation. There are no
downstream impacting changes in the build.zig files.
2025-03-15 07:02:53 -07:00
Qwerasd
fca336c32d Metal: blend in Display P3 color space, add option for linear blending
This commit is quite large because it's fairly interconnected and can't
be split up in a logical way. The main part of this commit is that alpha
blending is now always done in the Display P3 color space, and depending
on the configured `window-colorspace` colors will be converted from sRGB
or assumed to already be Display P3 colors. In addition, a config option
`text-blending` has been added which allows the user to configure linear
blending (AKA "gamma correction"). Linear alpha blending also applies to
images and makes custom shaders receive linear colors rather than sRGB.

In addition, an experimental option has been added which corrects linear
blending's tendency to make dark text look too thin and bright text look
too thick. Essentially it's a correction curve on the alpha channel that
depends on the luminance of the glyph being drawn.
2025-01-13 13:50:29 -08:00
Mitchell Hashimoto
318dc85c02 pkg/macos: yeet more usingns 2024-08-16 16:50:41 -07:00
Mitchell Hashimoto
a4c05e4a32 pkg/macos: graphics usingns yeet 2024-08-16 16:38:04 -07:00
Mitchell Hashimoto
0a718ec3eb pkg/macos: do not use bitCast through a function
workaround Zig issue: https://github.com/ziglang/zig/issues/16290
2023-07-01 13:38:10 -07:00
Mitchell Hashimoto
a74e49833b coretext: colored glyph rendering 2023-07-01 09:23:40 -07:00
Mitchell Hashimoto
552a1b51d0 coretext: rasterization looking cleaner 2023-07-01 09:23:39 -07:00
Mitchell Hashimoto
314f9287b1 Update Zig (#164)
* update zig

* pkg/fontconfig: clean up @as

* pkg/freetype,harfbuzz: clean up @as

* pkg/imgui: clean up @as

* pkg/macos: clean up @as

* pkg/pixman,utf8proc: clean up @as

* clean up @as

* lots more @as cleanup

* undo flatpak changes

* clean up @as
2023-06-30 12:15:31 -07:00
Mitchell Hashimoto
56f8e39e5b Update zig, mach, fmt 2023-06-25 11:08:20 -07:00
Mitchell Hashimoto
1e23779337 pkg/macos: more stuff 2022-10-10 09:03:03 -07:00
Mitchell Hashimoto
1cf390729e pkg/macos: bitmap info arg 2022-10-09 16:29:19 -07:00
Mitchell Hashimoto
1b7bc052d4 font: coretext calculate cell metrics 2022-10-09 10:57:19 -07:00
Mitchell Hashimoto
cc14344bf8 pkg/macos: path 2022-10-08 17:39:25 -07:00
Mitchell Hashimoto
833fd0e49a pkg/macos: bounding rects for text 2022-10-07 21:23:34 -07:00
Mitchell Hashimoto
67bb68b39f pkg/macos: RGB color space 2022-10-07 21:07:11 -07:00
Mitchell Hashimoto
c48ddcecd7 pkg/macos: font draw glyphs 2022-10-07 21:04:30 -07:00
Mitchell Hashimoto
61955c5d8d pkg/macos: CGContext 2022-10-07 20:56:24 -07:00
Mitchell Hashimoto
ca7f3647ff pkg/macos: CGColorSpace 2022-10-07 17:59:52 -07:00
Mitchell Hashimoto
791739de9c pkg/macos: font initializes, get glyphs 2022-10-01 21:49:02 -07:00