clutter: Use graphene_matrix_inverse()

Instead of our own implementation that upscales, then downscales back,
use graphene_matrix_inverse() directly. This is possible after switching
to a z-near value that doesn't have problems with float precision.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
This commit is contained in:
Georges Basile Stavracas Neto
2020-10-11 13:30:25 -03:00
parent 78c648f947
commit 1f99395d20
5 changed files with 6 additions and 58 deletions

View File

@@ -3165,9 +3165,8 @@ ensure_valid_actor_transform (ClutterActor *actor)
graphene_matrix_init_identity (&priv->transform);
CLUTTER_ACTOR_GET_CLASS (actor)->apply_transform (actor, &priv->transform);
priv->has_inverse_transform =
cogl_graphene_matrix_get_inverse (&priv->transform,
&priv->inverse_transform);
priv->has_inverse_transform = graphene_matrix_inverse (&priv->transform,
&priv->inverse_transform);
priv->transform_valid = TRUE;
}

View File

@@ -2068,8 +2068,8 @@ clutter_stage_set_perspective (ClutterStage *stage,
priv->perspective.aspect,
priv->perspective.z_near,
priv->perspective.z_far);
cogl_graphene_matrix_get_inverse (&priv->projection,
&priv->inverse_projection);
graphene_matrix_inverse (&priv->projection,
&priv->inverse_projection);
_clutter_stage_dirty_projection (stage);
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));