mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-15 20:02:05 +00:00
[client] wayland: fix color management errors
This commit is contained in:
@@ -26,6 +26,12 @@
|
||||
|
||||
#include "common/debug.h"
|
||||
|
||||
static void cmIntent(void * data, struct wp_color_manager_v1 * cm, uint32_t intent)
|
||||
{
|
||||
if (intent == WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL)
|
||||
wlWm.cmHasPerceptualIntent = true;
|
||||
}
|
||||
|
||||
static void cmFeature(void * data, struct wp_color_manager_v1 * cm, uint32_t feature)
|
||||
{
|
||||
switch (feature)
|
||||
@@ -78,7 +84,7 @@ static void cmDone(void * data, struct wp_color_manager_v1 * cm)
|
||||
}
|
||||
|
||||
static const struct wp_color_manager_v1_listener cmListener = {
|
||||
.supported_intent = NULL,
|
||||
.supported_intent = cmIntent,
|
||||
.supported_feature = cmFeature,
|
||||
.supported_tf_named = cmTFNamed,
|
||||
.supported_primaries_named = cmPrimariesNamed,
|
||||
|
||||
@@ -281,11 +281,12 @@ void waylandSetHDRImageDescription(const uint16_t displayPrimary[3][2],
|
||||
: WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR);
|
||||
|
||||
// Set luminance range from metadata (values already in 0.0001 cd/m² units)
|
||||
wp_image_description_creator_params_v1_set_luminances(
|
||||
wlWm.hdrImageCreator,
|
||||
minDisplayLuminance > 0 ? minDisplayLuminance : 50,
|
||||
maxDisplayLuminance > 0 ? maxDisplayLuminance : 10000000,
|
||||
hdrPQ ? 2030000 : 800000);
|
||||
if (wlWm.cmHasLuminances)
|
||||
wp_image_description_creator_params_v1_set_luminances(
|
||||
wlWm.hdrImageCreator,
|
||||
minDisplayLuminance > 0 ? minDisplayLuminance : 50,
|
||||
maxDisplayLuminance > 0 ? maxDisplayLuminance : 10000000,
|
||||
hdrPQ ? 2030000 : 800000);
|
||||
|
||||
// Set mastering display primaries from frame HDR metadata.
|
||||
// Always set when the compositor supports it, falling back to the
|
||||
|
||||
@@ -202,6 +202,7 @@ struct WaylandDSState
|
||||
bool cmHasTFExtLinear;
|
||||
bool cmHasPrimariesBT2020;
|
||||
bool cmHasPrimariesSRGB;
|
||||
bool cmHasPerceptualIntent;
|
||||
bool cmCanDoHDR; // true if compositor supports features needed for HDR
|
||||
|
||||
// Pending HDR format to apply (set by frame thread, applied in swap buffers).
|
||||
|
||||
Reference in New Issue
Block a user