color: add output color transform API

This is the blending space to monitor space color transform. It needs to
be implemented in the renderers, unless a backend sets
from_blend_to_output_by_backend = true, in which case the backend does
it and the renderer does not.

The intention is that from_blend_to_output_by_backend can be toggled
frame by frame to allow backends to react to dynamic change of output
color profile.

For now, renderers just assert that they don't need to do anything for
output color transform.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen
2021-02-25 12:03:28 +02:00
committed by Pekka Paalanen
parent 90a5ffa097
commit 1d2eee208c
6 changed files with 65 additions and 0 deletions
+5
View File
@@ -1507,6 +1507,8 @@ blit_shadow_to_output(struct weston_output *output,
pixman_region32_t translated_damage;
GLfloat verts[4 * 2];
assert(output->from_blend_to_output == NULL);
pixman_region32_init(&translated_damage);
gl_renderer_use_program(gr, &sconf);
@@ -1569,6 +1571,9 @@ gl_renderer_repaint_output(struct weston_output *output,
enum gl_border_status border_status = BORDER_STATUS_CLEAN;
struct weston_paint_node *pnode;
assert(output->from_blend_to_output_by_backend ||
output->from_blend_to_output == NULL);
if (use_output(output) < 0)
return;