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
This commit is contained in:
Georges Basile Stavracas Neto 2020-09-11 15:57:28 -03:00
parent cedb5318da
commit 3e0c961b76
59 changed files with 477 additions and 476 deletions

View File

@ -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,

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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,

View File

@ -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);

View File

@ -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,

View File

@ -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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -58,14 +58,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;

View File

@ -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);

View File

@ -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,

View File

@ -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 */

View File

@ -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);

View File

@ -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:

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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:

View File

@ -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,19 +70,19 @@ 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.
*/
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;
@ -115,17 +116,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;
@ -138,23 +140,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;
@ -168,11 +170,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);
@ -187,13 +189,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;
@ -207,10 +209,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;
@ -221,10 +223,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;
@ -236,61 +238,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);
@ -298,15 +302,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;
@ -334,13 +338,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,
@ -357,8 +361,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);
@ -366,58 +370,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);
@ -429,7 +433,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))
@ -439,8 +443,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;
@ -452,8 +456,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;
@ -465,8 +469,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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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:

View File

@ -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);

View File

@ -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.
*

View File

@ -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);

View File

@ -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:
*

View File

@ -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;

View File

@ -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);

View File

@ -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:

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;