Mac: Fix over-saturated colors on P3 displays (e.g. the 2016 MBPs).
authorAlex Szpakowski <slime73@gmail.com>
Fri, 23 Dec 2016 22:08:18 -0400
changeset 10718e5b39f4935c8
parent 10717 73143fb45db3
child 10719 3a847ed9f8b1
Mac: Fix over-saturated colors on P3 displays (e.g. the 2016 MBPs).
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Fri Dec 23 20:36:24 2016 +0100
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Dec 23 22:08:18 2016 -0400
     1.3 @@ -1276,6 +1276,13 @@
     1.4      [nswindow setContentView:contentView];
     1.5      [contentView release];
     1.6  
     1.7 +    /* The app's content is likely authored expecting sRGB output. If we don't
     1.8 +     * specify the window's color space, it will default to the device color
     1.9 +     * space, which will be P3 on capable displays. The mismatch causes the
    1.10 +     * content authored in sRGB to appear extremely saturated on the P3 display.
    1.11 +     */
    1.12 +    [nswindow setColorSpace:[NSColorSpace sRGBColorSpace]];
    1.13 +
    1.14      /* Allow files and folders to be dragged onto the window by users */
    1.15      [nswindow registerForDraggedTypes:[NSArray arrayWithObject:(NSString *)kUTTypeFileURL]];
    1.16