Use the maximum potential headroom if EDR content isn't currently being displayed.
Also document that the HDR properties can change dynamically at runtime.
This commit is contained in:
@@ -299,7 +299,11 @@ static void Cocoa_GetHDRProperties(CGDirectDisplayID displayID, SDL_HDRDisplayPr
|
||||
if (@available(macOS 10.15, *)) {
|
||||
NSScreen *screen = GetNSScreenForDisplayID(displayID);
|
||||
if (screen) {
|
||||
HDR->HDR_headroom = screen.maximumExtendedDynamicRangeColorComponentValue;
|
||||
if (screen.maximumExtendedDynamicRangeColorComponentValue > 1.0f) {
|
||||
HDR->HDR_headroom = screen.maximumExtendedDynamicRangeColorComponentValue;
|
||||
} else {
|
||||
HDR->HDR_headroom = screen.maximumPotentialExtendedDynamicRangeColorComponentValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -247,7 +247,11 @@ int UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event)
|
||||
|
||||
#ifndef SDL_PLATFORM_TVOS
|
||||
if (@available(iOS 16.0, *)) {
|
||||
display.HDR.HDR_headroom = uiscreen.currentEDRHeadroom;
|
||||
if (uiscreen.currentEDRHeadroom > 1.0f) {
|
||||
display.HDR.HDR_headroom = uiscreen.currentEDRHeadroom;
|
||||
} else {
|
||||
display.HDR.HDR_headroom = uiscreen.potentialEDRHeadroom;
|
||||
}
|
||||
}
|
||||
#endif /* !SDL_PLATFORM_TVOS */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user