mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-02-03 10:10:35 +01:00
color-lcms: detect identity matrix in color mapping
Check that we never store an identity matrix as an arbitrary matrix. This can make processing of weston_color_mapping more efficient. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
42c47134d4
commit
0b3822f856
1 changed files with 7 additions and 3 deletions
|
|
@ -1403,9 +1403,13 @@ static void
|
|||
weston_color_mapping_set_from_m4f(struct weston_color_mapping *mapping,
|
||||
struct weston_mat4f mat)
|
||||
{
|
||||
mapping->type = WESTON_COLOR_MAPPING_TYPE_MATRIX;
|
||||
mapping->u.mat.matrix = weston_m3f_from_m4f_xyz(mat);
|
||||
mapping->u.mat.offset = weston_v3f_from_v4f_xyz(mat.col[3]);
|
||||
if (matrix_is_identity(mat, MATRIX_PRECISION_BITS)) {
|
||||
mapping->type = WESTON_COLOR_MAPPING_TYPE_IDENTITY;
|
||||
} else {
|
||||
mapping->type = WESTON_COLOR_MAPPING_TYPE_MATRIX;
|
||||
mapping->u.mat.matrix = weston_m3f_from_m4f_xyz(mat);
|
||||
mapping->u.mat.offset = weston_v3f_from_v4f_xyz(mat.col[3]);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue