Title: [245392] trunk/Source/WebCore
- Revision
- 245392
- Author
- [email protected]
- Date
- 2019-05-16 02:22:22 -0700 (Thu, 16 May 2019)
Log Message
Updated screenHasInvertedColors to use AppKit when available
https://bugs.webkit.org/show_bug.cgi?id=197935
<rdar://problem/50834405>
Patch by Greg Hughes <[email protected]> on 2019-05-16
Reviewed by Chris Fleizach.
* platform/mac/PlatformScreenMac.mm:
(WebCore::collectScreenProperties):
(WebCore::screenHasInvertedColors):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (245391 => 245392)
--- trunk/Source/WebCore/ChangeLog 2019-05-16 06:02:03 UTC (rev 245391)
+++ trunk/Source/WebCore/ChangeLog 2019-05-16 09:22:22 UTC (rev 245392)
@@ -1,3 +1,15 @@
+2019-05-16 Greg Hughes <[email protected]>
+
+ Updated screenHasInvertedColors to use AppKit when available
+ https://bugs.webkit.org/show_bug.cgi?id=197935
+ <rdar://problem/50834405>
+
+ Reviewed by Chris Fleizach.
+
+ * platform/mac/PlatformScreenMac.mm:
+ (WebCore::collectScreenProperties):
+ (WebCore::screenHasInvertedColors):
+
2019-05-15 Simon Fraser <[email protected]>
Avoid a recursive descendants layer walk sometimes
Modified: trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm (245391 => 245392)
--- trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm 2019-05-16 06:02:03 UTC (rev 245391)
+++ trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm 2019-05-16 09:22:22 UTC (rev 245392)
@@ -112,6 +112,7 @@
ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
ScreenProperties screenProperties;
+ bool screenHasInvertedColors = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldInvertColors];
for (NSScreen *screen in [NSScreen screens]) {
auto displayID = WebCore::displayID(screen);
@@ -124,7 +125,6 @@
int screenDepth = NSBitsPerPixelFromDepth(screen.depth);
int screenDepthPerComponent = NSBitsPerSampleFromDepth(screen.depth);
bool screenSupportsExtendedColor = [screen canRepresentDisplayGamut:NSDisplayGamutP3];
- bool screenHasInvertedColors = CGDisplayUsesInvertedPolarity();
bool screenIsMonochrome = CGDisplayUsesForceToGray();
uint32_t displayMask = CGDisplayIDToOpenGLDisplayMask(displayID);
IORegistryGPUID gpuID = 0;
@@ -256,7 +256,7 @@
// This is a system-wide accessibility setting, same on all screens.
ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
- return CGDisplayUsesInvertedPolarity();
+ return [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldInvertColors];
}
int screenDepth(Widget* widget)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes