[mutter/gbsneto/graphene-matrix: 20/42] Replace the CoglMatrix type by graphene_matrix_t




commit 544e90ea84eac87bf6640b84a9806d0cbcab49b6
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Sep 11 15:57:28 2020 -0300

    Replace the CoglMatrix type by graphene_matrix_t
    
    CoglMatrix already is a typedef to graphene_matrix_t. This commit
    simply drops the CoglMatrix type, and align parameters. There is
    no functional change here, it's simply a find-and-replace commit.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439

 clutter/clutter/clutter-actor-private.h            |  14 +-
 clutter/clutter/clutter-actor.c                    | 100 +++++-----
 clutter/clutter/clutter-actor.h                    |  10 +-
 clutter/clutter/clutter-clone.c                    |   3 +-
 clutter/clutter/clutter-offscreen-effect.c         |   4 +-
 clutter/clutter/clutter-paint-node-private.h       |   2 +-
 clutter/clutter/clutter-paint-nodes.c              |  10 +-
 clutter/clutter/clutter-paint-nodes.h              |   4 +-
 clutter/clutter/clutter-paint-volume-private.h     |  12 +-
 clutter/clutter/clutter-paint-volume.c             |  12 +-
 clutter/clutter/clutter-pan-action.c               |   2 +-
 clutter/clutter/clutter-private.h                  |   4 +-
 clutter/clutter/clutter-scroll-actor.c             |   2 +-
 clutter/clutter/clutter-stage-private.h            |   2 +-
 clutter/clutter/clutter-stage-view-private.h       |   4 +-
 clutter/clutter/clutter-stage-view.c               |  14 +-
 clutter/clutter/clutter-stage-view.h               |   8 +-
 clutter/clutter/clutter-stage.c                    |  20 +-
 clutter/clutter/clutter-util.c                     |  12 +-
 clutter/clutter/cogl/clutter-stage-cogl.c          |   2 +-
 cogl/cogl/cogl-clip-stack.c                        |  26 +--
 cogl/cogl/cogl-context-private.h                   |   4 +-
 cogl/cogl/cogl-framebuffer.c                       |  22 +--
 cogl/cogl/cogl-framebuffer.h                       |  20 +-
 cogl/cogl/cogl-journal.c                           |   6 +-
 cogl/cogl/cogl-matrix-private.h                    |   6 +-
 cogl/cogl/cogl-matrix-stack-private.h              |   6 +-
 cogl/cogl/cogl-matrix-stack.c                      |  30 +--
 cogl/cogl/cogl-matrix-stack.h                      |  48 ++---
 cogl/cogl/cogl-matrix.c                            | 220 +++++++++++----------
 cogl/cogl/cogl-matrix.h                            | 204 +++++++++----------
 cogl/cogl/cogl-pipeline-layer-private.h            |   2 +-
 cogl/cogl/cogl-pipeline-layer-state.c              |   4 +-
 cogl/cogl/cogl-pipeline-layer-state.h              |   2 +-
 cogl/cogl/cogl-pipeline-private.h                  |   2 +-
 cogl/cogl/cogl-pipeline-state.h                    |   2 +-
 cogl/cogl/cogl-private.h                           |  10 +-
 cogl/cogl/cogl-types.h                             |   4 -
 cogl/cogl/cogl.c                                   |  10 +-
 cogl/cogl/deprecated/cogl-material-compat.c        |   6 +-
 cogl/cogl/deprecated/cogl-material-compat.h        |   6 +-
 cogl/cogl/driver/gl/cogl-clip-stack-gl.c           |   2 +-
 cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c   |   8 +-
 cogl/tests/conform/test-pipeline-uniforms.c        |   2 +-
 cogl/tests/conform/test-pipeline-user-matrix.c     |   2 +-
 cogl/tests/conform/test-primitive-and-journal.c    |   2 +-
 cogl/tests/conform/test-readpixels.c               |   6 +-
 cogl/tests/conform/test-snippets.c                 |   8 +-
 cogl/tests/conform/test-viewport.c                 |   6 +-
 src/backends/meta-renderer-view.c                  |   6 +-
 src/backends/x11/nested/meta-stage-x11-nested.c    |   4 +-
 src/compositor/clutter-utils.c                     |   2 +-
 src/compositor/meta-shaped-texture.c               |   4 +-
 src/compositor/meta-texture-tower.c                |   2 +-
 src/compositor/meta-window-actor.c                 |   2 +-
 src/tests/clutter/conform/actor-pivot-point.c      |   2 +-
 .../clutter/interactive/test-cogl-multitexture.c   |   8 +-
 .../clutter/interactive/test-cogl-offscreen.c      |   4 +-
 .../clutter/interactive/test-cogl-point-sprites.c  |   2 +-
 59 files changed, 477 insertions(+), 476 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor-private.h b/clutter/clutter/clutter-actor-private.h
index 16ab012b6f..dda39e4fde 100644
--- a/clutter/clutter/clutter-actor-private.h
+++ b/clutter/clutter/clutter-actor-private.h
@@ -180,10 +180,10 @@ struct _ClutterTransformInfo
   graphene_point_t pivot;
   gfloat pivot_z;
 
-  CoglMatrix transform;
+  graphene_matrix_t transform;
   guint transform_set : 1;
 
-  CoglMatrix child_transform;
+  graphene_matrix_t child_transform;
   guint child_transform_set : 1;
 };
 
@@ -220,11 +220,11 @@ void                            _clutter_actor_traverse
                                                                                          gpointer user_data);
 ClutterActor *                  _clutter_actor_get_stage_internal                       (ClutterActor 
*actor);
 
-void                            _clutter_actor_apply_modelview_transform                (ClutterActor *self,
-                                                                                         CoglMatrix   
*matrix);
-void                            _clutter_actor_apply_relative_transformation_matrix     (ClutterActor *self,
-                                                                                         ClutterActor 
*ancestor,
-                                                                                         CoglMatrix   
*matrix);
+void                            _clutter_actor_apply_modelview_transform                (ClutterActor      
*self,
+                                                                                         graphene_matrix_t 
*matrix);
+void                            _clutter_actor_apply_relative_transformation_matrix     (ClutterActor      
*self,
+                                                                                         ClutterActor      
*ancestor,
+                                                                                         graphene_matrix_t 
*matrix);
 
 void                            _clutter_actor_rerealize                                (ClutterActor    
*self,
                                                                                          ClutterCallback  
callback,
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 0ec9826bbc..0a873c4699 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -703,8 +703,8 @@ struct _ClutterActorPrivate
   graphene_rect_t clip;
 
   /* the cached transformation matrix; see apply_transform() */
-  CoglMatrix transform;
-  CoglMatrix inverse_transform;
+  graphene_matrix_t transform;
+  graphene_matrix_t inverse_transform;
 
   float resource_scale;
 
@@ -1050,9 +1050,9 @@ static void clutter_actor_update_map_state       (ClutterActor  *self,
                                                   MapStateChange change);
 static void clutter_actor_unrealize_not_hiding   (ClutterActor *self);
 
-static void _clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
-                                                               ClutterActor *ancestor,
-                                                               CoglMatrix *matrix);
+static void _clutter_actor_get_relative_transformation_matrix (ClutterActor      *self,
+                                                               ClutterActor      *ancestor,
+                                                               graphene_matrix_t *matrix);
 
 static ClutterPaintVolume *_clutter_actor_get_paint_volume_mutable (ClutterActor *self);
 
@@ -1070,10 +1070,10 @@ static inline void clutter_actor_set_margin_internal (ClutterActor *self,
                                                       gfloat        margin,
                                                       GParamSpec   *pspec);
 
-static void clutter_actor_set_transform_internal (ClutterActor     *self,
-                                                  const CoglMatrix *transform);
-static void clutter_actor_set_child_transform_internal (ClutterActor     *self,
-                                                        const CoglMatrix *transform);
+static void clutter_actor_set_transform_internal (ClutterActor            *self,
+                                                  const graphene_matrix_t *transform);
+static void clutter_actor_set_child_transform_internal (ClutterActor            *self,
+                                                        const graphene_matrix_t *transform);
 
 static void     clutter_actor_realize_internal          (ClutterActor *self);
 static void     clutter_actor_unrealize_internal        (ClutterActor *self);
@@ -1260,7 +1260,7 @@ _clutter_actor_transform_local_box_to_stage (ClutterActor          *self,
   ClutterActorPrivate *stage_priv = stage_actor->priv;
   CoglFramebuffer *fb =
    clutter_pick_context_get_framebuffer (pick_context);
-  CoglMatrix modelview, transform_to_stage;
+  graphene_matrix_t modelview, transform_to_stage;
   int v;
 
   ensure_valid_actor_transform (stage_actor);
@@ -2853,7 +2853,7 @@ clutter_actor_apply_relative_transform_to_point (ClutterActor             *self,
                                                  graphene_point3d_t       *vertex)
 {
   gfloat w;
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
 
   g_return_if_fail (CLUTTER_IS_ACTOR (self));
   g_return_if_fail (ancestor == NULL || CLUTTER_IS_ACTOR (ancestor));
@@ -2887,8 +2887,8 @@ _clutter_actor_fully_transform_vertices (ClutterActor             *self,
                                          int                       n_vertices)
 {
   ClutterActor *stage;
-  CoglMatrix modelview;
-  CoglMatrix projection;
+  graphene_matrix_t modelview;
+  graphene_matrix_t projection;
   float viewport[4];
 
   g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
@@ -2950,7 +2950,7 @@ clutter_actor_apply_transform_to_point (ClutterActor             *self,
  * @self: The actor whose coordinate space you want to transform from.
  * @ancestor: The ancestor actor whose coordinate space you want to transform too
  *            or %NULL if you want to transform all the way to eye coordinates.
- * @matrix: A #CoglMatrix to store the transformation
+ * @matrix: A #graphene_matrix_t to store the transformation
  *
  * This gets a transformation @matrix that will transform coordinates from the
  * coordinate space of @self into the coordinate space of @ancestor.
@@ -2975,9 +2975,9 @@ clutter_actor_apply_transform_to_point (ClutterActor             *self,
 /* XXX: We should consider caching the stage relative modelview along with
  * the actor itself */
 static void
-_clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
-                                                   ClutterActor *ancestor,
-                                                   CoglMatrix *matrix)
+_clutter_actor_get_relative_transformation_matrix (ClutterActor      *self,
+                                                   ClutterActor      *ancestor,
+                                                   graphene_matrix_t *matrix)
 {
   cogl_matrix_init_identity (matrix);
 
@@ -3064,8 +3064,8 @@ clutter_actor_get_abs_allocation_vertices (ClutterActor       *self,
 }
 
 static void
-clutter_actor_real_apply_transform (ClutterActor *self,
-                                    CoglMatrix   *matrix)
+clutter_actor_real_apply_transform (ClutterActor      *self,
+                                    graphene_matrix_t *matrix)
 {
   ClutterActorPrivate *priv = self->priv;
   const ClutterTransformInfo *info;
@@ -3172,8 +3172,8 @@ ensure_valid_actor_transform (ClutterActor *actor)
 }
 
 void
-_clutter_actor_apply_modelview_transform (ClutterActor *self,
-                                          CoglMatrix   *matrix)
+_clutter_actor_apply_modelview_transform (ClutterActor      *self,
+                                          graphene_matrix_t *matrix)
 {
   ClutterActorPrivate *priv = self->priv;
 
@@ -3186,7 +3186,7 @@ _clutter_actor_apply_modelview_transform (ClutterActor *self,
  * @self: The actor whose coordinate space you want to transform from.
  * @ancestor: The ancestor actor whose coordinate space you want to transform too
  *            or %NULL if you want to transform all the way to eye coordinates.
- * @matrix: A #CoglMatrix to apply the transformation too.
+ * @matrix: A #graphene_matrix_t to apply the transformation too.
  *
  * This multiplies a transform with @matrix that will transform coordinates
  * from the coordinate space of @self into the coordinate space of @ancestor.
@@ -3209,9 +3209,9 @@ _clutter_actor_apply_modelview_transform (ClutterActor *self,
  * clutter_actor_get_relative_transformation_matrix() instead.
  */
 void
-_clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
-                                                     ClutterActor *ancestor,
-                                                     CoglMatrix *matrix)
+_clutter_actor_apply_relative_transformation_matrix (ClutterActor      *self,
+                                                     ClutterActor      *ancestor,
+                                                     graphene_matrix_t *matrix)
 {
   /* Note we terminate before ever calling stage->apply_transform()
    * since that would conceptually be relative to the underlying
@@ -3838,7 +3838,7 @@ clutter_actor_paint (ClutterActor        *self,
   if (priv->enable_model_view_transform)
     {
       ClutterPaintNode *transform_node;
-      CoglMatrix transform;
+      graphene_matrix_t transform;
 
       clutter_actor_get_transform (self, &transform);
 
@@ -3856,7 +3856,7 @@ clutter_actor_paint (ClutterActor        *self,
        * of an apply_transform vfunc... */
       if (G_UNLIKELY (clutter_debug_flags & CLUTTER_DEBUG_OOB_TRANSFORMS))
         {
-          CoglMatrix expected_matrix;
+          graphene_matrix_t expected_matrix;
 
           _clutter_actor_get_relative_transformation_matrix (self, NULL,
                                                              &expected_matrix);
@@ -4092,7 +4092,7 @@ clutter_actor_pick (ClutterActor       *actor,
 
   if (priv->enable_model_view_transform)
     {
-      CoglMatrix matrix;
+      graphene_matrix_t matrix;
 
       cogl_framebuffer_get_modelview_matrix (framebuffer, &matrix);
       _clutter_actor_apply_modelview_transform (actor, &matrix);
@@ -5490,7 +5490,7 @@ clutter_actor_get_property (GObject    *object,
 
     case PROP_TRANSFORM:
       {
-        CoglMatrix m;
+        graphene_matrix_t m;
 
         clutter_actor_get_transform (actor, &m);
         g_value_set_boxed (value, &m);
@@ -5508,7 +5508,7 @@ clutter_actor_get_property (GObject    *object,
 
     case PROP_CHILD_TRANSFORM:
       {
-        CoglMatrix m;
+        graphene_matrix_t m;
 
         clutter_actor_get_child_transform (actor, &m);
         g_value_set_boxed (value, &m);
@@ -6899,7 +6899,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
    *
    * Application code should rarely need to use this function directly.
    *
-   * Setting this property with a #CoglMatrix will set the
+   * Setting this property with a #graphene_matrix_t will set the
    * #ClutterActor:transform-set property to %TRUE as a side effect;
    * setting this property with %NULL will set the
    * #ClutterActor:transform-set property to %FALSE.
@@ -6937,7 +6937,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
    *
    * Applies a transformation matrix on each child of an actor.
    *
-   * Setting this property with a #CoglMatrix will set the
+   * Setting this property with a #graphene_matrix_t will set the
    * #ClutterActor:child-transform-set property to %TRUE as a side effect;
    * setting this property with %NULL will set the
    * #ClutterActor:child-transform-set property to %FALSE.
@@ -14806,8 +14806,8 @@ clutter_actor_unset_flags (ClutterActor      *self,
 }
 
 static void
-clutter_actor_set_transform_internal (ClutterActor     *self,
-                                      const CoglMatrix *transform)
+clutter_actor_set_transform_internal (ClutterActor            *self,
+                                      const graphene_matrix_t *transform)
 {
   ClutterTransformInfo *info;
   gboolean was_set;
@@ -14835,7 +14835,7 @@ clutter_actor_set_transform_internal (ClutterActor     *self,
 /**
  * clutter_actor_set_transform:
  * @self: a #ClutterActor
- * @transform: (allow-none): a #CoglMatrix, or %NULL to
+ * @transform: (allow-none): a #graphene_matrix_t, or %NULL to
  *   unset a custom transformation
  *
  * Overrides the transformations of a #ClutterActor with a custom
@@ -14847,11 +14847,11 @@ clutter_actor_set_transform_internal (ClutterActor     *self,
  * Since: 1.12
  */
 void
-clutter_actor_set_transform (ClutterActor     *self,
-                             const CoglMatrix *transform)
+clutter_actor_set_transform (ClutterActor            *self,
+                             const graphene_matrix_t *transform)
 {
   const ClutterTransformInfo *info;
-  CoglMatrix new_transform;
+  graphene_matrix_t new_transform;
 
   g_return_if_fail (CLUTTER_IS_ACTOR (self));
 
@@ -14870,15 +14870,15 @@ clutter_actor_set_transform (ClutterActor     *self,
 /**
  * clutter_actor_get_transform:
  * @self: a #ClutterActor
- * @transform: (out caller-allocates): a #CoglMatrix
+ * @transform: (out caller-allocates): a #graphene_matrix_t
  *
  * Retrieves the current transformation matrix of a #ClutterActor.
  *
  * Since: 1.12
  */
 void
-clutter_actor_get_transform (ClutterActor *self,
-                             CoglMatrix   *transform)
+clutter_actor_get_transform (ClutterActor      *self,
+                             graphene_matrix_t *transform)
 {
   g_return_if_fail (CLUTTER_IS_ACTOR (self));
   g_return_if_fail (transform != NULL);
@@ -19417,8 +19417,8 @@ done:
 }
 
 static void
-clutter_actor_set_child_transform_internal (ClutterActor     *self,
-                                            const CoglMatrix *transform)
+clutter_actor_set_child_transform_internal (ClutterActor            *self,
+                                            const graphene_matrix_t *transform)
 {
   ClutterTransformInfo *info = _clutter_actor_get_transform_info (self);
   ClutterActorIter iter;
@@ -19448,7 +19448,7 @@ clutter_actor_set_child_transform_internal (ClutterActor     *self,
 /**
  * clutter_actor_set_child_transform:
  * @self: a #ClutterActor
- * @transform: (allow-none): a #CoglMatrix, or %NULL
+ * @transform: (allow-none): a #graphene_matrix_t, or %NULL
  *
  * Sets the transformation matrix to be applied to all the children
  * of @self prior to their own transformations. The default child
@@ -19461,11 +19461,11 @@ clutter_actor_set_child_transform_internal (ClutterActor     *self,
  * Since: 1.12
  */
 void
-clutter_actor_set_child_transform (ClutterActor     *self,
-                                   const CoglMatrix *transform)
+clutter_actor_set_child_transform (ClutterActor            *self,
+                                   const graphene_matrix_t *transform)
 {
   const ClutterTransformInfo *info;
-  CoglMatrix new_transform;
+  graphene_matrix_t new_transform;
 
   g_return_if_fail (CLUTTER_IS_ACTOR (self));
 
@@ -19484,7 +19484,7 @@ clutter_actor_set_child_transform (ClutterActor     *self,
 /**
  * clutter_actor_get_child_transform:
  * @self: a #ClutterActor
- * @transform: (out caller-allocates): a #CoglMatrix
+ * @transform: (out caller-allocates): a #graphene_matrix_t
  *
  * Retrieves the child transformation matrix set using
  * clutter_actor_set_child_transform(); if none is currently set,
@@ -19493,8 +19493,8 @@ clutter_actor_set_child_transform (ClutterActor     *self,
  * Since: 1.12
  */
 void
-clutter_actor_get_child_transform (ClutterActor *self,
-                                   CoglMatrix   *transform)
+clutter_actor_get_child_transform (ClutterActor      *self,
+                                   graphene_matrix_t *transform)
 {
   const ClutterTransformInfo *info;
 
diff --git a/clutter/clutter/clutter-actor.h b/clutter/clutter/clutter-actor.h
index 0c750a7dc0..3ffd98f2cb 100644
--- a/clutter/clutter/clutter-actor.h
+++ b/clutter/clutter/clutter-actor.h
@@ -257,7 +257,7 @@ struct _ClutterActorClass
 
   /* transformations */
   void (* apply_transform)      (ClutterActor           *actor,
-                                 CoglMatrix             *matrix);
+                                 graphene_matrix_t      *matrix);
 
   /* event signals */
   gboolean (* event)                (ClutterActor         *actor,
@@ -803,16 +803,16 @@ void                            clutter_actor_get_translation
                                                                                  gfloat                     
*translate_z);
 CLUTTER_EXPORT
 void                            clutter_actor_set_transform                     (ClutterActor               
*self,
-                                                                                 const CoglMatrix        
*transform);
+                                                                                 const graphene_matrix_t    
*transform);
 CLUTTER_EXPORT
 void                            clutter_actor_get_transform                     (ClutterActor               
*self,
-                                                                                 CoglMatrix                 
*transform);
+                                                                                 graphene_matrix_t          
*transform);
 CLUTTER_EXPORT
 void                            clutter_actor_set_child_transform               (ClutterActor               
*self,
-                                                                                 const CoglMatrix           
*transform);
+                                                                                 const graphene_matrix_t    
*transform);
 CLUTTER_EXPORT
 void                            clutter_actor_get_child_transform               (ClutterActor               
*self,
-                                                                                 CoglMatrix                 
*transform);
+                                                                                 graphene_matrix_t          
*transform);
 
 CLUTTER_EXPORT
 void                            clutter_actor_get_transformed_extents          (ClutterActor               
*self,
diff --git a/clutter/clutter/clutter-clone.c b/clutter/clutter/clutter-clone.c
index a546d4c068..97da2f7a24 100644
--- a/clutter/clutter/clutter-clone.c
+++ b/clutter/clutter/clutter-clone.c
@@ -121,7 +121,8 @@ clutter_clone_get_preferred_height (ClutterActor *self,
 }
 
 static void
-clutter_clone_apply_transform (ClutterActor *self, CoglMatrix *matrix)
+clutter_clone_apply_transform (ClutterActor      *self,
+                               graphene_matrix_t *matrix)
 {
   ClutterClonePrivate *priv = CLUTTER_CLONE (self)->priv;
 
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
index 40bb5f8cc6..e4a9a45e5a 100644
--- a/clutter/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter/clutter-offscreen-effect.c
@@ -258,7 +258,7 @@ clutter_offscreen_effect_pre_paint (ClutterEffect       *effect,
   ClutterOffscreenEffectPrivate *priv = self->priv;
   ClutterActorBox raw_box, box;
   ClutterActor *stage;
-  CoglMatrix projection, old_modelview, modelview;
+  graphene_matrix_t projection, old_modelview, modelview;
   const ClutterPaintVolume *volume;
   CoglColor transparent;
   gfloat stage_width, stage_height;
@@ -427,7 +427,7 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect,
   ClutterOffscreenEffectPrivate *priv = effect->priv;
   CoglFramebuffer *framebuffer =
     clutter_paint_context_get_framebuffer (paint_context);
-  CoglMatrix modelview;
+  graphene_matrix_t modelview;
   float resource_scale;
 
   cogl_framebuffer_push_matrix (framebuffer);
diff --git a/clutter/clutter/clutter-paint-node-private.h b/clutter/clutter/clutter-paint-node-private.h
index faf5df23cf..a7ee1b4bd9 100644
--- a/clutter/clutter/clutter-paint-node-private.h
+++ b/clutter/clutter/clutter-paint-node-private.h
@@ -111,7 +111,7 @@ void                    _clutter_paint_operation_paint_primitive        (const C
 void                    _clutter_paint_node_init_types                  (void);
 gpointer                _clutter_paint_node_create                      (GType gtype);
 
-ClutterPaintNode *      _clutter_transform_node_new                     (const CoglMatrix            
*matrix);
+ClutterPaintNode *      _clutter_transform_node_new                     (const graphene_matrix_t     
*matrix);
 ClutterPaintNode *      _clutter_dummy_node_new                         (ClutterActor                *actor,
                                                                          CoglFramebuffer             
*framebuffer);
 
diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c
index 6301661da1..3d9fa85e29 100644
--- a/clutter/clutter/clutter-paint-nodes.c
+++ b/clutter/clutter/clutter-paint-nodes.c
@@ -191,7 +191,7 @@ struct _ClutterTransformNode
 {
   ClutterPaintNode parent_instance;
 
-  CoglMatrix transform;
+  graphene_matrix_t transform;
 };
 
 struct _ClutterTransformNodeClass
@@ -249,7 +249,7 @@ clutter_transform_node_init (ClutterTransformNode *self)
  *   Use clutter_paint_node_unref() when done.
  */
 ClutterPaintNode *
-clutter_transform_node_new (const CoglMatrix *transform)
+clutter_transform_node_new (const graphene_matrix_t *transform)
 {
   ClutterTransformNode *res;
 
@@ -1226,7 +1226,7 @@ struct _ClutterLayerNode
 
   cairo_rectangle_t viewport;
 
-  CoglMatrix projection;
+  graphene_matrix_t projection;
 
   float fbo_width;
   float fbo_height;
@@ -1250,7 +1250,7 @@ clutter_layer_node_pre_draw (ClutterPaintNode *node,
 {
   ClutterLayerNode *lnode = (ClutterLayerNode *) node;
   CoglFramebuffer *framebuffer;
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
 
   /* if we were unable to create an offscreen buffer for this node, then
    * we simply ignore it
@@ -1404,7 +1404,7 @@ clutter_layer_node_init (ClutterLayerNode *self)
  * Since: 1.10
  */
 ClutterPaintNode *
-clutter_layer_node_new (const CoglMatrix        *projection,
+clutter_layer_node_new (const graphene_matrix_t *projection,
                         const cairo_rectangle_t *viewport,
                         float                    width,
                         float                    height,
diff --git a/clutter/clutter/clutter-paint-nodes.h b/clutter/clutter/clutter-paint-nodes.h
index 235f4bc456..2e81c2b5df 100644
--- a/clutter/clutter/clutter-paint-nodes.h
+++ b/clutter/clutter/clutter-paint-nodes.h
@@ -202,7 +202,7 @@ CLUTTER_EXPORT
 GType clutter_layer_node_get_type (void) G_GNUC_CONST;
 
 CLUTTER_EXPORT
-ClutterPaintNode *      clutter_layer_node_new          (const CoglMatrix        *projection,
+ClutterPaintNode *      clutter_layer_node_new          (const graphene_matrix_t *projection,
                                                          const cairo_rectangle_t *viewport,
                                                          float                    width,
                                                          float                    height,
@@ -228,7 +228,7 @@ CLUTTER_EXPORT
 GType clutter_transform_node_get_type (void) G_GNUC_CONST;
 
 CLUTTER_EXPORT
-ClutterPaintNode *      clutter_transform_node_new          (const CoglMatrix *projection);
+ClutterPaintNode *      clutter_transform_node_new          (const graphene_matrix_t *projection);
 
 G_END_DECLS
 
diff --git a/clutter/clutter/clutter-paint-volume-private.h b/clutter/clutter/clutter-paint-volume-private.h
index 6a3f53428d..48524f4223 100644
--- a/clutter/clutter/clutter-paint-volume-private.h
+++ b/clutter/clutter/clutter-paint-volume-private.h
@@ -111,12 +111,12 @@ void                _clutter_paint_volume_set_from_volume      (ClutterPaintVolu
                                                                 const ClutterPaintVolume *src);
 
 void                _clutter_paint_volume_complete             (ClutterPaintVolume *pv);
-void                _clutter_paint_volume_transform            (ClutterPaintVolume *pv,
-                                                                const CoglMatrix *matrix);
-void                _clutter_paint_volume_project              (ClutterPaintVolume *pv,
-                                                                const CoglMatrix   *modelview,
-                                                                const CoglMatrix   *projection,
-                                                                const float        *viewport);
+void                _clutter_paint_volume_transform            (ClutterPaintVolume      *pv,
+                                                                const graphene_matrix_t *matrix);
+void                _clutter_paint_volume_project              (ClutterPaintVolume      *pv,
+                                                                const graphene_matrix_t *modelview,
+                                                                const graphene_matrix_t *projection,
+                                                                const float             *viewport);
 void                _clutter_paint_volume_get_bounding_box     (ClutterPaintVolume *pv,
                                                                 ClutterActorBox    *box);
 void                _clutter_paint_volume_axis_align           (ClutterPaintVolume *pv);
diff --git a/clutter/clutter/clutter-paint-volume.c b/clutter/clutter/clutter-paint-volume.c
index 807d1c401b..2758665cb6 100644
--- a/clutter/clutter/clutter-paint-volume.c
+++ b/clutter/clutter/clutter-paint-volume.c
@@ -808,8 +808,8 @@ _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv,
 
 void
 _clutter_paint_volume_project (ClutterPaintVolume *pv,
-                               const CoglMatrix *modelview,
-                               const CoglMatrix *projection,
+                               const graphene_matrix_t *modelview,
+                               const graphene_matrix_t *projection,
                                const float *viewport)
 {
   int transform_count;
@@ -849,7 +849,7 @@ _clutter_paint_volume_project (ClutterPaintVolume *pv,
 
 void
 _clutter_paint_volume_transform (ClutterPaintVolume *pv,
-                                 const CoglMatrix *matrix)
+                                 const graphene_matrix_t *matrix)
 {
   int transform_count;
 
@@ -1130,8 +1130,8 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
                                            ClutterActorBox *box)
 {
   ClutterPaintVolume projected_pv;
-  CoglMatrix modelview;
-  CoglMatrix projection;
+  graphene_matrix_t modelview;
+  graphene_matrix_t projection;
   float viewport[4];
 
   _clutter_paint_volume_copy_static (pv, &projected_pv);
@@ -1181,7 +1181,7 @@ void
 _clutter_paint_volume_transform_relative (ClutterPaintVolume *pv,
                                           ClutterActor *relative_to_ancestor)
 {
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
   ClutterActor *actor;
 
   actor = pv->actor;
diff --git a/clutter/clutter/clutter-pan-action.c b/clutter/clutter/clutter-pan-action.c
index 21aa7af6cc..04b67293cf 100644
--- a/clutter/clutter/clutter-pan-action.c
+++ b/clutter/clutter/clutter-pan-action.c
@@ -354,7 +354,7 @@ clutter_pan_action_real_pan (ClutterPanAction *self,
                              gboolean          is_interpolated)
 {
   gfloat dx, dy;
-  CoglMatrix transform;
+  graphene_matrix_t transform;
 
   clutter_pan_action_get_constrained_motion_delta (self, 0, &dx, &dy);
 
diff --git a/clutter/clutter/clutter-private.h b/clutter/clutter/clutter-private.h
index c4d3451f38..b6a8e10409 100644
--- a/clutter/clutter/clutter-private.h
+++ b/clutter/clutter/clutter-private.h
@@ -210,8 +210,8 @@ void _clutter_run_repaint_functions (ClutterRepaintFlags flags);
 
 GType _clutter_layout_manager_get_child_meta_type (ClutterLayoutManager *manager);
 
-void  _clutter_util_fully_transform_vertices (const CoglMatrix         *modelview,
-                                              const CoglMatrix         *projection,
+void  _clutter_util_fully_transform_vertices (const graphene_matrix_t  *modelview,
+                                              const graphene_matrix_t  *projection,
                                               const float              *viewport,
                                               const graphene_point3d_t *vertices_in,
                                               graphene_point3d_t       *vertices_out,
diff --git a/clutter/clutter/clutter-scroll-actor.c b/clutter/clutter/clutter-scroll-actor.c
index 289c81686d..6642ecbc87 100644
--- a/clutter/clutter/clutter-scroll-actor.c
+++ b/clutter/clutter/clutter-scroll-actor.c
@@ -99,7 +99,7 @@ clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor     *self,
 {
   ClutterScrollActorPrivate *priv = self->priv;
   ClutterActor *actor = CLUTTER_ACTOR (self);
-  CoglMatrix m;
+  graphene_matrix_t m;
   float dx, dy;
 
   cogl_matrix_init_identity (&m);
diff --git a/clutter/clutter/clutter-stage-private.h b/clutter/clutter/clutter-stage-private.h
index f2a371c5ef..ef5ce1da49 100644
--- a/clutter/clutter/clutter-stage-private.h
+++ b/clutter/clutter/clutter-stage-private.h
@@ -55,7 +55,7 @@ void                _clutter_stage_set_window            (ClutterStage
 CLUTTER_EXPORT
 ClutterStageWindow *_clutter_stage_get_window            (ClutterStage          *stage);
 void                _clutter_stage_get_projection_matrix (ClutterStage          *stage,
-                                                          CoglMatrix            *projection);
+                                                          graphene_matrix_t     *projection);
 void                _clutter_stage_dirty_projection      (ClutterStage          *stage);
 void                _clutter_stage_get_viewport          (ClutterStage          *stage,
                                                           float                 *x,
diff --git a/clutter/clutter/clutter-stage-view-private.h b/clutter/clutter/clutter-stage-view-private.h
index e4132202e4..d98fb463af 100644
--- a/clutter/clutter/clutter-stage-view-private.h
+++ b/clutter/clutter/clutter-stage-view-private.h
@@ -41,8 +41,8 @@ gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
 
 void clutter_stage_view_invalidate_projection (ClutterStageView *view);
 
-void clutter_stage_view_set_projection (ClutterStageView *view,
-                                        const CoglMatrix *matrix);
+void clutter_stage_view_set_projection (ClutterStageView        *view,
+                                        const graphene_matrix_t *matrix);
 
 void clutter_stage_view_add_redraw_clip (ClutterStageView            *view,
                                          const cairo_rectangle_int_t *clip);
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index 00a4d5ad14..c75b1f25eb 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -213,7 +213,7 @@ paint_transformed_framebuffer (ClutterStageView     *view,
                                CoglFramebuffer      *dst_framebuffer,
                                const cairo_region_t *redraw_clip)
 {
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
   unsigned int n_rectangles, i;
   int dst_width, dst_height;
   cairo_rectangle_int_t view_layout;
@@ -882,8 +882,8 @@ clutter_stage_view_invalidate_projection (ClutterStageView *view)
 }
 
 void
-clutter_stage_view_set_projection (ClutterStageView *view,
-                                   const CoglMatrix *matrix)
+clutter_stage_view_set_projection (ClutterStageView        *view,
+                                   const graphene_matrix_t *matrix)
 {
   ClutterStageViewPrivate *priv =
     clutter_stage_view_get_instance_private (view);
@@ -895,8 +895,8 @@ clutter_stage_view_set_projection (ClutterStageView *view,
 }
 
 void
-clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
-                                                        CoglMatrix       *matrix)
+clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView  *view,
+                                                        graphene_matrix_t *matrix)
 {
   ClutterStageViewClass *view_class = CLUTTER_STAGE_VIEW_GET_CLASS (view);
 
@@ -984,8 +984,8 @@ clutter_stage_view_take_redraw_clip (ClutterStageView *view)
 }
 
 static void
-clutter_stage_default_get_offscreen_transformation_matrix (ClutterStageView *view,
-                                                           CoglMatrix       *matrix)
+clutter_stage_default_get_offscreen_transformation_matrix (ClutterStageView  *view,
+                                                           graphene_matrix_t *matrix)
 {
   cogl_matrix_init_identity (matrix);
 }
diff --git a/clutter/clutter/clutter-stage-view.h b/clutter/clutter/clutter-stage-view.h
index 4c54553ed6..3f2ef8af94 100644
--- a/clutter/clutter/clutter-stage-view.h
+++ b/clutter/clutter/clutter-stage-view.h
@@ -42,8 +42,8 @@ struct _ClutterStageViewClass
   void (* setup_offscreen_blit_pipeline) (ClutterStageView *view,
                                           CoglPipeline     *pipeline);
 
-  void (* get_offscreen_transformation_matrix) (ClutterStageView *view,
-                                                CoglMatrix       *matrix);
+  void (* get_offscreen_transformation_matrix) (ClutterStageView  *view,
+                                                graphene_matrix_t *matrix);
 
   void (* transform_rect_to_onscreen) (ClutterStageView            *view,
                                        const cairo_rectangle_int_t *src_rect,
@@ -70,8 +70,8 @@ CLUTTER_EXPORT
 float clutter_stage_view_get_scale (ClutterStageView *view);
 
 CLUTTER_EXPORT
-void clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
-                                                             CoglMatrix       *matrix);
+void clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView  *view,
+                                                             graphene_matrix_t *matrix);
 
 CLUTTER_EXPORT
 ClutterFrameClock * clutter_stage_view_get_frame_clock (ClutterStageView *view);
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index e30bcb41dd..ff68b40150 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -103,9 +103,9 @@ struct _ClutterStagePrivate
   ClutterStageWindow *impl;
 
   ClutterPerspective perspective;
-  CoglMatrix projection;
-  CoglMatrix inverse_projection;
-  CoglMatrix view;
+  graphene_matrix_t projection;
+  graphene_matrix_t inverse_projection;
+  graphene_matrix_t view;
   float viewport[4];
 
   gchar *title;
@@ -662,8 +662,8 @@ static void
 _cogl_util_get_eye_planes_for_screen_poly (float *polygon,
                                            int n_vertices,
                                            float *viewport,
-                                           const CoglMatrix *projection,
-                                           const CoglMatrix *inverse_project,
+                                           const graphene_matrix_t *projection,
+                                           const graphene_matrix_t *inverse_project,
                                            ClutterPlane *planes)
 {
   float Wc;
@@ -1578,8 +1578,8 @@ _clutter_stage_do_pick (ClutterStage   *stage,
 }
 
 static void
-clutter_stage_real_apply_transform (ClutterActor *stage,
-                                    CoglMatrix   *matrix)
+clutter_stage_real_apply_transform (ClutterActor      *stage,
+                                    graphene_matrix_t *matrix)
 {
   ClutterStagePrivate *priv = CLUTTER_STAGE (stage)->priv;
 
@@ -2098,7 +2098,7 @@ clutter_stage_get_perspective (ClutterStage       *stage,
 /*
  * clutter_stage_get_projection_matrix:
  * @stage: A #ClutterStage
- * @projection: return location for a #CoglMatrix representing the
+ * @projection: return location for a #graphene_matrix_t representing the
  *              perspective projection applied to actors on the given
  *              @stage.
  *
@@ -2108,8 +2108,8 @@ clutter_stage_get_perspective (ClutterStage       *stage,
  * Since: 1.6
  */
 void
-_clutter_stage_get_projection_matrix (ClutterStage *stage,
-                                      CoglMatrix *projection)
+_clutter_stage_get_projection_matrix (ClutterStage      *stage,
+                                      graphene_matrix_t *projection)
 {
   g_return_if_fail (CLUTTER_IS_STAGE (stage));
   g_return_if_fail (projection != NULL);
diff --git a/clutter/clutter/clutter-util.c b/clutter/clutter/clutter-util.c
index 5ead95b3db..7d4d1f2c0e 100644
--- a/clutter/clutter/clutter-util.c
+++ b/clutter/clutter/clutter-util.c
@@ -56,14 +56,14 @@ typedef struct
 } ClutterVertex4;
 
 void
-_clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
-                                        const CoglMatrix *projection,
-                                        const float *viewport,
+_clutter_util_fully_transform_vertices (const graphene_matrix_t  *modelview,
+                                        const graphene_matrix_t  *projection,
+                                        const float              *viewport,
                                         const graphene_point3d_t *vertices_in,
-                                        graphene_point3d_t *vertices_out,
-                                        int n_vertices)
+                                        graphene_point3d_t       *vertices_out,
+                                        int                       n_vertices)
 {
-  CoglMatrix modelview_projection;
+  graphene_matrix_t modelview_projection;
   ClutterVertex4 *vertices_tmp;
   int i;
 
diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c
index b682662003..6483973e40 100644
--- a/clutter/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/clutter/cogl/clutter-stage-cogl.c
@@ -165,7 +165,7 @@ paint_damage_region (ClutterStageWindow *stage_window,
   static CoglPipeline *overlay_blue = NULL;
   ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
   ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
-  CoglMatrix transform;
+  graphene_matrix_t transform;
   int n_rects, i;
 
   cogl_framebuffer_push_matrix (framebuffer);
diff --git a/cogl/cogl/cogl-clip-stack.c b/cogl/cogl/cogl-clip-stack.c
index aa3172e2e9..0deb576b10 100644
--- a/cogl/cogl/cogl-clip-stack.c
+++ b/cogl/cogl/cogl-clip-stack.c
@@ -69,14 +69,14 @@ _cogl_clip_stack_push_entry (CoglClipStack *clip_stack,
 }
 
 static void
-get_transformed_corners (float x_1,
-                         float y_1,
-                         float x_2,
-                         float y_2,
-                         CoglMatrix *modelview,
-                         CoglMatrix *projection,
-                         const float *viewport,
-                         float *transformed_corners)
+get_transformed_corners (float              x_1,
+                         float              y_1,
+                         float              x_2,
+                         float              y_2,
+                         graphene_matrix_t *modelview,
+                         graphene_matrix_t *projection,
+                         const float       *viewport,
+                         float             *transformed_corners)
 {
   int i;
 
@@ -160,9 +160,9 @@ _cogl_clip_stack_push_rectangle (CoglClipStack *stack,
                                  const float *viewport)
 {
   CoglClipStackRect *entry;
-  CoglMatrix modelview;
-  CoglMatrix projection;
-  CoglMatrix modelview_projection;
+  graphene_matrix_t modelview;
+  graphene_matrix_t projection;
+  graphene_matrix_t modelview_projection;
 
   /* Corners of the given rectangle in an clockwise order:
    *  (0, 1)     (2, 3)
@@ -260,8 +260,8 @@ _cogl_clip_stack_push_primitive (CoglClipStack *stack,
                                  const float *viewport)
 {
   CoglClipStackPrimitive *entry;
-  CoglMatrix modelview;
-  CoglMatrix projection;
+  graphene_matrix_t modelview;
+  graphene_matrix_t projection;
   float transformed_corners[8];
 
   entry = _cogl_clip_stack_push_entry (stack,
diff --git a/cogl/cogl/cogl-context-private.h b/cogl/cogl/cogl-context-private.h
index 74206a4449..3bccd51d8e 100644
--- a/cogl/cogl/cogl-context-private.h
+++ b/cogl/cogl/cogl-context-private.h
@@ -111,8 +111,8 @@ struct _CoglContext
   gboolean          legacy_backface_culling_enabled;
 
   /* A few handy matrix constants */
-  CoglMatrix        identity_matrix;
-  CoglMatrix        y_flip_matrix;
+  graphene_matrix_t identity_matrix;
+  graphene_matrix_t y_flip_matrix;
 
   /* The matrix stack entries that should be flushed during the next
    * pipeline state flush */
diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c
index a2ad821ae2..82ef0aad3c 100644
--- a/cogl/cogl/cogl-framebuffer.c
+++ b/cogl/cogl/cogl-framebuffer.c
@@ -1503,8 +1503,8 @@ cogl_framebuffer_rotate_euler (CoglFramebuffer *framebuffer,
 }
 
 void
-cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
-                            const CoglMatrix *matrix)
+cogl_framebuffer_transform (CoglFramebuffer         *framebuffer,
+                            const graphene_matrix_t *matrix)
 {
   CoglMatrixStack *modelview_stack =
     _cogl_framebuffer_get_modelview_stack (framebuffer);
@@ -1577,7 +1577,7 @@ cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
                                float near,
                                float far)
 {
-  CoglMatrix ortho;
+  graphene_matrix_t ortho;
   CoglMatrixStack *projection_stack =
     _cogl_framebuffer_get_projection_stack (framebuffer);
 
@@ -1595,8 +1595,8 @@ cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
 }
 
 void
-cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
-                                       CoglMatrix *matrix)
+cogl_framebuffer_get_modelview_matrix (CoglFramebuffer   *framebuffer,
+                                       graphene_matrix_t *matrix)
 {
   CoglMatrixEntry *modelview_entry =
     _cogl_framebuffer_get_modelview_entry (framebuffer);
@@ -1605,8 +1605,8 @@ cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
 }
 
 void
-cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
-                                       const CoglMatrix *matrix)
+cogl_framebuffer_set_modelview_matrix (CoglFramebuffer         *framebuffer,
+                                       const graphene_matrix_t *matrix)
 {
   CoglMatrixStack *modelview_stack =
     _cogl_framebuffer_get_modelview_stack (framebuffer);
@@ -1620,8 +1620,8 @@ cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
 }
 
 void
-cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
-                                        CoglMatrix *matrix)
+cogl_framebuffer_get_projection_matrix (CoglFramebuffer   *framebuffer,
+                                        graphene_matrix_t *matrix)
 {
   CoglMatrixEntry *projection_entry =
     _cogl_framebuffer_get_projection_entry (framebuffer);
@@ -1630,8 +1630,8 @@ cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
 }
 
 void
-cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
-                                        const CoglMatrix *matrix)
+cogl_framebuffer_set_projection_matrix (CoglFramebuffer         *framebuffer,
+                                        const graphene_matrix_t *matrix)
 {
   CoglMatrixStack *projection_stack =
     _cogl_framebuffer_get_projection_stack (framebuffer);
diff --git a/cogl/cogl/cogl-framebuffer.h b/cogl/cogl/cogl-framebuffer.h
index 209c4d379c..22af34fa04 100644
--- a/cogl/cogl/cogl-framebuffer.h
+++ b/cogl/cogl/cogl-framebuffer.h
@@ -390,8 +390,8 @@ cogl_framebuffer_rotate_euler (CoglFramebuffer *framebuffer,
  * Stability: unstable
  */
 COGL_EXPORT void
-cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
-                            const CoglMatrix *matrix);
+cogl_framebuffer_transform (CoglFramebuffer         *framebuffer,
+                            const graphene_matrix_t *matrix);
 
 /**
  * cogl_framebuffer_get_modelview_matrix:
@@ -404,8 +404,8 @@ cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
  * Stability: unstable
  */
 COGL_EXPORT void
-cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
-                                       CoglMatrix *matrix);
+cogl_framebuffer_get_modelview_matrix (CoglFramebuffer   *framebuffer,
+                                       graphene_matrix_t *matrix);
 
 /**
  * cogl_framebuffer_set_modelview_matrix:
@@ -418,8 +418,8 @@ cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
  * Stability: unstable
  */
 COGL_EXPORT void
-cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
-                                       const CoglMatrix *matrix);
+cogl_framebuffer_set_modelview_matrix (CoglFramebuffer         *framebuffer,
+                                       const graphene_matrix_t *matrix);
 
 /**
  * cogl_framebuffer_perspective:
@@ -518,8 +518,8 @@ cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
  * Stability: unstable
  */
 COGL_EXPORT void
-cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
-                                        CoglMatrix *matrix);
+cogl_framebuffer_get_projection_matrix (CoglFramebuffer   *framebuffer,
+                                        graphene_matrix_t *matrix);
 
 /**
  * cogl_framebuffer_set_projection_matrix:
@@ -532,8 +532,8 @@ cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
  * Stability: unstable
  */
 COGL_EXPORT void
-cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
-                                        const CoglMatrix *matrix);
+cogl_framebuffer_set_projection_matrix (CoglFramebuffer         *framebuffer,
+                                        const graphene_matrix_t *matrix);
 
 /**
  * cogl_framebuffer_push_scissor_clip:
diff --git a/cogl/cogl/cogl-journal.c b/cogl/cogl/cogl-journal.c
index 33e1ea0346..498e4d877b 100644
--- a/cogl/cogl/cogl-journal.c
+++ b/cogl/cogl/cogl-journal.c
@@ -1161,7 +1161,7 @@ upload_vertices (CoglJournal *journal,
   int entry_num;
   int i;
   CoglMatrixEntry *last_modelview_entry = NULL;
-  CoglMatrix modelview;
+  graphene_matrix_t modelview;
 
   g_assert (needed_vbo_len);
 
@@ -1643,8 +1643,8 @@ entry_to_screen_polygon (CoglFramebuffer *framebuffer,
   size_t array_stride =
     GET_JOURNAL_ARRAY_STRIDE_FOR_N_LAYERS (entry->n_layers);
   CoglMatrixStack *projection_stack;
-  CoglMatrix projection;
-  CoglMatrix modelview;
+  graphene_matrix_t projection;
+  graphene_matrix_t modelview;
   int i;
   const float *viewport = entry->viewport;
 
diff --git a/cogl/cogl/cogl-matrix-private.h b/cogl/cogl/cogl-matrix-private.h
index 0add3e4c2b..ec97043421 100644
--- a/cogl/cogl/cogl-matrix-private.h
+++ b/cogl/cogl/cogl-matrix-private.h
@@ -46,11 +46,11 @@ G_BEGIN_DECLS
     }
 
 void
-_cogl_matrix_prefix_print (const char *prefix, const CoglMatrix *matrix);
+_cogl_matrix_prefix_print (const char *prefix, const graphene_matrix_t *matrix);
 
 void
-_cogl_matrix_init_from_matrix_without_inverse (CoglMatrix *matrix,
-                                               const CoglMatrix *src);
+_cogl_matrix_init_from_matrix_without_inverse (graphene_matrix_t *matrix,
+                                               const graphene_matrix_t *src);
 
 G_END_DECLS
 
diff --git a/cogl/cogl/cogl-matrix-stack-private.h b/cogl/cogl/cogl-matrix-stack-private.h
index 7a6e8b587d..1ee2319def 100644
--- a/cogl/cogl/cogl-matrix-stack-private.h
+++ b/cogl/cogl/cogl-matrix-stack-private.h
@@ -102,7 +102,7 @@ typedef struct _CoglMatrixEntryMultiply
 {
   CoglMatrixEntry _parent_data;
 
-  CoglMatrix *matrix;
+  graphene_matrix_t *matrix;
 
 } CoglMatrixEntryMultiply;
 
@@ -110,7 +110,7 @@ typedef struct _CoglMatrixEntryLoad
 {
   CoglMatrixEntry _parent_data;
 
-  CoglMatrix *matrix;
+  graphene_matrix_t *matrix;
 
 } CoglMatrixEntryLoad;
 
@@ -118,7 +118,7 @@ typedef struct _CoglMatrixEntrySave
 {
   CoglMatrixEntry _parent_data;
 
-  CoglMatrix *cache;
+  graphene_matrix_t *cache;
   gboolean cache_valid;
 
 } CoglMatrixEntrySave;
diff --git a/cogl/cogl/cogl-matrix-stack.c b/cogl/cogl/cogl-matrix-stack.c
index 1c878c09f0..a4a2d77f41 100644
--- a/cogl/cogl/cogl-matrix-stack.c
+++ b/cogl/cogl/cogl-matrix-stack.c
@@ -202,8 +202,8 @@ cogl_matrix_stack_scale (CoglMatrixStack *stack,
 }
 
 void
-cogl_matrix_stack_multiply (CoglMatrixStack *stack,
-                            const CoglMatrix *matrix)
+cogl_matrix_stack_multiply (CoglMatrixStack         *stack,
+                            const graphene_matrix_t *matrix)
 {
   CoglMatrixEntryMultiply *entry;
 
@@ -216,8 +216,8 @@ cogl_matrix_stack_multiply (CoglMatrixStack *stack,
 }
 
 void
-cogl_matrix_stack_set (CoglMatrixStack *stack,
-                       const CoglMatrix *matrix)
+cogl_matrix_stack_set (CoglMatrixStack         *stack,
+                       const graphene_matrix_t *matrix)
 {
   CoglMatrixEntryLoad *entry;
 
@@ -404,11 +404,11 @@ cogl_matrix_stack_pop (CoglMatrixStack *stack)
 }
 
 gboolean
-cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
-                                CoglMatrix *inverse)
+cogl_matrix_stack_get_inverse (CoglMatrixStack   *stack,
+                               graphene_matrix_t *inverse)
 {
-  CoglMatrix matrix;
-  CoglMatrix *internal = cogl_matrix_stack_get (stack, &matrix);
+  graphene_matrix_t matrix;
+  graphene_matrix_t *internal = cogl_matrix_stack_get (stack, &matrix);
 
   if (internal)
     return cogl_matrix_get_inverse (internal, inverse);
@@ -421,9 +421,9 @@ cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
  * to a matrix too so if we are querying the inverse matrix we
  * should query from the return matrix so that the result can
  * be cached within the stack. */
-CoglMatrix *
-cogl_matrix_entry_get (CoglMatrixEntry *entry,
-                        CoglMatrix *matrix)
+graphene_matrix_t *
+cogl_matrix_entry_get (CoglMatrixEntry   *entry,
+                       graphene_matrix_t *matrix)
 {
   int depth;
   CoglMatrixEntry *current;
@@ -599,9 +599,9 @@ cogl_matrix_stack_get_entry (CoglMatrixStack *stack)
  * to a matrix too so if we are querying the inverse matrix we
  * should query from the return matrix so that the result can
  * be cached within the stack. */
-CoglMatrix *
-cogl_matrix_stack_get (CoglMatrixStack *stack,
-                       CoglMatrix *matrix)
+graphene_matrix_t *
+cogl_matrix_stack_get (CoglMatrixStack   *stack,
+                       graphene_matrix_t *matrix)
 {
   return cogl_matrix_entry_get (stack->last_entry, matrix);
 }
@@ -623,7 +623,7 @@ cogl_matrix_stack_new (CoglContext *ctx)
       cogl_matrix_stack_magazine =
         _cogl_magazine_new (sizeof (CoglMatrixEntryFull), 20);
       cogl_matrix_stack_matrices_magazine =
-        _cogl_magazine_new (sizeof (CoglMatrix), 20);
+        _cogl_magazine_new (sizeof (graphene_matrix_t), 20);
     }
 
   stack->context = ctx;
diff --git a/cogl/cogl/cogl-matrix-stack.h b/cogl/cogl/cogl-matrix-stack.h
index 0cda127902..1b83a8e246 100644
--- a/cogl/cogl/cogl-matrix-stack.h
+++ b/cogl/cogl/cogl-matrix-stack.h
@@ -53,11 +53,11 @@
  * transforms of objects, texture transforms, and projective
  * transforms.
  *
- * The #CoglMatrix api provides a good way to manipulate individual
+ * The #graphene_matrix_t api provides a good way to manipulate individual
  * matrices representing a single transformation but if you need to
  * track many-many such transformations for many objects that are
  * organized in a scenegraph for example then using a separate
- * #CoglMatrix for each object may not be the most efficient way.
+ * #graphene_matrix_t for each object may not be the most efficient way.
  *
  * A #CoglMatrixStack enables applications to track lots of
  * transformations that are related to each other in some kind of
@@ -70,7 +70,7 @@
  * transformation. The #CoglMatrixStack API is suited to tracking lots
  * of transformations that fit this kind of model.
  *
- * Compared to using the #CoglMatrix api directly to track many
+ * Compared to using the #graphene_matrix_t api directly to track many
  * related transforms, these can be some advantages to using a
  * #CoglMatrixStack:
  * <itemizedlist>
@@ -83,14 +83,14 @@
  * </itemizedlist>
  *
  * For reference (to give an idea of when a #CoglMatrixStack can
- * provide a space saving) a #CoglMatrix can be expected to take 72
+ * provide a space saving) a #graphene_matrix_t can be expected to take 72
  * bytes whereas a single #CoglMatrixEntry in a #CoglMatrixStack is
  * currently around 32 bytes on a 32bit CPU or 36 bytes on a 64bit
  * CPU. An entry is needed for each individual operation applied to
  * the stack (such as rotate, scale, translate) so if most of your
  * leaf node transformations only need one or two simple operations
  * relative to their parent then a matrix stack will likely take less
- * space than having a #CoglMatrix for each node.
+ * space than having a #graphene_matrix_t for each node.
  *
  * Even without any space saving though the ability to perform fast
  * comparisons and avoid redundant arithmetic (especially sine and
@@ -329,8 +329,8 @@ cogl_matrix_stack_rotate_euler (CoglMatrixStack *stack,
  * Multiplies the current matrix by the given matrix.
  */
 COGL_EXPORT void
-cogl_matrix_stack_multiply (CoglMatrixStack *stack,
-                            const CoglMatrix *matrix);
+cogl_matrix_stack_multiply (CoglMatrixStack         *stack,
+                            const graphene_matrix_t *matrix);
 
 /**
  * cogl_matrix_stack_frustum:
@@ -414,15 +414,15 @@ cogl_matrix_stack_orthographic (CoglMatrixStack *stack,
  * @inverse: (out): The destination for a 4x4 inverse transformation matrix
  *
  * Gets the inverse transform of the current matrix and uses it to
- * initialize a new #CoglMatrix.
+ * initialize a new #graphene_matrix_t.
  *
  * Return value: %TRUE if the inverse was successfully calculated or %FALSE
  *   for degenerate transformations that can't be inverted (in this case the
  *   @inverse matrix will simply be initialized with the identity matrix)
  */
 COGL_EXPORT gboolean
-cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
-                               CoglMatrix *inverse);
+cogl_matrix_stack_get_inverse (CoglMatrixStack   *stack,
+                               graphene_matrix_t *inverse);
 
 /**
  * cogl_matrix_stack_get_entry:
@@ -450,13 +450,13 @@ cogl_matrix_stack_get_entry (CoglMatrixStack *stack);
  * @stack: A #CoglMatrixStack
  * @matrix: (out): The potential destination for the current matrix
  *
- * Resolves the current @stack transform into a #CoglMatrix by
+ * Resolves the current @stack transform into a #graphene_matrix_t by
  * combining the operations that have been applied to build up the
  * current transform.
  *
  * There are two possible ways that this function may return its
  * result depending on whether the stack is able to directly point
- * to an internal #CoglMatrix or whether the result needs to be
+ * to an internal #graphene_matrix_t or whether the result needs to be
  * composed of multiple operations.
  *
  * If an internal matrix contains the required result then this
@@ -471,9 +471,9 @@ cogl_matrix_stack_get_entry (CoglMatrixStack *stack);
  *               and in that case @matrix will be initialized with
  *               the value of the current transform.
  */
-COGL_EXPORT CoglMatrix *
-cogl_matrix_stack_get (CoglMatrixStack *stack,
-                       CoglMatrix *matrix);
+COGL_EXPORT graphene_matrix_t *
+cogl_matrix_stack_get (CoglMatrixStack   *stack,
+                       graphene_matrix_t *matrix);
 
 /**
  * cogl_matrix_entry_get:
@@ -481,13 +481,13 @@ cogl_matrix_stack_get (CoglMatrixStack *stack,
  * @matrix: (out): The potential destination for the transform as
  *                 a matrix
  *
- * Resolves the current @entry transform into a #CoglMatrix by
+ * Resolves the current @entry transform into a #graphene_matrix_t by
  * combining the sequence of operations that have been applied to
  * build up the current transform.
  *
  * There are two possible ways that this function may return its
  * result depending on whether it's possible to directly point
- * to an internal #CoglMatrix or whether the result needs to be
+ * to an internal #graphene_matrix_t or whether the result needs to be
  * composed of multiple operations.
  *
  * If an internal matrix contains the required result then this
@@ -498,18 +498,18 @@ cogl_matrix_stack_get (CoglMatrixStack *stack,
  * <note>@matrix will be left untouched if a direct pointer is
  * returned.</note>
  *
- * Return value: A direct pointer to a #CoglMatrix transform or %NULL
+ * Return value: A direct pointer to a #graphene_matrix_t transform or %NULL
  *               and in that case @matrix will be initialized with
  *               the effective transform represented by @entry.
  */
-COGL_EXPORT CoglMatrix *
-cogl_matrix_entry_get (CoglMatrixEntry *entry,
-                       CoglMatrix *matrix);
+COGL_EXPORT graphene_matrix_t *
+cogl_matrix_entry_get (CoglMatrixEntry   *entry,
+                       graphene_matrix_t *matrix);
 
 /**
  * cogl_matrix_stack_set:
  * @stack: A #CoglMatrixStack
- * @matrix: A #CoglMatrix replace the current matrix value with
+ * @matrix: A #graphene_matrix_t replace the current matrix value with
  *
  * Replaces the current @stack matrix value with the value of @matrix.
  * This effectively discards any other operations that were applied
@@ -517,8 +517,8 @@ cogl_matrix_entry_get (CoglMatrixEntry *entry,
  * the stack was initialized.
  */
 COGL_EXPORT void
-cogl_matrix_stack_set (CoglMatrixStack *stack,
-                       const CoglMatrix *matrix);
+cogl_matrix_stack_set (CoglMatrixStack         *stack,
+                       const graphene_matrix_t *matrix);
 
 /**
  * cogl_is_matrix_stack:
diff --git a/cogl/cogl/cogl-matrix.c b/cogl/cogl/cogl-matrix.c
index 81ec4970d1..6ca5bac040 100644
--- a/cogl/cogl/cogl-matrix.c
+++ b/cogl/cogl/cogl-matrix.c
@@ -43,25 +43,26 @@
 #include <string.h>
 
 void
-cogl_matrix_multiply (CoglMatrix *result,
-                     const CoglMatrix *a,
-                     const CoglMatrix *b)
+cogl_matrix_multiply (graphene_matrix_t       *result,
+                      const graphene_matrix_t *a,
+                      const graphene_matrix_t *b)
 {
   graphene_matrix_multiply (b, a, result);
   _COGL_MATRIX_DEBUG_PRINT (result);
 }
 
 void
-_cogl_matrix_prefix_print (const char *prefix, const CoglMatrix *matrix)
+_cogl_matrix_prefix_print (const char              *prefix,
+                           const graphene_matrix_t *matrix)
 {
   graphene_matrix_print (matrix);
 }
 
 /*
- * Dumps the contents of a CoglMatrix structure.
+ * Dumps the contents of a graphene_matrix_t structure.
  */
 void
-cogl_debug_matrix_print (const CoglMatrix *matrix)
+cogl_debug_matrix_print (const graphene_matrix_t *matrix)
 {
   _cogl_matrix_prefix_print ("", matrix);
 }
@@ -69,21 +70,21 @@ cogl_debug_matrix_print (const CoglMatrix *matrix)
 /*
  * Compute inverse of a transformation matrix.
  *
- * @mat pointer to a CoglMatrix structure. The matrix inverse will be
- * stored in the CoglMatrix::inv attribute.
+ * @mat pointer to a graphene_matrix_t structure. The matrix inverse will be
+ * stored in the graphene_matrix_t::inv attribute.
  *
  * Returns: %TRUE for success, %FALSE for failure (\p singular matrix).
  *
  * Calls the matrix inversion function in inv_mat_tab corresponding to the
  * given matrix type.  In case of failure, updates the MAT_FLAG_SINGULAR flag,
- * and copies the identity matrix into CoglMatrix::inv.
+ * and copies the identity matrix into graphene_matrix_t::inv.
  */
 
 #define SCALE 1000.F
 
 static inline gboolean
-calculate_inverse (const CoglMatrix *matrix,
-                   CoglMatrix       *inverse)
+calculate_inverse (const graphene_matrix_t *matrix,
+                   graphene_matrix_t       *inverse)
 {
   graphene_matrix_t scaled;
   graphene_matrix_t m;
@@ -106,17 +107,18 @@ calculate_inverse (const CoglMatrix *matrix,
 }
 
 gboolean
-cogl_matrix_get_inverse (const CoglMatrix *matrix, CoglMatrix *inverse)
+cogl_matrix_get_inverse (const graphene_matrix_t *matrix,
+                         graphene_matrix_t       *inverse)
 {
   return calculate_inverse (matrix, inverse);
 }
 
 void
-cogl_matrix_rotate (CoglMatrix *matrix,
-                   float angle,
-                   float x,
-                   float y,
-                   float z)
+cogl_matrix_rotate (graphene_matrix_t *matrix,
+                    float              angle,
+                    float              x,
+                    float              y,
+                    float              z)
 {
   graphene_matrix_t rotation;
   graphene_vec3_t axis;
@@ -129,23 +131,23 @@ cogl_matrix_rotate (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_rotate_euler (CoglMatrix *matrix,
+cogl_matrix_rotate_euler (graphene_matrix_t      *matrix,
                           const graphene_euler_t *euler)
 {
-  CoglMatrix rotation_transform;
+  graphene_matrix_t rotation_transform;
 
   cogl_matrix_init_from_euler (&rotation_transform, euler);
   cogl_matrix_multiply (matrix, matrix, &rotation_transform);
 }
 
 void
-cogl_matrix_frustum (CoglMatrix *matrix,
-                     float       left,
-                     float       right,
-                     float       bottom,
-                     float       top,
-                     float       z_near,
-                     float       z_far)
+cogl_matrix_frustum (graphene_matrix_t *matrix,
+                     float              left,
+                     float              right,
+                     float              bottom,
+                     float              top,
+                     float              z_near,
+                     float              z_far)
 {
   graphene_matrix_t frustum;
 
@@ -159,11 +161,11 @@ cogl_matrix_frustum (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_perspective (CoglMatrix *matrix,
-                         float       fov_y,
-                         float       aspect,
-                         float       z_near,
-                         float       z_far)
+cogl_matrix_perspective (graphene_matrix_t *matrix,
+                         float              fov_y,
+                         float              aspect,
+                         float              z_near,
+                         float              z_far)
 {
   float ymax = z_near * tan (fov_y * G_PI / 360.0);
 
@@ -178,13 +180,13 @@ cogl_matrix_perspective (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_orthographic (CoglMatrix *matrix,
-                          float left,
-                          float bottom,
-                          float right,
-                          float top,
-                          float near,
-                          float far)
+cogl_matrix_orthographic (graphene_matrix_t *matrix,
+                          float              left,
+                          float              bottom,
+                          float              right,
+                          float              top,
+                          float              near,
+                          float              far)
 {
   graphene_matrix_t ortho;
 
@@ -198,10 +200,10 @@ cogl_matrix_orthographic (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_scale (CoglMatrix *matrix,
-                  float sx,
-                  float sy,
-                  float sz)
+cogl_matrix_scale (graphene_matrix_t *matrix,
+                   float              sx,
+                   float              sy,
+                   float              sz)
 {
   graphene_matrix_t scale;
 
@@ -212,10 +214,10 @@ cogl_matrix_scale (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_translate (CoglMatrix *matrix,
-                      float x,
-                      float y,
-                      float z)
+cogl_matrix_translate (graphene_matrix_t *matrix,
+                       float              x,
+                       float              y,
+                       float              z)
 {
   graphene_matrix_t translation;
 
@@ -227,61 +229,63 @@ cogl_matrix_translate (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_init_identity (CoglMatrix *matrix)
+cogl_matrix_init_identity (graphene_matrix_t *matrix)
 {
   graphene_matrix_init_identity (matrix);
   _COGL_MATRIX_DEBUG_PRINT (matrix);
 }
 
 void
-cogl_matrix_init_translation (CoglMatrix *matrix,
-                              float       tx,
-                              float       ty,
-                              float       tz)
+cogl_matrix_init_translation (graphene_matrix_t *matrix,
+                              float              tx,
+                              float              ty,
+                              float              tz)
 {
   graphene_matrix_init_translate (matrix, &GRAPHENE_POINT3D_INIT (tx, ty, tz));
   _COGL_MATRIX_DEBUG_PRINT (matrix);
 }
 
 /*
- * Loads a matrix array into CoglMatrix.
+ * Loads a matrix array into graphene_matrix_t.
  *
  * @m matrix array.
  * @mat matrix.
  *
- * Copies \p m into CoglMatrix::m and marks the MAT_FLAG_GENERAL and
+ * Copies \p m into graphene_matrix_t::m and marks the MAT_FLAG_GENERAL and
  * MAT_DIRTY_ALL
  * flags.
  */
 static void
-_cogl_matrix_init_from_array (CoglMatrix *matrix, const float *array)
+_cogl_matrix_init_from_array (graphene_matrix_t *matrix,
+                              const float       *array)
 {
   graphene_matrix_init_from_float (matrix, array);
 }
 
 void
-cogl_matrix_init_from_array (CoglMatrix *matrix, const float *array)
+cogl_matrix_init_from_array (graphene_matrix_t *matrix,
+                             const float       *array)
 {
   _cogl_matrix_init_from_array (matrix, array);
   _COGL_MATRIX_DEBUG_PRINT (matrix);
 }
 
 void
-cogl_matrix_init_from_matrix (CoglMatrix       *matrix,
-                              const CoglMatrix *source)
+cogl_matrix_init_from_matrix (graphene_matrix_t       *matrix,
+                              const graphene_matrix_t *source)
 {
-  memcpy (matrix, source, sizeof (CoglMatrix));
+  memcpy (matrix, source, sizeof (graphene_matrix_t));
 }
 
 void
-_cogl_matrix_init_from_matrix_without_inverse (CoglMatrix *matrix,
-                                               const CoglMatrix *src)
+_cogl_matrix_init_from_matrix_without_inverse (graphene_matrix_t       *matrix,
+                                               const graphene_matrix_t *src)
 {
   graphene_matrix_init_from_matrix (matrix, src);
 }
 
 void
-cogl_matrix_init_from_euler (CoglMatrix *matrix,
+cogl_matrix_init_from_euler (graphene_matrix_t      *matrix,
                              const graphene_euler_t *euler)
 {
   graphene_matrix_init_identity (matrix);
@@ -289,15 +293,15 @@ cogl_matrix_init_from_euler (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
-                                float left,
-                                float right,
-                                float bottom,
-                                float top,
-                                float z_near,
-                                float z_2d,
-                                float width_2d,
-                                float height_2d)
+cogl_matrix_view_2d_in_frustum (graphene_matrix_t *matrix,
+                                float              left,
+                                float              right,
+                                float              bottom,
+                                float              top,
+                                float              z_near,
+                                float              z_2d,
+                                float              width_2d,
+                                float              height_2d)
 {
   float left_2d_plane = left / z_near * z_2d;
   float right_2d_plane = right / z_near * z_2d;
@@ -325,13 +329,13 @@ cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
  * given width and height.
  */
 void
-cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
-                                    float fov_y,
-                                    float aspect,
-                                    float z_near,
-                                    float z_2d,
-                                    float width_2d,
-                                    float height_2d)
+cogl_matrix_view_2d_in_perspective (graphene_matrix_t *matrix,
+                                    float              fov_y,
+                                    float              aspect,
+                                    float              z_near,
+                                    float              z_2d,
+                                    float              width_2d,
+                                    float              height_2d)
 {
   float top = z_near * tan (fov_y * G_PI / 360.0);
   cogl_matrix_view_2d_in_frustum (matrix,
@@ -348,8 +352,8 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
 gboolean
 cogl_matrix_equal (const void *v1, const void *v2)
 {
-  const CoglMatrix *a = v1;
-  const CoglMatrix *b = v2;
+  const graphene_matrix_t *a = v1;
+  const graphene_matrix_t *b = v2;
 
   g_return_val_if_fail (v1 != NULL, FALSE);
   g_return_val_if_fail (v2 != NULL, FALSE);
@@ -357,58 +361,58 @@ cogl_matrix_equal (const void *v1, const void *v2)
   return graphene_matrix_equal_fast (a, b);
 }
 
-CoglMatrix *
-cogl_matrix_copy (const CoglMatrix *matrix)
+graphene_matrix_t *
+cogl_matrix_copy (const graphene_matrix_t *matrix)
 {
   if (G_LIKELY (matrix))
-    return g_slice_dup (CoglMatrix, matrix);
+    return g_slice_dup (graphene_matrix_t, matrix);
 
   return NULL;
 }
 
 void
-cogl_matrix_free (CoglMatrix *matrix)
+cogl_matrix_free (graphene_matrix_t *matrix)
 {
-  g_slice_free (CoglMatrix, matrix);
+  g_slice_free (graphene_matrix_t, matrix);
 }
 
 void
-cogl_matrix_to_float (const CoglMatrix *matrix,
-                      float            *out_array)
+cogl_matrix_to_float (const graphene_matrix_t *matrix,
+                      float                   *out_array)
 {
   graphene_matrix_to_float (matrix, out_array);
 }
 
 float
-cogl_matrix_get_value (const CoglMatrix *matrix,
-                       unsigned int      row,
-                       unsigned int      column)
+cogl_matrix_get_value (const graphene_matrix_t *matrix,
+                       unsigned int             row,
+                       unsigned int             column)
 {
   return graphene_matrix_get_value (matrix, column, row);
 }
 
 gboolean
-cogl_matrix_is_identity (const CoglMatrix *matrix)
+cogl_matrix_is_identity (const graphene_matrix_t *matrix)
 {
   return graphene_matrix_is_identity (matrix);
 }
 
 void
-cogl_matrix_look_at (CoglMatrix *matrix,
-                     float eye_position_x,
-                     float eye_position_y,
-                     float eye_position_z,
-                     float object_x,
-                     float object_y,
-                     float object_z,
-                     float world_up_x,
-                     float world_up_y,
-                     float world_up_z)
+cogl_matrix_look_at (graphene_matrix_t *matrix,
+                     float              eye_position_x,
+                     float              eye_position_y,
+                     float              eye_position_z,
+                     float              object_x,
+                     float              object_y,
+                     float              object_z,
+                     float              world_up_x,
+                     float              world_up_y,
+                     float              world_up_z)
 {
   graphene_vec3_t eye;
   graphene_vec3_t center;
   graphene_vec3_t up;
-  CoglMatrix look_at;
+  graphene_matrix_t look_at;
 
   graphene_vec3_init (&eye, eye_position_x, eye_position_y, eye_position_z);
   graphene_vec3_init (&center, object_x, object_y, object_z);
@@ -420,7 +424,7 @@ cogl_matrix_look_at (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_transpose (CoglMatrix *matrix)
+cogl_matrix_transpose (graphene_matrix_t *matrix)
 {
   /* We don't need to do anything if the matrix is the identity matrix */
   if (graphene_matrix_is_identity (matrix))
@@ -430,8 +434,8 @@ cogl_matrix_transpose (CoglMatrix *matrix)
 }
 
 void
-cogl_matrix_skew_xy (CoglMatrix *matrix,
-                     float       factor)
+cogl_matrix_skew_xy (graphene_matrix_t *matrix,
+                     float              factor)
 {
   graphene_matrix_t skew;
 
@@ -443,8 +447,8 @@ cogl_matrix_skew_xy (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_skew_xz (CoglMatrix *matrix,
-                     float       factor)
+cogl_matrix_skew_xz (graphene_matrix_t *matrix,
+                     float              factor)
 {
   graphene_matrix_t skew;
 
@@ -456,8 +460,8 @@ cogl_matrix_skew_xz (CoglMatrix *matrix,
 }
 
 void
-cogl_matrix_skew_yz (CoglMatrix *matrix,
-                     float       factor)
+cogl_matrix_skew_yz (graphene_matrix_t *matrix,
+                     float              factor)
 {
   graphene_matrix_t skew;
 
diff --git a/cogl/cogl/cogl-matrix.h b/cogl/cogl/cogl-matrix.h
index 601c29c69b..affbdf8d6b 100644
--- a/cogl/cogl/cogl-matrix.h
+++ b/cogl/cogl/cogl-matrix.h
@@ -70,7 +70,7 @@ G_BEGIN_DECLS
  * ]|
  */
 COGL_EXPORT void
-cogl_matrix_init_identity (CoglMatrix *matrix);
+cogl_matrix_init_identity (graphene_matrix_t *matrix);
 
 /**
  * cogl_matrix_init_translation:
@@ -91,10 +91,10 @@ cogl_matrix_init_identity (CoglMatrix *matrix);
  * Since: 2.0
  */
 COGL_EXPORT void
-cogl_matrix_init_translation (CoglMatrix *matrix,
-                              float       tx,
-                              float       ty,
-                              float       tz);
+cogl_matrix_init_translation (graphene_matrix_t *matrix,
+                              float              tx,
+                              float              ty,
+                              float              tz);
 
 /**
  * cogl_matrix_multiply:
@@ -109,9 +109,9 @@ cogl_matrix_init_translation (CoglMatrix *matrix,
  * @result can be equal to @a but can't be equal to @b.</note>
  */
 COGL_EXPORT void
-cogl_matrix_multiply (CoglMatrix *result,
-                     const CoglMatrix *a,
-                     const CoglMatrix *b);
+cogl_matrix_multiply (graphene_matrix_t       *result,
+                      const graphene_matrix_t *a,
+                      const graphene_matrix_t *b);
 
 /**
  * cogl_matrix_rotate:
@@ -125,11 +125,11 @@ cogl_matrix_multiply (CoglMatrix *result,
  * of @angle degrees around the specified 3D vector.
  */
 COGL_EXPORT void
-cogl_matrix_rotate (CoglMatrix *matrix,
-                   float angle,
-                   float x,
-                   float y,
-                   float z);
+cogl_matrix_rotate (graphene_matrix_t *matrix,
+                    float              angle,
+                    float              x,
+                    float              y,
+                    float              z);
 
 /**
  * cogl_matrix_rotate_euler:
@@ -142,7 +142,7 @@ cogl_matrix_rotate (CoglMatrix *matrix,
  * Since: 2.0
  */
 COGL_EXPORT void
-cogl_matrix_rotate_euler (CoglMatrix *matrix,
+cogl_matrix_rotate_euler (graphene_matrix_t      *matrix,
                           const graphene_euler_t *euler);
 
 /**
@@ -156,10 +156,10 @@ cogl_matrix_rotate_euler (CoglMatrix *matrix,
  * the X, Y and Z axis.
  */
 COGL_EXPORT void
-cogl_matrix_translate (CoglMatrix *matrix,
-                      float x,
-                      float y,
-                      float z);
+cogl_matrix_translate (graphene_matrix_t *matrix,
+                       float              x,
+                       float              y,
+                       float              z);
 
 /**
  * cogl_matrix_scale:
@@ -172,7 +172,7 @@ cogl_matrix_translate (CoglMatrix *matrix,
  * Y and Z axis.
  */
 COGL_EXPORT void
-cogl_matrix_scale (CoglMatrix *matrix,
+cogl_matrix_scale (graphene_matrix_t *matrix,
                   float sx,
                   float sy,
                   float sz);
@@ -221,16 +221,16 @@ cogl_matrix_scale (CoglMatrix *matrix,
  * Stability: unstable
  */
 COGL_EXPORT void
-cogl_matrix_look_at (CoglMatrix *matrix,
-                     float eye_position_x,
-                     float eye_position_y,
-                     float eye_position_z,
-                     float object_x,
-                     float object_y,
-                     float object_z,
-                     float world_up_x,
-                     float world_up_y,
-                     float world_up_z);
+cogl_matrix_look_at (graphene_matrix_t *matrix,
+                     float              eye_position_x,
+                     float              eye_position_y,
+                     float              eye_position_z,
+                     float              object_x,
+                     float              object_y,
+                     float              object_z,
+                     float              world_up_x,
+                     float              world_up_y,
+                     float              world_up_z);
 
 /**
  * cogl_matrix_frustum:
@@ -249,13 +249,13 @@ cogl_matrix_look_at (CoglMatrix *matrix,
  * Multiplies @matrix by the given frustum perspective matrix.
  */
 COGL_EXPORT void
-cogl_matrix_frustum (CoglMatrix *matrix,
-                     float       left,
-                     float       right,
-                     float       bottom,
-                     float       top,
-                     float       z_near,
-                     float       z_far);
+cogl_matrix_frustum (graphene_matrix_t *matrix,
+                     float              left,
+                     float              right,
+                     float              bottom,
+                     float              top,
+                     float              z_near,
+                     float              z_far);
 
 /**
  * cogl_matrix_perspective:
@@ -274,11 +274,11 @@ cogl_matrix_frustum (CoglMatrix *matrix,
  * objects near to each other.</note>
  */
 COGL_EXPORT void
-cogl_matrix_perspective (CoglMatrix *matrix,
-                         float       fov_y,
-                         float       aspect,
-                         float       z_near,
-                         float       z_far);
+cogl_matrix_perspective (graphene_matrix_t *matrix,
+                         float              fov_y,
+                         float              aspect,
+                         float              z_near,
+                         float              z_far);
 
 /**
  * cogl_matrix_orthographic:
@@ -300,13 +300,13 @@ cogl_matrix_perspective (CoglMatrix *matrix,
  * Stability: unstable
  */
 COGL_EXPORT void
-cogl_matrix_orthographic (CoglMatrix *matrix,
-                          float left,
-                          float bottom,
-                          float right,
-                          float top,
-                          float near,
-                          float far);
+cogl_matrix_orthographic (graphene_matrix_t *matrix,
+                          float              left,
+                          float              bottom,
+                          float              right,
+                          float              top,
+                          float              near,
+                          float              far);
 
 /**
  * cogl_matrix_view_2d_in_frustum:
@@ -339,15 +339,15 @@ cogl_matrix_orthographic (CoglMatrix *matrix,
  * Stability: unstable
  */
 COGL_EXPORT void
-cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
-                                float left,
-                                float right,
-                                float bottom,
-                                float top,
-                                float z_near,
-                                float z_2d,
-                                float width_2d,
-                                float height_2d);
+cogl_matrix_view_2d_in_frustum (graphene_matrix_t *matrix,
+                                float              left,
+                                float              right,
+                                float              bottom,
+                                float              top,
+                                float              z_near,
+                                float              z_2d,
+                                float              width_2d,
+                                float              height_2d);
 
 /**
  * cogl_matrix_view_2d_in_perspective:
@@ -378,13 +378,13 @@ cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
  * Stability: unstable
  */
 COGL_EXPORT void
-cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
-                                    float fov_y,
-                                    float aspect,
-                                    float z_near,
-                                    float z_2d,
-                                    float width_2d,
-                                    float height_2d);
+cogl_matrix_view_2d_in_perspective (graphene_matrix_t *matrix,
+                                    float              fov_y,
+                                    float              aspect,
+                                    float              z_near,
+                                    float              z_2d,
+                                    float              width_2d,
+                                    float              height_2d);
 
 /**
  * cogl_matrix_init_from_array:
@@ -394,19 +394,19 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
  * Initializes @matrix with the contents of @array
  */
 COGL_EXPORT void
-cogl_matrix_init_from_array (CoglMatrix *matrix,
-                             const float *array);
+cogl_matrix_init_from_array (graphene_matrix_t *matrix,
+                             const float       *array);
 
 /**
  * cogl_matrix_init_from_matrix:
  * @matrix: A 4x4 transformation matrix
- * @source: the #CoglMatrix to copy
+ * @source: the #graphene_matrix_t to copy
  *
  * Initializes @matrix with the contents of @source
  */
 COGL_EXPORT void
-cogl_matrix_init_from_matrix (CoglMatrix       *matrix,
-                              const CoglMatrix *source);
+cogl_matrix_init_from_matrix (graphene_matrix_t       *matrix,
+                              const graphene_matrix_t *source);
 
 /**
  * cogl_matrix_to_float:
@@ -418,8 +418,8 @@ cogl_matrix_init_from_matrix (CoglMatrix       *matrix,
  * Casts @matrix to a float array which can be directly passed to OpenGL.
  */
 COGL_EXPORT void
-cogl_matrix_to_float (const CoglMatrix *matrix,
-                      float            *out_array);
+cogl_matrix_to_float (const graphene_matrix_t *matrix,
+                      float                   *out_array);
 
 /**
  * cogl_matrix_get_value:
@@ -428,9 +428,9 @@ cogl_matrix_to_float (const CoglMatrix *matrix,
  *
  */
 COGL_EXPORT float
-cogl_matrix_get_value (const CoglMatrix *matrix,
-                       unsigned int      row,
-                       unsigned int      column);
+cogl_matrix_get_value (const graphene_matrix_t *matrix,
+                       unsigned int             row,
+                       unsigned int             column);
 
 /**
  * cogl_matrix_init_from_euler:
@@ -440,7 +440,7 @@ cogl_matrix_get_value (const CoglMatrix *matrix,
  * Initializes @matrix from a #graphene_euler_t rotation.
  */
 COGL_EXPORT void
-cogl_matrix_init_from_euler (CoglMatrix *matrix,
+cogl_matrix_init_from_euler (graphene_matrix_t      *matrix,
                              const graphene_euler_t *euler);
 
 /**
@@ -462,28 +462,28 @@ cogl_matrix_equal (const void *v1, const void *v2);
  * cogl_matrix_copy:
  * @matrix: A 4x4 transformation matrix you want to copy
  *
- * Allocates a new #CoglMatrix on the heap and initializes it with
+ * Allocates a new #graphene_matrix_t on the heap and initializes it with
  * the same values as @matrix.
  *
- * Return value: (transfer full): A newly allocated #CoglMatrix which
+ * Return value: (transfer full): A newly allocated #graphene_matrix_t which
  * should be freed using cogl_matrix_free()
  *
  * Since: 1.6
  */
-COGL_EXPORT CoglMatrix *
-cogl_matrix_copy (const CoglMatrix *matrix);
+COGL_EXPORT graphene_matrix_t *
+cogl_matrix_copy (const graphene_matrix_t *matrix);
 
 /**
  * cogl_matrix_free:
  * @matrix: A 4x4 transformation matrix you want to free
  *
- * Frees a #CoglMatrix that was previously allocated via a call to
+ * Frees a #graphene_matrix_t that was previously allocated via a call to
  * cogl_matrix_copy().
  *
  * Since: 1.6
  */
 COGL_EXPORT void
-cogl_matrix_free (CoglMatrix *matrix);
+cogl_matrix_free (graphene_matrix_t *matrix);
 
 /**
  * cogl_matrix_get_inverse:
@@ -491,7 +491,7 @@ cogl_matrix_free (CoglMatrix *matrix);
  * @inverse: (out): The destination for a 4x4 inverse transformation matrix
  *
  * Gets the inverse transform of a given matrix and uses it to initialize
- * a new #CoglMatrix.
+ * a new #graphene_matrix_t.
  *
  * Return value: %TRUE if the inverse was successfully calculated or %FALSE
  *   for degenerate transformations that can't be inverted (in this case the
@@ -500,12 +500,12 @@ cogl_matrix_free (CoglMatrix *matrix);
  * Since: 1.2
  */
 COGL_EXPORT gboolean
-cogl_matrix_get_inverse (const CoglMatrix *matrix,
-                         CoglMatrix *inverse);
+cogl_matrix_get_inverse (const graphene_matrix_t *matrix,
+                         graphene_matrix_t       *inverse);
 
 /**
  * cogl_matrix_is_identity:
- * @matrix: A #CoglMatrix
+ * @matrix: A #graphene_matrix_t
  *
  * Determines if the given matrix is an identity matrix.
  *
@@ -513,11 +513,11 @@ cogl_matrix_get_inverse (const CoglMatrix *matrix,
  * Since: 1.8
  */
 COGL_EXPORT gboolean
-cogl_matrix_is_identity (const CoglMatrix *matrix);
+cogl_matrix_is_identity (const graphene_matrix_t *matrix);
 
 /**
  * cogl_matrix_transpose:
- * @matrix: A #CoglMatrix
+ * @matrix: A #graphene_matrix_t
  *
  * Replaces @matrix with its transpose. Ie, every element (i,j) in the
  * new matrix is taken from element (j,i) in the old matrix.
@@ -525,62 +525,62 @@ cogl_matrix_is_identity (const CoglMatrix *matrix);
  * Since: 1.10
  */
 COGL_EXPORT void
-cogl_matrix_transpose (CoglMatrix *matrix);
+cogl_matrix_transpose (graphene_matrix_t *matrix);
 
 /**
  * cogl_debug_matrix_print:
- * @matrix: A #CoglMatrix
+ * @matrix: A #graphene_matrix_t
  *
- * Prints the contents of a #CoglMatrix to stdout.
+ * Prints the contents of a #graphene_matrix_t to stdout.
  *
  * Since: 2.0
  */
 COGL_EXPORT void
-cogl_debug_matrix_print (const CoglMatrix *matrix);
+cogl_debug_matrix_print (const graphene_matrix_t *matrix);
 
 /**
  * cogl_matrix_determinant:
- * @matrix: a #CoglMatrix
+ * @matrix: a #graphene_matrix_t
  *
  * Computes the determinant of the @matrix.
  *
  * Returns: the value of the determinant
  */
 COGL_EXPORT float
-cogl_matrix_determinant (const CoglMatrix *matrix);
+cogl_matrix_determinant (const graphene_matrix_t *matrix);
 
 /**
  * cogl_matrix_skew_xy:
- * @matrix: a #CoglMatrix
+ * @matrix: a #graphene_matrix_t
  * @factor: skew factor
  *
  * Adds a skew of factor on the X and Y axis to @matrix.
  */
 COGL_EXPORT void
-cogl_matrix_skew_xy (CoglMatrix *matrix,
-                     float       factor);
+cogl_matrix_skew_xy (graphene_matrix_t *matrix,
+                     float              factor);
 
 /**
  * cogl_matrix_skew_xz:
- * @matrix: a #CoglMatrix
+ * @matrix: a #graphene_matrix_t
  * @factor: skew factor
  *
  * Adds a skew of factor on the X and Z axis to @matrix.
  */
 COGL_EXPORT void
-cogl_matrix_skew_xz (CoglMatrix *matrix,
-                     float       factor);
+cogl_matrix_skew_xz (graphene_matrix_t *matrix,
+                     float              factor);
 
 /**
  * cogl_matrix_skew_yz:
- * @matrix: a #CoglMatrix
+ * @matrix: a #graphene_matrix_t
  * @factor: skew factor
  *
  * Adds a skew of factor on the Y and Z axis to @matrix.
  */
 COGL_EXPORT void
-cogl_matrix_skew_yz (CoglMatrix *matrix,
-                     float       factor);
+cogl_matrix_skew_yz (graphene_matrix_t *matrix,
+                     float              factor);
 
 G_END_DECLS
 
diff --git a/cogl/cogl/cogl-pipeline-layer-private.h b/cogl/cogl/cogl-pipeline-layer-private.h
index adde9bbf00..6328d33741 100644
--- a/cogl/cogl/cogl-pipeline-layer-private.h
+++ b/cogl/cogl/cogl-pipeline-layer-private.h
@@ -180,7 +180,7 @@ typedef struct
   float texture_combine_constant[4];
 
   /* The texture matrix dscribes how to transform texture coordinates */
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
 
   CoglPipelineSnippetList vertex_snippets;
   CoglPipelineSnippetList fragment_snippets;
diff --git a/cogl/cogl/cogl-pipeline-layer-state.c b/cogl/cogl/cogl-pipeline-layer-state.c
index 73be1ea89f..894270d5dd 100644
--- a/cogl/cogl/cogl-pipeline-layer-state.c
+++ b/cogl/cogl/cogl-pipeline-layer-state.c
@@ -1124,7 +1124,7 @@ _cogl_pipeline_get_layer_combine_constant (CoglPipeline *pipeline,
 /* We should probably make a public API version of this that has a
    matrix out-param. For an internal API it's good to be able to avoid
    copying the matrix */
-const CoglMatrix *
+const graphene_matrix_t *
 _cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline, int layer_index)
 {
   CoglPipelineLayerState       change =
@@ -1143,7 +1143,7 @@ _cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline, int layer_index)
 void
 cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
                                int layer_index,
-                                const CoglMatrix *matrix)
+                                const graphene_matrix_t *matrix)
 {
   CoglPipelineLayerState state = COGL_PIPELINE_LAYER_STATE_USER_MATRIX;
   CoglPipelineLayer     *layer;
diff --git a/cogl/cogl/cogl-pipeline-layer-state.h b/cogl/cogl/cogl-pipeline-layer-state.h
index 947b37b145..9e33e8184f 100644
--- a/cogl/cogl/cogl-pipeline-layer-state.h
+++ b/cogl/cogl/cogl-pipeline-layer-state.h
@@ -336,7 +336,7 @@ cogl_pipeline_set_layer_combine_constant (CoglPipeline    *pipeline,
 COGL_EXPORT void
 cogl_pipeline_set_layer_matrix (CoglPipeline     *pipeline,
                                int               layer_index,
-                               const CoglMatrix *matrix);
+                               const graphene_matrix_t *matrix);
 
 /**
  * cogl_pipeline_get_n_layers:
diff --git a/cogl/cogl/cogl-pipeline-private.h b/cogl/cogl/cogl-pipeline-private.h
index 8369abca86..dbe62f82e3 100644
--- a/cogl/cogl/cogl-pipeline-private.h
+++ b/cogl/cogl/cogl-pipeline-private.h
@@ -732,7 +732,7 @@ _cogl_pipeline_journal_ref (CoglPipeline *pipeline);
 void
 _cogl_pipeline_journal_unref (CoglPipeline *pipeline);
 
-const CoglMatrix *
+const graphene_matrix_t *
 _cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline,
                                  int layer_index);
 
diff --git a/cogl/cogl/cogl-pipeline-state.h b/cogl/cogl/cogl-pipeline-state.h
index 1745ae0499..0439041a2d 100644
--- a/cogl/cogl/cogl-pipeline-state.h
+++ b/cogl/cogl/cogl-pipeline-state.h
@@ -715,7 +715,7 @@ cogl_pipeline_set_uniform_int (CoglPipeline *pipeline,
  *
  * If @transpose is %FALSE then the matrix is expected to be in
  * column-major order or if it is %TRUE then the matrix is in
- * row-major order. You can pass a #CoglMatrix by calling by passing
+ * row-major order. You can pass a #graphene_matrix_t by calling by passing
  * the result of cogl_matrix_to_float() in @value and setting
  * @transpose to %FALSE.
  *
diff --git a/cogl/cogl/cogl-private.h b/cogl/cogl/cogl-private.h
index 769510289d..2878a16403 100644
--- a/cogl/cogl/cogl-private.h
+++ b/cogl/cogl/cogl-private.h
@@ -79,11 +79,11 @@ typedef enum _CoglPipelineEvalFlags
 } CoglPipelineEvalFlags;
 
 void
-_cogl_transform_point (const CoglMatrix *matrix_mv,
-                       const CoglMatrix *matrix_p,
-                       const float *viewport,
-                       float *x,
-                       float *y);
+_cogl_transform_point (const graphene_matrix_t *matrix_mv,
+                       const graphene_matrix_t *matrix_p,
+                       const float             *viewport,
+                       float                   *x,
+                       float                   *y);
 
 gboolean
 _cogl_check_extension (const char *name, char * const *ext);
diff --git a/cogl/cogl/cogl-types.h b/cogl/cogl/cogl-types.h
index 6fc9663686..d6856bd2e9 100644
--- a/cogl/cogl/cogl-types.h
+++ b/cogl/cogl/cogl-types.h
@@ -86,10 +86,6 @@ typedef void * CoglHandle;
 COGL_EXPORT GType
 cogl_handle_get_type (void) G_GNUC_CONST;
 
-/* We forward declare this in cogl-types to avoid circular dependencies
- * between cogl-matrix.h and cogl-quaterion.h */
-typedef graphene_matrix_t CoglMatrix;
-
 /**
  * CoglAngle:
  *
diff --git a/cogl/cogl/cogl.c b/cogl/cogl/cogl.c
index e35b84c24a..d9f6d495e0 100644
--- a/cogl/cogl/cogl.c
+++ b/cogl/cogl/cogl.c
@@ -175,11 +175,11 @@ _cogl_driver_error_quark (void)
 /* Transform a homogeneous vertex position from model space to Cogl
  * window coordinates (with 0,0 being top left) */
 void
-_cogl_transform_point (const CoglMatrix *matrix_mv,
-                       const CoglMatrix *matrix_p,
-                       const float *viewport,
-                       float *x,
-                       float *y)
+_cogl_transform_point (const graphene_matrix_t *matrix_mv,
+                       const graphene_matrix_t *matrix_p,
+                       const float             *viewport,
+                       float                   *x,
+                       float                   *y)
 {
   float z = 0;
   float w = 1;
diff --git a/cogl/cogl/deprecated/cogl-material-compat.c b/cogl/cogl/deprecated/cogl-material-compat.c
index 23c03ea0aa..e3a3c60cc0 100644
--- a/cogl/cogl/deprecated/cogl-material-compat.c
+++ b/cogl/cogl/deprecated/cogl-material-compat.c
@@ -129,9 +129,9 @@ cogl_material_set_layer_combine_constant (CoglMaterial    *material,
 }
 
 void
-cogl_material_set_layer_matrix (CoglMaterial     *material,
-                               int               layer_index,
-                               const CoglMatrix *matrix)
+cogl_material_set_layer_matrix (CoglMaterial            *material,
+                                int                      layer_index,
+                                const graphene_matrix_t *matrix)
 {
   cogl_pipeline_set_layer_matrix (COGL_PIPELINE (material),
                                   layer_index, matrix);
diff --git a/cogl/cogl/deprecated/cogl-material-compat.h b/cogl/cogl/deprecated/cogl-material-compat.h
index 37ab372af9..0648b5f666 100644
--- a/cogl/cogl/deprecated/cogl-material-compat.h
+++ b/cogl/cogl/deprecated/cogl-material-compat.h
@@ -590,9 +590,9 @@ cogl_material_set_layer_combine_constant (CoglMaterial    *material,
  */
 COGL_DEPRECATED_FOR (cogl_pipeline_set_layer_matrix)
 COGL_EXPORT void
-cogl_material_set_layer_matrix (CoglMaterial     *material,
-                               int               layer_index,
-                               const CoglMatrix *matrix);
+cogl_material_set_layer_matrix (CoglMaterial            *material,
+                                int                      layer_index,
+                                const graphene_matrix_t *matrix);
 
 /**
  * cogl_material_set_layer_filters:
diff --git a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c
index d5007cf3d2..ee398f47c6 100644
--- a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c
+++ b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c
@@ -133,7 +133,7 @@ add_stencil_clip_region (CoglFramebuffer *framebuffer,
 {
   CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
   CoglMatrixEntry *old_projection_entry, *old_modelview_entry;
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
   int num_rectangles = cairo_region_num_rectangles (region);
   int i;
   CoglVertexP2 *vertices;
diff --git a/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c 
b/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
index e00db212f4..33cc4a634b 100644
--- a/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
+++ b/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
@@ -431,7 +431,7 @@ update_constants_cb (CoglPipeline *pipeline,
   if (unit_state->texture_matrix_uniform != -1 &&
       (state->update_all || unit_state->dirty_texture_matrix))
     {
-      const CoglMatrix *matrix;
+      const graphene_matrix_t *matrix;
       float array[16];
 
       matrix = _cogl_pipeline_get_layer_matrix (pipeline, layer_index);
@@ -1001,7 +1001,7 @@ _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline,
   gboolean projection_changed;
   gboolean need_modelview;
   gboolean need_projection;
-  CoglMatrix modelview, projection;
+  graphene_matrix_t modelview, projection;
 
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
@@ -1051,7 +1051,7 @@ _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline,
         {
           if (needs_flip && program_state->flip_uniform == -1)
             {
-              CoglMatrix tmp_matrix;
+              graphene_matrix_t tmp_matrix;
               cogl_matrix_entry_get (projection_entry, &tmp_matrix);
               cogl_matrix_multiply (&projection,
                                     &ctx->y_flip_matrix,
@@ -1095,7 +1095,7 @@ _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline,
             }
           else
             {
-              CoglMatrix combined;
+              graphene_matrix_t combined;
 
               cogl_matrix_multiply (&combined,
                                     &projection,
diff --git a/cogl/tests/conform/test-pipeline-uniforms.c b/cogl/tests/conform/test-pipeline-uniforms.c
index fe08cd0536..90d3ee17da 100644
--- a/cogl/tests/conform/test-pipeline-uniforms.c
+++ b/cogl/tests/conform/test-pipeline-uniforms.c
@@ -218,7 +218,7 @@ paint_color_pipelines (TestState *state)
 static void
 paint_matrix_pipeline (CoglPipeline *pipeline)
 {
-  CoglMatrix matrices[4];
+  graphene_matrix_t matrices[4];
   float matrix_floats[16 * 4];
   int uniform_location;
   int i;
diff --git a/cogl/tests/conform/test-pipeline-user-matrix.c b/cogl/tests/conform/test-pipeline-user-matrix.c
index 37304688a4..aa66d8030b 100644
--- a/cogl/tests/conform/test-pipeline-user-matrix.c
+++ b/cogl/tests/conform/test-pipeline-user-matrix.c
@@ -54,7 +54,7 @@ paint (TestState *state)
   };
   CoglTexture *tex0, *tex1;
   CoglPipeline *pipeline;
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
   GError *error = NULL;
 
   cogl_framebuffer_orthographic (test_fb,
diff --git a/cogl/tests/conform/test-primitive-and-journal.c b/cogl/tests/conform/test-primitive-and-journal.c
index aa93a1f1c6..8a394f3afd 100644
--- a/cogl/tests/conform/test-primitive-and-journal.c
+++ b/cogl/tests/conform/test-primitive-and-journal.c
@@ -8,7 +8,7 @@ typedef CoglVertexP2C4 Vertex;
 static void
 setup_orthographic_modelview (void)
 {
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
   int fb_width = cogl_framebuffer_get_width (test_fb);
   int fb_height = cogl_framebuffer_get_height (test_fb);
 
diff --git a/cogl/tests/conform/test-readpixels.c b/cogl/tests/conform/test-readpixels.c
index 003179436d..dc4811a62e 100644
--- a/cogl/tests/conform/test-readpixels.c
+++ b/cogl/tests/conform/test-readpixels.c
@@ -20,9 +20,9 @@ on_paint (ClutterActor        *actor,
           void                *state)
 {
   float saved_viewport[4];
-  CoglMatrix saved_projection;
-  CoglMatrix projection;
-  CoglMatrix modelview;
+  graphene_matrix_t saved_projection;
+  graphene_matrix_t projection;
+  graphene_matrix_t modelview;
   guchar *data;
   CoglHandle tex;
   CoglHandle offscreen;
diff --git a/cogl/tests/conform/test-snippets.c b/cogl/tests/conform/test-snippets.c
index ea0582dc82..1b70a5a4ca 100644
--- a/cogl/tests/conform/test-snippets.c
+++ b/cogl/tests/conform/test-snippets.c
@@ -431,7 +431,7 @@ test_modify_vertex_layer (TestState *state)
 {
   CoglPipeline *pipeline;
   CoglSnippet *snippet;
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
 
   /* Test modifying the vertex layer code */
   pipeline = create_texture_pipeline (state);
@@ -460,7 +460,7 @@ test_replace_vertex_layer (TestState *state)
 {
   CoglPipeline *pipeline;
   CoglSnippet *snippet;
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
 
   /* Test replacing the vertex layer code */
   pipeline = create_texture_pipeline (state);
@@ -490,8 +490,8 @@ test_vertex_transform_hook (TestState *state)
 {
   CoglPipeline *pipeline;
   CoglSnippet *snippet;
-  CoglMatrix identity_matrix;
-  CoglMatrix matrix;
+  graphene_matrix_t identity_matrix;
+  graphene_matrix_t matrix;
   float v[16];
   int location;
 
diff --git a/cogl/tests/conform/test-viewport.c b/cogl/tests/conform/test-viewport.c
index e4d1728727..120712e38c 100644
--- a/cogl/tests/conform/test-viewport.c
+++ b/cogl/tests/conform/test-viewport.c
@@ -71,9 +71,9 @@ on_paint (ClutterActor        *actor,
           void                *state)
 {
   float saved_viewport[4];
-  CoglMatrix saved_projection;
-  CoglMatrix projection;
-  CoglMatrix modelview;
+  graphene_matrix_t saved_projection;
+  graphene_matrix_t projection;
+  graphene_matrix_t modelview;
   guchar *data;
   CoglHandle tex;
   CoglHandle offscreen;
diff --git a/src/backends/meta-renderer-view.c b/src/backends/meta-renderer-view.c
index d698baba64..07dab9ec1c 100644
--- a/src/backends/meta-renderer-view.c
+++ b/src/backends/meta-renderer-view.c
@@ -74,8 +74,8 @@ meta_renderer_view_get_crtc (MetaRendererView *view)
 }
 
 static void
-meta_renderer_view_get_offscreen_transformation_matrix (ClutterStageView *view,
-                                                        CoglMatrix       *matrix)
+meta_renderer_view_get_offscreen_transformation_matrix (ClutterStageView  *view,
+                                                        graphene_matrix_t *matrix)
 {
   MetaRendererView *renderer_view = META_RENDERER_VIEW (view);
 
@@ -122,7 +122,7 @@ static void
 meta_renderer_view_setup_offscreen_blit_pipeline (ClutterStageView *view,
                                                   CoglPipeline     *pipeline)
 {
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
 
   meta_renderer_view_get_offscreen_transformation_matrix (view, &matrix);
   cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix);
diff --git a/src/backends/x11/nested/meta-stage-x11-nested.c b/src/backends/x11/nested/meta-stage-x11-nested.c
index be0ece2fa0..e2c8de2b37 100644
--- a/src/backends/x11/nested/meta-stage-x11-nested.c
+++ b/src/backends/x11/nested/meta-stage-x11-nested.c
@@ -110,8 +110,8 @@ draw_view (MetaStageX11Nested *stage_nested,
   ClutterStageView *stage_view = CLUTTER_STAGE_VIEW (renderer_view);
   MetaCrtc *crtc;
   const MetaCrtcConfig *crtc_config;
-  CoglMatrix projection_matrix;
-  CoglMatrix transform;
+  graphene_matrix_t projection_matrix;
+  graphene_matrix_t transform;
   float texture_width, texture_height;
   float sample_x, sample_y, sample_width, sample_height;
   float s_1, t_1, s_2, t_2;
diff --git a/src/compositor/clutter-utils.c b/src/compositor/clutter-utils.c
index 6482ceb1a9..2be2da775a 100644
--- a/src/compositor/clutter-utils.c
+++ b/src/compositor/clutter-utils.c
@@ -140,7 +140,7 @@ meta_actor_painting_untransformed (CoglFramebuffer *fb,
                                    int             *x_origin,
                                    int             *y_origin)
 {
-  CoglMatrix modelview, projection, modelview_projection;
+  graphene_matrix_t modelview, projection, modelview_projection;
   graphene_point3d_t vertices[4];
   float viewport[4];
   int i;
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index a8e8216dbf..8bbbffa84f 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -273,7 +273,7 @@ get_base_pipeline (MetaShapedTexture *stex,
                    CoglContext       *ctx)
 {
   CoglPipeline *pipeline;
-  CoglMatrix matrix;
+  graphene_matrix_t matrix;
 
   if (stex->base_pipeline)
     return stex->base_pipeline;
@@ -1364,7 +1364,7 @@ get_image_via_offscreen (MetaShapedTexture     *stex,
   GError *error = NULL;
   CoglOffscreen *offscreen;
   CoglFramebuffer *fb;
-  CoglMatrix projection_matrix;
+  graphene_matrix_t projection_matrix;
   cairo_rectangle_int_t fallback_clip;
   ClutterColor clear_color;
   ClutterPaintContext *paint_context;
diff --git a/src/compositor/meta-texture-tower.c b/src/compositor/meta-texture-tower.c
index 408c0c2e94..87c9ff3de4 100644
--- a/src/compositor/meta-texture-tower.c
+++ b/src/compositor/meta-texture-tower.c
@@ -248,7 +248,7 @@ get_paint_level (ClutterPaintContext *paint_context,
                  int                  height)
 {
   CoglFramebuffer *framebuffer;
-  CoglMatrix projection, modelview, pm;
+  graphene_matrix_t projection, modelview, pm;
   float xx, xy, xw;
   float yx, yy, yw;
   float wx, wy, ww;
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 8d2548fbb7..a2086ca907 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1111,7 +1111,7 @@ meta_window_actor_set_geometry_scale (MetaWindowActor *window_actor,
 {
   MetaWindowActorPrivate *priv =
     meta_window_actor_get_instance_private (window_actor);
-  CoglMatrix child_transform;
+  graphene_matrix_t child_transform;
 
   if (priv->geometry_scale == geometry_scale)
     return;
diff --git a/src/tests/clutter/conform/actor-pivot-point.c b/src/tests/clutter/conform/actor-pivot-point.c
index 099145fffb..5213e69e94 100644
--- a/src/tests/clutter/conform/actor-pivot-point.c
+++ b/src/tests/clutter/conform/actor-pivot-point.c
@@ -10,7 +10,7 @@ static void
 actor_pivot (void)
 {
   ClutterActor *stage, *actor_implicit, *actor_explicit;
-  CoglMatrix transform, result_implicit, result_explicit;
+  graphene_matrix_t transform, result_implicit, result_explicit;
   ClutterActorBox allocation = CLUTTER_ACTOR_BOX_INIT (0, 0, 90, 30);
   gfloat angle = 30;
 
diff --git a/src/tests/clutter/interactive/test-cogl-multitexture.c 
b/src/tests/clutter/interactive/test-cogl-multitexture.c
index 4805d90fe3..93e2d5d5b7 100644
--- a/src/tests/clutter/interactive/test-cogl-multitexture.c
+++ b/src/tests/clutter/interactive/test-cogl-multitexture.c
@@ -21,13 +21,13 @@ typedef struct _TestMultiLayerMaterialState
   ClutterTimeline *timeline;
 
   CoglHandle       material0;
-  CoglMatrix       tex_matrix0;
-  CoglMatrix       rot_matrix0;
+  graphene_matrix_t tex_matrix0;
+  graphene_matrix_t rot_matrix0;
   CoglHandle       light_tex0;
 
   CoglHandle       material1;
-  CoglMatrix       tex_matrix1;
-  CoglMatrix       rot_matrix1;
+  graphene_matrix_t tex_matrix1;
+  graphene_matrix_t rot_matrix1;
   CoglHandle       light_tex1;
 
 } TestMultiLayerMaterialState;
diff --git a/src/tests/clutter/interactive/test-cogl-offscreen.c 
b/src/tests/clutter/interactive/test-cogl-offscreen.c
index d8c3f92997..de77745e91 100644
--- a/src/tests/clutter/interactive/test-cogl-offscreen.c
+++ b/src/tests/clutter/interactive/test-cogl-offscreen.c
@@ -181,8 +181,8 @@ setup_viewport (CoglFramebuffer *framebuffer,
                 float            z_far)
 {
   float z_camera;
-  CoglMatrix projection_matrix;
-  CoglMatrix mv_matrix;
+  graphene_matrix_t projection_matrix;
+  graphene_matrix_t mv_matrix;
 
   cogl_framebuffer_set_viewport (framebuffer, 0, 0, width, height);
 
diff --git a/src/tests/clutter/interactive/test-cogl-point-sprites.c 
b/src/tests/clutter/interactive/test-cogl-point-sprites.c
index 6d4326470c..8a3604edfa 100644
--- a/src/tests/clutter/interactive/test-cogl-point-sprites.c
+++ b/src/tests/clutter/interactive/test-cogl-point-sprites.c
@@ -103,7 +103,7 @@ paint_cb (ClutterActor        *stage,
 {
   CoglFramebuffer *framebuffer =
     clutter_paint_context_get_framebuffer (paint_context);
-  CoglMatrix old_matrix, new_matrix;
+  graphene_matrix_t old_matrix, new_matrix;
   int i;
   float diff_time;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]