[plasma/kwin] src/wayland: wayland/colormanagement: add support for Windows BT2100 image descriptions
Xaver Hugl <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 49592c5593a69d117f05ffd62d6b66b9a1032890 by Xaver Hugl.
Committed on 30/07/2026 at 14:13.
Pushed by zamundaaa into branch 'master'.
wayland/colormanagement: add support for Windows BT2100 image descriptions
Just like with scRGB, Windows apps treat BT2100 differently from how native
Wayland applications (are supposed to) behave.
As we already have all the special handling for Windows apps, this just
implements the request and nothing else needs to be changed.
M +19 -1 src/wayland/colormanagement_v1.cpp
M +1 -0 src/wayland/colormanagement_v1.h
https://invent.kde.org/plasma/kwin/-/commit/49592c5593a69d117f05ffd62d6b66b9a1032890
diff --git a/src/wayland/colormanagement_v1.cpp b/src/wayland/colormanagement_v1.cpp
index 0b7ccb1ee9e..c237f745dde 100644
--- a/src/wayland/colormanagement_v1.cpp
+++ b/src/wayland/colormanagement_v1.cpp
@@ -16,7 +16,7 @@ namespace KWin
ColorManagerV1::ColorManagerV1(Display *display, QObject *parent)
: QObject(parent)
- , QtWaylandServer::wp_color_manager_v1(*display, 2)
+ , QtWaylandServer::wp_color_manager_v1(*display, 3)
{
}
@@ -28,6 +28,9 @@ void ColorManagerV1::wp_color_manager_v1_bind_resource(Resource *resource)
send_supported_feature(resource->handle, feature::feature_set_primaries);
send_supported_feature(resource->handle, feature::feature_set_luminances);
send_supported_feature(resource->handle, feature::feature_windows_scrgb);
+ if (resource->version() >= 3) {
+ send_supported_feature(resource->handle, feature::feature_windows_bt2100);
+ }
send_supported_primaries_named(resource->handle, primaries::primaries_srgb);
send_supported_primaries_named(resource->handle, primaries::primaries_pal_m);
@@ -112,6 +115,21 @@ void ColorManagerV1::wp_color_manager_v1_create_windows_scrgb(Resource *resource
ImageDescriptionV1::createReady(resource->client(), image_description, resource->version(), scrgb, ColorDescriptionType::Windows);
}
+void ColorManagerV1::wp_color_manager_v1_create_windows_bt2100(Resource *resource, uint32_t image_description)
+{
+ const auto bt2100 = std::make_shared<ColorDescription>(ColorDescription{
+ Colorimetry::BT2020,
+ TransferFunction(TransferFunction::PerceptualQuantizer, 0.005, 10'000),
+ 203,
+ 0,
+ std::nullopt,
+ std::nullopt,
+ Colorimetry::BT2020,
+ Colorimetry::BT709,
+ });
+ ImageDescriptionV1::createReady(resource->client(), image_description, resource->version(), bt2100, ColorDescriptionType::Windows);
+}
+
ColorFeedbackSurfaceV1::ColorFeedbackSurfaceV1(wl_client *client, uint32_t id, uint32_t version, SurfaceInterface *surface)
: QtWaylandServer::wp_color_management_surface_feedback_v1(client, id, version)
, m_surface(surface)
diff --git a/src/wayland/colormanagement_v1.h b/src/wayland/colormanagement_v1.h
index 18a279c0c9e..9fb26938f9e 100644
--- a/src/wayland/colormanagement_v1.h
+++ b/src/wayland/colormanagement_v1.h
@@ -34,6 +34,7 @@ private:
void wp_color_manager_v1_create_icc_creator(Resource *resource, uint32_t obj) override;
void wp_color_manager_v1_create_parametric_creator(Resource *resource, uint32_t obj) override;
void wp_color_manager_v1_create_windows_scrgb(Resource *resource, uint32_t image_description) override;
+ void wp_color_manager_v1_create_windows_bt2100(Resource *resource, uint32_t image_description) override;
};
class ColorFeedbackSurfaceV1 : private QtWaylandServer::wp_color_management_surface_feedback_v1