Commit Graph

3169 Commits

Author SHA1 Message Date
Thomas A
6b006c021b Fix implicit-function-declaration 2023-06-19 11:30:55 -07:00
Thomas A
b30c2be791 Change include from CoreServices to CarbonCore 2023-04-16 13:47:48 -07:00
Ariel Abreu
3c656d84f5
[mtl] Only require texture memory to be host-visible if it's not framebuffer-only 2023-04-11 08:16:16 -04:00
Ariel Abreu
c449e7608e
Make Metal an optional part of the build
See the corresponding commit in the main repo
2023-04-06 10:04:50 -04:00
Ariel Abreu
96122cff43
Use Indium's DynamicVK to load Vulkan functions dynamically
This allows us to link to Vulkan dynamically at runtime (via Indium).
2023-04-06 10:04:50 -04:00
Ariel Abreu
6afea83f6c
[mtl-layer] Fix some lock issues with queued drawables 2023-04-06 10:04:49 -04:00
Ariel Abreu
ccf32c6281
Ensure objc presented handlers are invoked
Previously, they would only be invoked if the `present` method was
invoked directly on the objc drawable object.
2023-04-06 10:04:49 -04:00
Ariel Abreu
c99fc73ebd
Fix huge memory leak
This fixes the massive memory leak that was presented with the old code
that could cause the memory usage to reach over 2GiB in under 5 seconds
(while running at 60fps). There still seems to be another memory leak
present, but it's much smaller by comparison (increases by about 0.3MiB
every second when running at 60fps).
2023-04-06 10:04:49 -04:00
Ariel Abreu
55bafce1f1
Initial support for Metal layers and drawables
In its current state, I consider this code to be experimental and
unstable. The biggest problem is that there's currently a HUGE memory
leak somewhere (over 2GiB in under 5 seconds at 60fps). I'm committing
what I have now since I don't feel like debugging that right now and it
*does* technically work as-is.

The current approach is not great for performance: first, we render to a Metal/Vulkan
texture in the desired format then blit that to an RGBA Metal/Vulkan
texture shared with
OpenGL. Then, we copy *that* to another OpenGL texture in CAMetalLayer
to use as the content for the layer (we can't keep the drawable's OpenGL
texture, since that has to be recycled). Finally, this is rendered to a
subwindow by CARenderer/CALayerContext. We cannot get rid of the last copy
since we must render to the subwindow somehow and it's the easiest
way to play nice with sublayers. I also don't think we can get rid of the
first copy since OpenGL doesn't support some of Metal/Vulkan's texture
formats; plus, we can't share optimally tiled images between Vulkan and
OpenGL with some vendors' drivers (e.g. AMD).
We *could* get rid of the second copy if we were able to accurately
determine when the content is finally presented; then we could simply
keep the drawable in-use, render it to the subwindow when asked to, and
release it once we know the render is complete.
2023-04-06 10:04:49 -04:00
Thomas A
3159ee117c Fix "parameter name omitted" For CGWindowLevelForKey. Add Note About CGWindowLevel. 2023-03-29 09:15:52 -07:00
Thomas A
624da5b8e1 Replace nil with kCGErrorSuccess
Fixes Building
2023-03-27 11:23:05 -07:00
CuriousTommy
4ea39ed10d
Merge pull request #26 from genkiinstruments/coretext-missing-symbols
Add some stubs for missing symbols in CoreText
2023-03-27 10:14:32 -07:00
Daniel Gretarsson
b001b467d5 Use NS_ENUM for added enums in CoreText 2023-03-27 10:25:05 +00:00
Daniel Gretarsson
ccd8c204e1 Add some stubs for missing symbols in CoreText 2023-03-27 10:25:05 +00:00
CuriousTommy
a72fb066cd
Merge pull request #25 from genkiinstruments/coregraphics-missing-symbols
Add some stubs and missing symbols for CoreGraphics
2023-03-26 10:27:35 -07:00
Daniel Gretarsson
90c9369964 Use CF_ENUM on new enums in CoreGraphics 2023-03-26 14:23:02 +00:00
CuriousTommy
520c4c91a9
Merge pull request #27 from genkiinstruments/appkit-missing-symbols
Add missing symbols and stubs for AppKit
2023-03-26 06:17:20 -07:00
Daniel Gretarsson
6ee777f377 Add printf to stubs in NSAccessibility.m and NSPasteboard.m 2023-03-26 13:11:29 +00:00
Daniel Gretarsson
c1b75488c7 Add missing symbols and stubs for AppKit 2023-03-20 12:05:35 +00:00
Daniel Gretarsson
2691295544 Add some stubs and missing symbols for CoreGraphics 2023-03-20 10:59:27 +00:00
Thomas A
aaa486783e Add CGDisplayModeGetPixelWidth Stub 2023-03-17 19:51:54 -07:00
Juan Patricio
4f29ff5b7d
Fix button leak 2023-02-23 17:59:16 -03:00
Juan Patricio
aba55454af
Moved addButtonWithTitle/_addButtonWithTitle definition before its usage, fixed formatting and typo 2023-02-23 15:51:17 -03:00
Juan Patricio
4a75b8cbc7
NSInteger-ization of NSAlert.m
See darlinghq/darling#418
2023-02-23 13:47:21 -03:00
Juan Patricio
2b0caf2f51
Fixed return code for alets created with alertWithMessageText
Those types of alerts have a different set of NSModalResponse.

This fix alerts not working in The Blockheads Server and any other app also using that method.
2023-02-23 13:45:08 -03:00
CuriousTommy
1af135a557
Merge pull request #23 from juanmuscaria/master
Added missing method implementations for NSMenuView optimization
2022-11-20 21:31:59 -08:00
Thomas A
f2a7267dca Remove duplicate "usesSingleLineMode" stub 2022-11-20 10:50:03 -08:00
Thomas A
e78da59d44 Fix NSCell "usesSingleLineMode" typo 2022-11-20 10:36:08 -08:00
Thomas A
e00b4468c4 Fix int-conversion error 2022-11-20 10:30:36 -08:00
Juan Patricio
afbfeabeb4
Added missing method implementations for NSMenuView optimization 2022-11-18 13:23:08 -03:00
CuriousTommy
b22b56f497
Merge pull request #22 from darlinghq/gen_developer_sdk
Generate SDK Headers
2022-09-05 20:16:27 -07:00
Thomas A
19b47b890d Generate Headers for AppKit, Cocoa, CoreData, CoreGraphics, CoreText, Onyx2D, and QuartzCore 2022-09-04 10:58:40 -07:00
Lubos Dolezel
d18eb37843
Add cache for NSStringDrawer, it's a hot path and it's slow to recalculate every time 2022-04-22 16:46:19 +02:00
Lubos Dolezel
8aa99376f4
NSMenuView optimizations to speed things up a bit 2022-04-22 16:45:29 +02:00
Lubos Dolezel
3b8960eb56
Cache the screen list information, it's a very frequent call 2022-04-22 16:44:06 +02:00
Ariel Abreu
7edb4834c7
Linking with libelfloader is no longer necessary 2021-12-16 11:40:59 -05:00
Ariel Abreu
d7cc4e3ff1
Partially implement orderFrontRegardless
"Partially" because I'm almost certain that it needs more than just what `orderFront:` does. But this is good enough for now (certainly better than doing nothing).
2021-07-04 18:04:15 -04:00
Ariel Abreu
16206c19e0
Add/fix lots of protocols and type definitions 2021-06-28 23:30:34 -04:00
Ariel Abreu
daaca1710c
Fix out-of-bounds access in -[O2Font_freetype initWIthFace:] 2021-06-13 09:17:36 -04:00
Andrew Hyatt
455320e98a
Merge pull request #17 from TheBrokenRail/add-more-nscolor
Add ``+[NSColor colorWithSRGBRed]`` And ``+[NSColor colorWithRed]``
2021-06-05 17:30:07 -04:00
Andrew Hyatt
b657fbb7f1
Merge pull request #18 from TheBrokenRail/stub-nstabview
Stub ``-[NSTabView tabPosition]``
2021-06-05 17:29:27 -04:00
Andrew Hyatt
3e3683f47b
Merge pull request #21 from TheBrokenRail/fix-nsdocumentcontroller
Fix Occasional Segfaults And Add Fallback Error Message To NSDocumentController
2021-06-05 17:29:09 -04:00
Andrew Hyatt
0d5be97671
Merge pull request #16 from TheBrokenRail/fix-nsalert
Fix ``NSAlert`` Sheet Opening And Closing
2021-06-05 17:27:26 -04:00
Andrew Hyatt
f844b0df51
Merge pull request #14 from TheBrokenRail/patch-5
Add More CoreText Constants
2021-06-05 17:26:14 -04:00
Ariel Abreu
bfef2fdab3
Merge pull request #9 from TheBrokenRail/remove-unused-code
Removed Unused Code
2021-05-29 16:31:34 -04:00
TheBrokenRail
7bdbaafb1c Fix Occasional Segfaults And Add Fallback Error Message To NSDocumentController 2021-05-27 22:32:29 -04:00
TheBrokenRail
a2b422b399 Stub -[NSTabView tabPosition] 2021-05-26 18:01:26 -04:00
TheBrokenRail
fa01855933 Add +[NSColor colorWithRed] 2021-05-26 17:28:47 -04:00
TheBrokenRail
b21618f5d2 Add +[NSColor colorWithSRGBRed] 2021-05-26 17:19:29 -04:00
TheBrokenRail
6d21bda33b Fix NSAlert Sheet Opening And Closing 2021-05-26 16:35:05 -04:00