cogl/matrix: Relocate and update projection and transform APIs

Ideally, we would use Graphene to do that, however as of now Graphene
lacks these APIs so we still need these helpers. Since we're preparing
to get rid of CoglMatrix, move them to a separate file, and rename them
with the 'cogl_graphene' prefix.

Since I'm already touching the world with this change, I'm also renaming
cogl_matrix_transform_point() to cogl_graphene_matrix_project_point(),
as per XXX comment, to make it consistent with the transform/projection
semantics in place.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
This commit is contained in:
Georges Basile Stavracas Neto
2020-09-11 15:14:26 -03:00
parent 050053a114
commit cedb5318da
14 changed files with 534 additions and 463 deletions

View File

@ -170,11 +170,11 @@ meta_actor_painting_untransformed (CoglFramebuffer *fb,
for (i = 0; i < 4; i++)
{
float w = 1;
cogl_matrix_transform_point (&modelview_projection,
&vertices[i].x,
&vertices[i].y,
&vertices[i].z,
&w);
cogl_graphene_matrix_project_point (&modelview_projection,
&vertices[i].x,
&vertices[i].y,
&vertices[i].z,
&w);
vertices[i].x = MTX_GL_SCALE_X (vertices[i].x, w,
viewport[2], viewport[0]);
vertices[i].y = MTX_GL_SCALE_Y (vertices[i].y, w,