[client] egl: invalidate the window when HDR settings are changed

This commit is contained in:
Geoffrey McRae 2023-10-24 13:46:51 +11:00
parent 54066094bd
commit eeea24ebfb

View file

@ -288,13 +288,27 @@ void egl_desktopConfigUI(EGL_Desktop * desktop)
igSliderInt("##nvgain", &desktop->nvGain, 0, desktop->nvMax, format, 0); igSliderInt("##nvgain", &desktop->nvGain, 0, desktop->nvMax, format, 0);
igPopItemWidth(); igPopItemWidth();
bool mapHDRtoSDR = desktop->mapHDRtoSDR;
int peakLuminance = desktop->peakLuminance;
int maxCLL = desktop->maxCLL;
igSeparator(); igSeparator();
igCheckbox("Map HDR content to SDR", &desktop->mapHDRtoSDR); igCheckbox("Map HDR content to SDR", &mapHDRtoSDR);
igSliderInt("Peak Luminance", &desktop->peakLuminance, 1, 10000, igSliderInt("Peak Luminance", &peakLuminance, 1, 10000,
"%d nits", "%d nits",
ImGuiInputTextFlags_CharsDecimal); ImGuiInputTextFlags_CharsDecimal);
igSliderInt("Max content light level", &desktop->maxCLL, 1, 10000, igSliderInt("Max content light level", &maxCLL, 1, 10000,
"%d nits", ImGuiInputTextFlags_CharsDecimal); "%d nits", ImGuiInputTextFlags_CharsDecimal);
if (mapHDRtoSDR != desktop->mapHDRtoSDR ||
peakLuminance != desktop->peakLuminance ||
maxCLL != desktop->maxCLL)
{
desktop->mapHDRtoSDR = mapHDRtoSDR;
desktop->peakLuminance = max(1, peakLuminance);
desktop->maxCLL = max(1, maxCLL);
app_invalidateWindow(true);
}
} }
bool egl_desktopSetup(EGL_Desktop * desktop, const LG_RendererFormat format) bool egl_desktopSetup(EGL_Desktop * desktop, const LG_RendererFormat format)