WebKit icon indicating copy to clipboard operation
WebKit copied to clipboard

Adopt CADisplayLink on macOS 14

Open graouts opened this issue 9 months ago โ€ข 2 comments

b4a2369580c8d20bdc01e912b6d4b3cc842f13c9

Adopt CADisplayLink on macOS 14
https://bugs.webkit.org/show_bug.cgi?id=274268
rdar://119217720

Reviewed by NOBODY (OOPS!).

The CADisplayLink API is newly available on macOS 14. We add a new `HAVE(CA_DISPLAY_LINK_MAC)`
directive and if it's not available, use a legacy codepath where `CVDisplayLink` is used instead,
in `LegacyDisplayLinkMac.cpp`, and when available use `CADisplayLink` in `DisplayLinkMac.mm`.

In order to preserve a similar behavior to `CVDisplayLink`, we spawn a dedicated thread for each
`CADisplayLink`. Note that on macOS, the creation of a `CADisplayLink` is done through `NSScreen`,
so we also export the `WebCore::screen()` method to be able to get the appropriate `NSScreen` for
a given `DisplayLink` instance.

* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h:
* Source/WebCore/platform/PlatformScreen.h:
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/DisplayLink.h:
* Source/WebKit/UIProcess/mac/DisplayLinkMac.mm: Added.
(-[WKDisplayLinkHandler initWithScreen:client:]):
(-[WKDisplayLinkHandler threadWasCreated]):
(-[WKDisplayLinkHandler dealloc]):
(-[WKDisplayLinkHandler displayLinkFired:]):
(-[WKDisplayLinkHandler invalidate]):
(-[WKDisplayLinkHandler isRunning]):
(-[WKDisplayLinkHandler setRunning:]):
(-[WKDisplayLinkHandler nominalFramesPerSecond]):
(WebKit::DisplayLink::platformInitialize):
(WebKit::DisplayLink::platformFinalize):
(WebKit::DisplayLink::platformIsRunning const):
(WebKit::DisplayLink::platformStart):
(WebKit::DisplayLink::platformStop):
(WebKit::DisplayLink::displayLinkHandlerCallbackFired):
* Source/WebKit/UIProcess/mac/LegacyDisplayLinkMac.cpp: Renamed from Source/WebKit/UIProcess/mac/DisplayLinkMac.cpp.
(WebKit::DisplayLink::platformInitialize):
(WebKit::DisplayLink::platformFinalize):
(WebKit::DisplayLink::nominalFramesPerSecondFromDisplayLink):
(WebKit::DisplayLink::platformIsRunning const):
(WebKit::DisplayLink::platformStart):
(WebKit::DisplayLink::platformStop):
(WebKit::DisplayLink::displayLinkCallback):
* Source/WebKit/UIProcess/mac/WKImmediateActionController.mm: Fix an include issue revealed by the addition of a new file.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

https://github.com/WebKit/WebKit/commit/b4a2369580c8d20bdc01e912b6d4b3cc842f13c9

Misc iOS, tvOS & watchOS macOS Linux Windows
โœ… ๐Ÿงช style โœ… ๐Ÿ›  ios โœ… ๐Ÿ›  mac โœ… ๐Ÿ›  wpe โœ… ๐Ÿ›  wincairo
โœ… ๐Ÿงช bindings โœ… ๐Ÿ›  ios-sim โœ… ๐Ÿ›  mac-AS-debug loading ๐Ÿงช wpe-wk2
โœ… ๐Ÿงช webkitperl โœ… ๐Ÿงช ios-wk2 โœ… ๐Ÿงช api-mac โŒ ๐Ÿงช api-wpe
loading ๐Ÿงช ios-wk2-wpt โœ… ๐Ÿงช mac-wk1 โณ ๐Ÿ›  wpe-skia
โœ… ๐Ÿ›  ๐Ÿงช jsc loading ๐Ÿงช api-ios โœ… ๐Ÿงช mac-wk2 โœ… ๐Ÿ›  gtk
โœ… ๐Ÿ›  ๐Ÿงช jsc-arm64 โœ… ๐Ÿ›  tv loading ๐Ÿงช mac-AS-debug-wk2 loading ๐Ÿงช gtk-wk2
โœ… ๐Ÿ›  tv-sim โœ… ๐Ÿงช mac-wk2-stress โณ ๐Ÿงช api-gtk
โœ… ๐Ÿ›  watch โœ… ๐Ÿ›  jsc-armv7
โœ… ๐Ÿ›  watch-sim โœ… ๐Ÿงช jsc-armv7-tests

graouts avatar May 16 '24 18:05 graouts

Starting EWS tests for https://github.com/WebKit/WebKit/commit/ceba405a91cf57e2251137408a5811430f007c66. Live statuses available at the PR page, https://github.com/WebKit/WebKit/pull/28665

Committed 279701@main (c206b6b473ad): https://commits.webkit.org/279701@main

Reviewed commits have been landed. Closing PR #28665 and removing active labels.

webkit-commit-queue avatar Jun 04 '24 16:06 webkit-commit-queue

Starting EWS tests for https://github.com/WebKit/WebKit/commit/ceba405a91cf57e2251137408a5811430f007c66. Live statuses available at the PR page, https://github.com/WebKit/WebKit/pull/28665