WebKit
WebKit copied to clipboard
Adopt CADisplayLink on macOS 14
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
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/7f1f133766b8324d6a6c27ca652bdd2180746e3a)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/b4a2369580c8d20bdc01e912b6d4b3cc842f13c9)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/297d23ea40e604555e8aaf78003ca1d33367558d)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/88d09e063f873a3a9f8a5dbf334ae4f58492576f)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/5ff129e9a21af879c509d4c0f5eebddccb5939ed)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/a7bf94e211f9395897250ae848a7a139ff2d02e1)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/6eded8dc3ee4c4201b4a2b209620bcd3f4034b88)
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.
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