mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-16 04:12:03 +00:00
[client] wayland: implement HDR support
This commit is contained in:
committed by
Geoffrey McRae
parent
28973ac4b1
commit
364485ded8
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/option.h"
|
||||
#include "interface/renderer.h"
|
||||
|
||||
#include "dynamic/wayland_desktops.h"
|
||||
|
||||
@@ -143,6 +144,9 @@ static bool waylandInit(const LG_DSInitParams params)
|
||||
if (!waylandRegistryInit())
|
||||
return false;
|
||||
|
||||
if (!waylandColorMgmtInit())
|
||||
return false;
|
||||
|
||||
if (!waylandActivationInit())
|
||||
return false;
|
||||
|
||||
@@ -189,6 +193,7 @@ static void waylandFree(void)
|
||||
waylandPresentationFree();
|
||||
waylandInputFree();
|
||||
waylandOutputFree();
|
||||
waylandColorMgmtFree();
|
||||
waylandRegistryFree();
|
||||
waylandCursorFree();
|
||||
wl_display_disconnect(wlWm.display);
|
||||
@@ -202,6 +207,12 @@ static bool waylandGetProp(LG_DSProperty prop, void * ret)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (prop == LG_DS_NATIVE_HDR)
|
||||
{
|
||||
*(bool *)ret = wlWm.cmCanDoHDR;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -227,6 +238,22 @@ static void waylandMinimize(void)
|
||||
wlWm.desktop->minimize();
|
||||
}
|
||||
|
||||
static bool waylandHDRCallback(const void * rendererFormat)
|
||||
{
|
||||
if (!wlWm.colorManager)
|
||||
return false;
|
||||
|
||||
const LG_RendererFormat * format = (const LG_RendererFormat *)rendererFormat;
|
||||
if (format->hdr)
|
||||
return waylandRequestHDR(format->hdrDisplayPrimary, format->hdrWhitePoint,
|
||||
format->hdrMaxDisplayLuminance, format->hdrMinDisplayLuminance,
|
||||
format->hdrMaxContentLightLevel, format->hdrMaxFrameAverageLightLevel,
|
||||
format->hdrPQ);
|
||||
else
|
||||
waylandRequestClearHDR();
|
||||
return true;
|
||||
}
|
||||
|
||||
struct LG_DisplayServerOps LGDS_Wayland =
|
||||
{
|
||||
.name = "Wayland",
|
||||
@@ -276,6 +303,8 @@ struct LG_DisplayServerOps LGDS_Wayland =
|
||||
.getFullscreen = waylandGetFullscreen,
|
||||
.minimize = waylandMinimize,
|
||||
|
||||
.setHDRImageDescription = waylandHDRCallback,
|
||||
|
||||
.cbInit = waylandCBInit,
|
||||
.cbNotice = waylandCBNotice,
|
||||
.cbRelease = waylandCBRelease,
|
||||
|
||||
Reference in New Issue
Block a user