diff --git a/clutter/clutter/clutter-cogl.c b/clutter/clutter/clutter-cogl.c index 9663f904d..c36f72604 100644 --- a/clutter/clutter/clutter-cogl.c +++ b/clutter/clutter/clutter-cogl.c @@ -37,18 +37,14 @@ cogl_matrix_progress (const GValue *a, { const CoglMatrix *matrix1 = g_value_get_boxed (a); const CoglMatrix *matrix2 = g_value_get_boxed (b); - graphene_matrix_t m1, m2, interpolated; + graphene_matrix_t interpolated; CoglMatrix res; - float fm1[16]; - float fm2[16]; float v[16]; - cogl_matrix_to_float (matrix1, fm1); - cogl_matrix_to_float (matrix2, fm2); - - graphene_matrix_init_from_float (&m1, fm1); - graphene_matrix_init_from_float (&m2, fm2); - graphene_matrix_interpolate (&m1, &m2, progress, &interpolated); + graphene_matrix_interpolate (cogl_matrix_get_graphene_matrix (matrix1), + cogl_matrix_get_graphene_matrix (matrix2), + progress, + &interpolated); graphene_matrix_to_float (&interpolated, v); cogl_matrix_init_from_array (&res, v); diff --git a/cogl/cogl/cogl-matrix.c b/cogl/cogl/cogl-matrix.c index 2bdda114b..91ea3e951 100644 --- a/cogl/cogl/cogl-matrix.c +++ b/cogl/cogl/cogl-matrix.c @@ -810,3 +810,9 @@ cogl_matrix_skew_yz (CoglMatrix *matrix, matrix->flags |= COGL_MATRIX_FLAG_DIRTY_INVERSE; _COGL_MATRIX_DEBUG_PRINT (matrix); } + +const graphene_matrix_t * +cogl_matrix_get_graphene_matrix (const CoglMatrix *matrix) +{ + return &matrix->m; +} diff --git a/cogl/cogl/cogl-matrix.h b/cogl/cogl/cogl-matrix.h index 4a3d6156e..347584dfe 100644 --- a/cogl/cogl/cogl-matrix.h +++ b/cogl/cogl/cogl-matrix.h @@ -777,6 +777,18 @@ COGL_EXPORT void cogl_matrix_skew_yz (CoglMatrix *matrix, float factor); +/** + * cogl_matrix_get_graphene_matrix: + * @matrix: a #CoglMatrix + * + * Retrieves the internal #graphene_matrix_t of @matrix. It should not + * be modified, and must be considered read-only. + * + * Returns: (transfer none): a #graphene_matrix_t + */ +COGL_EXPORT const graphene_matrix_t * +cogl_matrix_get_graphene_matrix (const CoglMatrix *matrix); + G_END_DECLS #endif /* __COGL_MATRIX_H */