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