mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-22 15:22:02 +00:00
[client] egl: compose native PQ output in linear light
Decode PQ/BT.2020 desktop pixels into an FP16 linear scRGB target before compositing the color cursor, ImGui, damage overlay, and letterboxing. Encode the damaged result to PQ once at the surface boundary. Keep logical AND/XOR cursor masks in the encoded domain. This preserves premultiplied cursor edges, prevents encoded-domain blending, uses the Wayland output reference white for local overlays, and keeps guest cursor white and display calibration independent from frame SDR white. It also corrects HDR-to-SDR absolute luminance scaling, gamut matrices, black handling, and buffer-age repair for the extra pass. Suppress overlays when their conversion framebuffer is unavailable rather than allowing unconverted sRGB draws into an HDR target. Use named transfer constants for cursor shader state. Convert clipped surface rectangles explicitly before using the frame-damage merge helper, which avoids mixing its unsigned type with the EGL surface rectangle type. Only advertise native PQ when the FP16 composition target is available. SDR and native scRGB retain their direct single-pass paths.
This commit is contained in:
@@ -25,7 +25,8 @@
|
||||
#include "egl.h"
|
||||
#include "desktop_rects.h"
|
||||
|
||||
typedef struct EGL_Desktop EGL_Desktop;
|
||||
typedef struct EGL_Desktop EGL_Desktop;
|
||||
typedef struct EGL_Framebuffer EGL_Framebuffer;
|
||||
|
||||
enum EGL_DesktopScaleType
|
||||
{
|
||||
@@ -42,7 +43,10 @@ bool egl_desktopInit(EGL * egl, EGL_Desktop ** desktop, EGLDisplay * display,
|
||||
void egl_desktopFree(EGL_Desktop ** desktop);
|
||||
|
||||
void egl_desktopConfigUI(EGL_Desktop * desktop);
|
||||
void egl_desktopSetNativeHDR(EGL_Desktop * desktop, bool nativeHDR);
|
||||
void egl_desktopSetNativeHDR(EGL_Desktop * desktop, bool nativeHDR,
|
||||
bool linearComposition);
|
||||
void egl_desktopGetHDRMapping(EGL_Desktop * desktop, bool * enabled,
|
||||
float * gain, float * contentPeak);
|
||||
bool egl_desktopSetup (EGL_Desktop * desktop, const LG_RendererFormat format);
|
||||
bool egl_desktopUpdate(EGL_Desktop * desktop, const FrameBuffer * frame, int dmaFd,
|
||||
const FrameDamageRect * damageRects, int damageRectsCount);
|
||||
@@ -51,7 +55,7 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
|
||||
unsigned int outputHeight, const float x, const float y,
|
||||
const float scaleX, const float scaleY, enum EGL_DesktopScaleType scaleType,
|
||||
LG_RendererRotate rotate, const struct DamageRects * rects,
|
||||
bool * fullFrame);
|
||||
bool * fullFrame, EGL_Framebuffer * target);
|
||||
|
||||
void egl_desktopSpiceConfigure(EGL_Desktop * desktop, int width, int height);
|
||||
void egl_desktopSpiceDrawFill(EGL_Desktop * desktop, int x, int y, int width,
|
||||
|
||||
Reference in New Issue
Block a user