summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.com>2024-02-28 15:16:52 +0200
committerPekka Paalanen <pq@iki.fi>2024-03-07 14:50:47 +0000
commit5223b8430e2e0bf3cc5d81b53ee4a09aebd4b83c (patch)
tree54818c5f7de025e285effa6b4fe5753d091118ed
parent4b9fa23ec6a3b2331fca5c88a3826ef9c8cd603a (diff)
color-lcms: move 3D LUT vs. blend-to-output assert
There is no reason why cmlcms_fill_in_3dlut() would not work for blend-to-output category, so the assert is a little misplaced. However, there would be a bug if 3D LUT was used for blend-to-output, because we should never fail to optimize that chain. Put the assert where it belongs. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
-rw-r--r--libweston/color-lcms/color-transform.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libweston/color-lcms/color-transform.c b/libweston/color-lcms/color-transform.c
index 8bd5ea44..f6ea18b8 100644
--- a/libweston/color-lcms/color-transform.c
+++ b/libweston/color-lcms/color-transform.c
@@ -132,9 +132,6 @@ cmlcms_fill_in_3dlut(struct weston_color_transform *xform_base,
unsigned int value_b, value_r, value_g;
float divider = len - 1;
- assert(xform->search_key.category == CMLCMS_CATEGORY_INPUT_TO_BLEND ||
- xform->search_key.category == CMLCMS_CATEGORY_INPUT_TO_OUTPUT);
-
for (value_b = 0; value_b < len; value_b++) {
for (value_g = 0; value_g < len; value_g++) {
for (value_r = 0; value_r < len; value_r++) {
@@ -935,7 +932,14 @@ xform_realize_chain(struct cmlcms_color_transform *xform)
case CMLCMS_TRANSFORM_FAILED:
goto failed;
case CMLCMS_TRANSFORM_OPTIMIZED:
+ break;
case CMLCMS_TRANSFORM_3DLUT:
+ /*
+ * Given the chain formed above, blend-to-output should never
+ * fall back to 3D LUT.
+ */
+ weston_assert_uint32_neq(cm->base.compositor, xform->search_key.category,
+ CMLCMS_CATEGORY_BLEND_TO_OUTPUT);
break;
}