cogl/matrix: Import skew functions from Clutter

Graphene provides skewing as part of graphene_matrix_t API, and it'll
be easier for the transition to just expose similar API surfaces.

Move the matrix skew methods to CoglMatrix.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
This commit is contained in:
Georges Basile Stavracas Neto
2020-09-09 19:10:09 -03:00
parent 566b081cd7
commit fe0a325e9f
5 changed files with 87 additions and 40 deletions

View File

@ -285,36 +285,6 @@ _clutter_util_matrix_transpose_vector4_transform (const CoglMatrix *matrix,
+ matrix->ww * point->w;
}
void
_clutter_util_matrix_skew_xy (CoglMatrix *matrix,
float factor)
{
matrix->yx += matrix->xx * factor;
matrix->yy += matrix->xy * factor;
matrix->yz += matrix->xz * factor;
matrix->yw += matrix->xw * factor;
}
void
_clutter_util_matrix_skew_xz (CoglMatrix *matrix,
float factor)
{
matrix->zx += matrix->xx * factor;
matrix->zy += matrix->xy * factor;
matrix->zz += matrix->xz * factor;
matrix->zw += matrix->xw * factor;
}
void
_clutter_util_matrix_skew_yz (CoglMatrix *matrix,
float factor)
{
matrix->zx += matrix->yx * factor;
matrix->zy += matrix->yy * factor;
matrix->zz += matrix->yz * factor;
matrix->zw += matrix->yw * factor;
}
static void
_clutter_util_vertex_combine (const graphene_point3d_t *a,
const graphene_point3d_t *b,