[webkit-changes] [WebKit/WebKit] 51bff5: Do some cleanup around screenPropertiesStateChange...

Simon Fraser noreply at github.com
Fri Jan 27 09:25:48 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 51bff517ffd151c5658c279a5ca289ff2b785f95
      https://github.com/WebKit/WebKit/commit/51bff517ffd151c5658c279a5ca289ff2b785f95
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2023-01-27 (Fri, 27 Jan 2023)

  Changed paths:
    M Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Source/WebKit/UIProcess/WebProcessPool.h
    M Source/WebKit/UIProcess/mac/DisplayLink.cpp
    M Source/WebKit/UIProcess/mac/DisplayLink.h
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm

  Log Message:
  -----------
  Do some cleanup around screenPropertiesStateChanged() and displayReconfigurationCallBack()
https://bugs.webkit.org/show_bug.cgi?id=251233
rdar://104719183

Reviewed by Tim Horton.

WebProcessPool had both screenPropertiesStateChanged() and code in displayReconfigurationCallBack()
that did similar things, sending new screen properties to the WebProcess and, on macOS, the GPU process,
but the code was scattered around.

Clean it up by moving the code in displayReconfigurationCallBack() into a WebProcessPool member function;
this callback tells you about a specific display and what changed, but in it we gather properties for
all displays, but keep that behavior for now.

screenPropertiesStateChanged() is called via accessibility callbacks that indicate that screen-related
settings like "invert colors" changed. To show its relationship to WebProcessPool::displayPropertiesChanged()
put the two functions next to each other, but it was tricky to share code because this callback doesn't
get a displayID.

Add a DisplayLink::displayPropertiesChanged() stub that will be implemented in a future patch.

* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::screenPropertiesChanged):
(WebKit::WebProcessPool::displayPropertiesChanged):
(WebKit::displayReconfigurationCallBack):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::accessibilitySettingsDidChange):
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::screenPropertiesStateChanged): Deleted.
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::displayPropertiesChanged):
* Source/WebKit/UIProcess/mac/DisplayLink.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::screenDidChangeColorSpace):

Canonical link: https://commits.webkit.org/259495@main




More information about the webkit-changes mailing list