Changeset 245392 in webkit


Ignore:
Timestamp:
May 16, 2019 2:22:22 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Updated screenHasInvertedColors to use AppKit when available
https://bugs.webkit.org/show_bug.cgi?id=197935
<rdar://problem/50834405>

Patch by Greg Hughes <ghughes@apple.com> on 2019-05-16
Reviewed by Chris Fleizach.

  • platform/mac/PlatformScreenMac.mm:

(WebCore::collectScreenProperties):
(WebCore::screenHasInvertedColors):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245375 r245392  
     12019-05-16  Greg Hughes  <ghughes@apple.com>
     2
     3        Updated screenHasInvertedColors to use AppKit when available
     4        https://bugs.webkit.org/show_bug.cgi?id=197935
     5        <rdar://problem/50834405>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        * platform/mac/PlatformScreenMac.mm:
     10        (WebCore::collectScreenProperties):
     11        (WebCore::screenHasInvertedColors):
     12
    1132019-05-15  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm

    r236148 r245392  
    113113
    114114    ScreenProperties screenProperties;
     115    bool screenHasInvertedColors = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldInvertColors];
    115116
    116117    for (NSScreen *screen in [NSScreen screens]) {
     
    125126        int screenDepthPerComponent = NSBitsPerSampleFromDepth(screen.depth);
    126127        bool screenSupportsExtendedColor = [screen canRepresentDisplayGamut:NSDisplayGamutP3];
    127         bool screenHasInvertedColors = CGDisplayUsesInvertedPolarity();
    128128        bool screenIsMonochrome = CGDisplayUsesForceToGray();
    129129        uint32_t displayMask = CGDisplayIDToOpenGLDisplayMask(displayID);
     
    257257    // This is a system-wide accessibility setting, same on all screens.
    258258    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
    259     return CGDisplayUsesInvertedPolarity();
     259    return [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldInvertColors];
    260260}
    261261
Note: See TracChangeset for help on using the changeset viewer.