mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
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:
parent
cedb5318da
commit
3e0c961b76
@ -180,10 +180,10 @@ struct _ClutterTransformInfo
|
|||||||
graphene_point_t pivot;
|
graphene_point_t pivot;
|
||||||
gfloat pivot_z;
|
gfloat pivot_z;
|
||||||
|
|
||||||
CoglMatrix transform;
|
graphene_matrix_t transform;
|
||||||
guint transform_set : 1;
|
guint transform_set : 1;
|
||||||
|
|
||||||
CoglMatrix child_transform;
|
graphene_matrix_t child_transform;
|
||||||
guint child_transform_set : 1;
|
guint child_transform_set : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -220,11 +220,11 @@ void _clutter_actor_traverse
|
|||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
ClutterActor * _clutter_actor_get_stage_internal (ClutterActor *actor);
|
ClutterActor * _clutter_actor_get_stage_internal (ClutterActor *actor);
|
||||||
|
|
||||||
void _clutter_actor_apply_modelview_transform (ClutterActor *self,
|
void _clutter_actor_apply_modelview_transform (ClutterActor *self,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
void _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
|
void _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
|
||||||
ClutterActor *ancestor,
|
ClutterActor *ancestor,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
|
|
||||||
void _clutter_actor_rerealize (ClutterActor *self,
|
void _clutter_actor_rerealize (ClutterActor *self,
|
||||||
ClutterCallback callback,
|
ClutterCallback callback,
|
||||||
|
@ -703,8 +703,8 @@ struct _ClutterActorPrivate
|
|||||||
graphene_rect_t clip;
|
graphene_rect_t clip;
|
||||||
|
|
||||||
/* the cached transformation matrix; see apply_transform() */
|
/* the cached transformation matrix; see apply_transform() */
|
||||||
CoglMatrix transform;
|
graphene_matrix_t transform;
|
||||||
CoglMatrix inverse_transform;
|
graphene_matrix_t inverse_transform;
|
||||||
|
|
||||||
float resource_scale;
|
float resource_scale;
|
||||||
|
|
||||||
@ -1050,9 +1050,9 @@ static void clutter_actor_update_map_state (ClutterActor *self,
|
|||||||
MapStateChange change);
|
MapStateChange change);
|
||||||
static void clutter_actor_unrealize_not_hiding (ClutterActor *self);
|
static void clutter_actor_unrealize_not_hiding (ClutterActor *self);
|
||||||
|
|
||||||
static void _clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
|
static void _clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
|
||||||
ClutterActor *ancestor,
|
ClutterActor *ancestor,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
|
|
||||||
static ClutterPaintVolume *_clutter_actor_get_paint_volume_mutable (ClutterActor *self);
|
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,
|
gfloat margin,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static void clutter_actor_set_transform_internal (ClutterActor *self,
|
static void clutter_actor_set_transform_internal (ClutterActor *self,
|
||||||
const CoglMatrix *transform);
|
const graphene_matrix_t *transform);
|
||||||
static void clutter_actor_set_child_transform_internal (ClutterActor *self,
|
static void clutter_actor_set_child_transform_internal (ClutterActor *self,
|
||||||
const CoglMatrix *transform);
|
const graphene_matrix_t *transform);
|
||||||
|
|
||||||
static void clutter_actor_realize_internal (ClutterActor *self);
|
static void clutter_actor_realize_internal (ClutterActor *self);
|
||||||
static void clutter_actor_unrealize_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;
|
ClutterActorPrivate *stage_priv = stage_actor->priv;
|
||||||
CoglFramebuffer *fb =
|
CoglFramebuffer *fb =
|
||||||
clutter_pick_context_get_framebuffer (pick_context);
|
clutter_pick_context_get_framebuffer (pick_context);
|
||||||
CoglMatrix modelview, transform_to_stage;
|
graphene_matrix_t modelview, transform_to_stage;
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
ensure_valid_actor_transform (stage_actor);
|
ensure_valid_actor_transform (stage_actor);
|
||||||
@ -2853,7 +2853,7 @@ clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
|
|||||||
graphene_point3d_t *vertex)
|
graphene_point3d_t *vertex)
|
||||||
{
|
{
|
||||||
gfloat w;
|
gfloat w;
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
g_return_if_fail (ancestor == NULL || CLUTTER_IS_ACTOR (ancestor));
|
g_return_if_fail (ancestor == NULL || CLUTTER_IS_ACTOR (ancestor));
|
||||||
@ -2887,8 +2887,8 @@ _clutter_actor_fully_transform_vertices (ClutterActor *self,
|
|||||||
int n_vertices)
|
int n_vertices)
|
||||||
{
|
{
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
CoglMatrix modelview;
|
graphene_matrix_t modelview;
|
||||||
CoglMatrix projection;
|
graphene_matrix_t projection;
|
||||||
float viewport[4];
|
float viewport[4];
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
|
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.
|
* @self: The actor whose coordinate space you want to transform from.
|
||||||
* @ancestor: The ancestor actor whose coordinate space you want to transform too
|
* @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.
|
* 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
|
* This gets a transformation @matrix that will transform coordinates from the
|
||||||
* coordinate space of @self into the coordinate space of @ancestor.
|
* 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
|
/* XXX: We should consider caching the stage relative modelview along with
|
||||||
* the actor itself */
|
* the actor itself */
|
||||||
static void
|
static void
|
||||||
_clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
|
_clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
|
||||||
ClutterActor *ancestor,
|
ClutterActor *ancestor,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
cogl_matrix_init_identity (matrix);
|
cogl_matrix_init_identity (matrix);
|
||||||
|
|
||||||
@ -3064,8 +3064,8 @@ clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_actor_real_apply_transform (ClutterActor *self,
|
clutter_actor_real_apply_transform (ClutterActor *self,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
ClutterActorPrivate *priv = self->priv;
|
ClutterActorPrivate *priv = self->priv;
|
||||||
const ClutterTransformInfo *info;
|
const ClutterTransformInfo *info;
|
||||||
@ -3172,8 +3172,8 @@ ensure_valid_actor_transform (ClutterActor *actor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_actor_apply_modelview_transform (ClutterActor *self,
|
_clutter_actor_apply_modelview_transform (ClutterActor *self,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
ClutterActorPrivate *priv = self->priv;
|
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.
|
* @self: The actor whose coordinate space you want to transform from.
|
||||||
* @ancestor: The ancestor actor whose coordinate space you want to transform too
|
* @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.
|
* 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
|
* This multiplies a transform with @matrix that will transform coordinates
|
||||||
* from the coordinate space of @self into the coordinate space of @ancestor.
|
* 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.
|
* clutter_actor_get_relative_transformation_matrix() instead.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
|
_clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
|
||||||
ClutterActor *ancestor,
|
ClutterActor *ancestor,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
/* Note we terminate before ever calling stage->apply_transform()
|
/* Note we terminate before ever calling stage->apply_transform()
|
||||||
* since that would conceptually be relative to the underlying
|
* since that would conceptually be relative to the underlying
|
||||||
@ -3838,7 +3838,7 @@ clutter_actor_paint (ClutterActor *self,
|
|||||||
if (priv->enable_model_view_transform)
|
if (priv->enable_model_view_transform)
|
||||||
{
|
{
|
||||||
ClutterPaintNode *transform_node;
|
ClutterPaintNode *transform_node;
|
||||||
CoglMatrix transform;
|
graphene_matrix_t transform;
|
||||||
|
|
||||||
clutter_actor_get_transform (self, &transform);
|
clutter_actor_get_transform (self, &transform);
|
||||||
|
|
||||||
@ -3856,7 +3856,7 @@ clutter_actor_paint (ClutterActor *self,
|
|||||||
* of an apply_transform vfunc... */
|
* of an apply_transform vfunc... */
|
||||||
if (G_UNLIKELY (clutter_debug_flags & CLUTTER_DEBUG_OOB_TRANSFORMS))
|
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,
|
_clutter_actor_get_relative_transformation_matrix (self, NULL,
|
||||||
&expected_matrix);
|
&expected_matrix);
|
||||||
@ -4092,7 +4092,7 @@ clutter_actor_pick (ClutterActor *actor,
|
|||||||
|
|
||||||
if (priv->enable_model_view_transform)
|
if (priv->enable_model_view_transform)
|
||||||
{
|
{
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
|
|
||||||
cogl_framebuffer_get_modelview_matrix (framebuffer, &matrix);
|
cogl_framebuffer_get_modelview_matrix (framebuffer, &matrix);
|
||||||
_clutter_actor_apply_modelview_transform (actor, &matrix);
|
_clutter_actor_apply_modelview_transform (actor, &matrix);
|
||||||
@ -5490,7 +5490,7 @@ clutter_actor_get_property (GObject *object,
|
|||||||
|
|
||||||
case PROP_TRANSFORM:
|
case PROP_TRANSFORM:
|
||||||
{
|
{
|
||||||
CoglMatrix m;
|
graphene_matrix_t m;
|
||||||
|
|
||||||
clutter_actor_get_transform (actor, &m);
|
clutter_actor_get_transform (actor, &m);
|
||||||
g_value_set_boxed (value, &m);
|
g_value_set_boxed (value, &m);
|
||||||
@ -5508,7 +5508,7 @@ clutter_actor_get_property (GObject *object,
|
|||||||
|
|
||||||
case PROP_CHILD_TRANSFORM:
|
case PROP_CHILD_TRANSFORM:
|
||||||
{
|
{
|
||||||
CoglMatrix m;
|
graphene_matrix_t m;
|
||||||
|
|
||||||
clutter_actor_get_child_transform (actor, &m);
|
clutter_actor_get_child_transform (actor, &m);
|
||||||
g_value_set_boxed (value, &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.
|
* 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;
|
* #ClutterActor:transform-set property to %TRUE as a side effect;
|
||||||
* setting this property with %NULL will set the
|
* setting this property with %NULL will set the
|
||||||
* #ClutterActor:transform-set property to %FALSE.
|
* #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.
|
* 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;
|
* #ClutterActor:child-transform-set property to %TRUE as a side effect;
|
||||||
* setting this property with %NULL will set the
|
* setting this property with %NULL will set the
|
||||||
* #ClutterActor:child-transform-set property to %FALSE.
|
* #ClutterActor:child-transform-set property to %FALSE.
|
||||||
@ -14806,8 +14806,8 @@ clutter_actor_unset_flags (ClutterActor *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_actor_set_transform_internal (ClutterActor *self,
|
clutter_actor_set_transform_internal (ClutterActor *self,
|
||||||
const CoglMatrix *transform)
|
const graphene_matrix_t *transform)
|
||||||
{
|
{
|
||||||
ClutterTransformInfo *info;
|
ClutterTransformInfo *info;
|
||||||
gboolean was_set;
|
gboolean was_set;
|
||||||
@ -14835,7 +14835,7 @@ clutter_actor_set_transform_internal (ClutterActor *self,
|
|||||||
/**
|
/**
|
||||||
* clutter_actor_set_transform:
|
* clutter_actor_set_transform:
|
||||||
* @self: a #ClutterActor
|
* @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
|
* unset a custom transformation
|
||||||
*
|
*
|
||||||
* Overrides the transformations of a #ClutterActor with a custom
|
* Overrides the transformations of a #ClutterActor with a custom
|
||||||
@ -14847,11 +14847,11 @@ clutter_actor_set_transform_internal (ClutterActor *self,
|
|||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_actor_set_transform (ClutterActor *self,
|
clutter_actor_set_transform (ClutterActor *self,
|
||||||
const CoglMatrix *transform)
|
const graphene_matrix_t *transform)
|
||||||
{
|
{
|
||||||
const ClutterTransformInfo *info;
|
const ClutterTransformInfo *info;
|
||||||
CoglMatrix new_transform;
|
graphene_matrix_t new_transform;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
|
||||||
@ -14870,15 +14870,15 @@ clutter_actor_set_transform (ClutterActor *self,
|
|||||||
/**
|
/**
|
||||||
* clutter_actor_get_transform:
|
* clutter_actor_get_transform:
|
||||||
* @self: a #ClutterActor
|
* @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.
|
* Retrieves the current transformation matrix of a #ClutterActor.
|
||||||
*
|
*
|
||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_actor_get_transform (ClutterActor *self,
|
clutter_actor_get_transform (ClutterActor *self,
|
||||||
CoglMatrix *transform)
|
graphene_matrix_t *transform)
|
||||||
{
|
{
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
g_return_if_fail (transform != NULL);
|
g_return_if_fail (transform != NULL);
|
||||||
@ -19417,8 +19417,8 @@ done:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_actor_set_child_transform_internal (ClutterActor *self,
|
clutter_actor_set_child_transform_internal (ClutterActor *self,
|
||||||
const CoglMatrix *transform)
|
const graphene_matrix_t *transform)
|
||||||
{
|
{
|
||||||
ClutterTransformInfo *info = _clutter_actor_get_transform_info (self);
|
ClutterTransformInfo *info = _clutter_actor_get_transform_info (self);
|
||||||
ClutterActorIter iter;
|
ClutterActorIter iter;
|
||||||
@ -19448,7 +19448,7 @@ clutter_actor_set_child_transform_internal (ClutterActor *self,
|
|||||||
/**
|
/**
|
||||||
* clutter_actor_set_child_transform:
|
* clutter_actor_set_child_transform:
|
||||||
* @self: a #ClutterActor
|
* @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
|
* Sets the transformation matrix to be applied to all the children
|
||||||
* of @self prior to their own transformations. The default child
|
* 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
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_actor_set_child_transform (ClutterActor *self,
|
clutter_actor_set_child_transform (ClutterActor *self,
|
||||||
const CoglMatrix *transform)
|
const graphene_matrix_t *transform)
|
||||||
{
|
{
|
||||||
const ClutterTransformInfo *info;
|
const ClutterTransformInfo *info;
|
||||||
CoglMatrix new_transform;
|
graphene_matrix_t new_transform;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
|
||||||
@ -19484,7 +19484,7 @@ clutter_actor_set_child_transform (ClutterActor *self,
|
|||||||
/**
|
/**
|
||||||
* clutter_actor_get_child_transform:
|
* clutter_actor_get_child_transform:
|
||||||
* @self: a #ClutterActor
|
* @self: a #ClutterActor
|
||||||
* @transform: (out caller-allocates): a #CoglMatrix
|
* @transform: (out caller-allocates): a #graphene_matrix_t
|
||||||
*
|
*
|
||||||
* Retrieves the child transformation matrix set using
|
* Retrieves the child transformation matrix set using
|
||||||
* clutter_actor_set_child_transform(); if none is currently set,
|
* clutter_actor_set_child_transform(); if none is currently set,
|
||||||
@ -19493,8 +19493,8 @@ clutter_actor_set_child_transform (ClutterActor *self,
|
|||||||
* Since: 1.12
|
* Since: 1.12
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_actor_get_child_transform (ClutterActor *self,
|
clutter_actor_get_child_transform (ClutterActor *self,
|
||||||
CoglMatrix *transform)
|
graphene_matrix_t *transform)
|
||||||
{
|
{
|
||||||
const ClutterTransformInfo *info;
|
const ClutterTransformInfo *info;
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ struct _ClutterActorClass
|
|||||||
|
|
||||||
/* transformations */
|
/* transformations */
|
||||||
void (* apply_transform) (ClutterActor *actor,
|
void (* apply_transform) (ClutterActor *actor,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/* event signals */
|
/* event signals */
|
||||||
gboolean (* event) (ClutterActor *actor,
|
gboolean (* event) (ClutterActor *actor,
|
||||||
@ -803,16 +803,16 @@ void clutter_actor_get_translation
|
|||||||
gfloat *translate_z);
|
gfloat *translate_z);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_set_transform (ClutterActor *self,
|
void clutter_actor_set_transform (ClutterActor *self,
|
||||||
const CoglMatrix *transform);
|
const graphene_matrix_t *transform);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_get_transform (ClutterActor *self,
|
void clutter_actor_get_transform (ClutterActor *self,
|
||||||
CoglMatrix *transform);
|
graphene_matrix_t *transform);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_set_child_transform (ClutterActor *self,
|
void clutter_actor_set_child_transform (ClutterActor *self,
|
||||||
const CoglMatrix *transform);
|
const graphene_matrix_t *transform);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_get_child_transform (ClutterActor *self,
|
void clutter_actor_get_child_transform (ClutterActor *self,
|
||||||
CoglMatrix *transform);
|
graphene_matrix_t *transform);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_actor_get_transformed_extents (ClutterActor *self,
|
void clutter_actor_get_transformed_extents (ClutterActor *self,
|
||||||
|
@ -121,7 +121,8 @@ clutter_clone_get_preferred_height (ClutterActor *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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;
|
ClutterClonePrivate *priv = CLUTTER_CLONE (self)->priv;
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect,
|
|||||||
ClutterOffscreenEffectPrivate *priv = self->priv;
|
ClutterOffscreenEffectPrivate *priv = self->priv;
|
||||||
ClutterActorBox raw_box, box;
|
ClutterActorBox raw_box, box;
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
CoglMatrix projection, old_modelview, modelview;
|
graphene_matrix_t projection, old_modelview, modelview;
|
||||||
const ClutterPaintVolume *volume;
|
const ClutterPaintVolume *volume;
|
||||||
CoglColor transparent;
|
CoglColor transparent;
|
||||||
gfloat stage_width, stage_height;
|
gfloat stage_width, stage_height;
|
||||||
@ -427,7 +427,7 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect,
|
|||||||
ClutterOffscreenEffectPrivate *priv = effect->priv;
|
ClutterOffscreenEffectPrivate *priv = effect->priv;
|
||||||
CoglFramebuffer *framebuffer =
|
CoglFramebuffer *framebuffer =
|
||||||
clutter_paint_context_get_framebuffer (paint_context);
|
clutter_paint_context_get_framebuffer (paint_context);
|
||||||
CoglMatrix modelview;
|
graphene_matrix_t modelview;
|
||||||
float resource_scale;
|
float resource_scale;
|
||||||
|
|
||||||
cogl_framebuffer_push_matrix (framebuffer);
|
cogl_framebuffer_push_matrix (framebuffer);
|
||||||
|
@ -111,7 +111,7 @@ void _clutter_paint_operation_paint_primitive (const C
|
|||||||
void _clutter_paint_node_init_types (void);
|
void _clutter_paint_node_init_types (void);
|
||||||
gpointer _clutter_paint_node_create (GType gtype);
|
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,
|
ClutterPaintNode * _clutter_dummy_node_new (ClutterActor *actor,
|
||||||
CoglFramebuffer *framebuffer);
|
CoglFramebuffer *framebuffer);
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ struct _ClutterTransformNode
|
|||||||
{
|
{
|
||||||
ClutterPaintNode parent_instance;
|
ClutterPaintNode parent_instance;
|
||||||
|
|
||||||
CoglMatrix transform;
|
graphene_matrix_t transform;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterTransformNodeClass
|
struct _ClutterTransformNodeClass
|
||||||
@ -249,7 +249,7 @@ clutter_transform_node_init (ClutterTransformNode *self)
|
|||||||
* Use clutter_paint_node_unref() when done.
|
* Use clutter_paint_node_unref() when done.
|
||||||
*/
|
*/
|
||||||
ClutterPaintNode *
|
ClutterPaintNode *
|
||||||
clutter_transform_node_new (const CoglMatrix *transform)
|
clutter_transform_node_new (const graphene_matrix_t *transform)
|
||||||
{
|
{
|
||||||
ClutterTransformNode *res;
|
ClutterTransformNode *res;
|
||||||
|
|
||||||
@ -1226,7 +1226,7 @@ struct _ClutterLayerNode
|
|||||||
|
|
||||||
cairo_rectangle_t viewport;
|
cairo_rectangle_t viewport;
|
||||||
|
|
||||||
CoglMatrix projection;
|
graphene_matrix_t projection;
|
||||||
|
|
||||||
float fbo_width;
|
float fbo_width;
|
||||||
float fbo_height;
|
float fbo_height;
|
||||||
@ -1250,7 +1250,7 @@ clutter_layer_node_pre_draw (ClutterPaintNode *node,
|
|||||||
{
|
{
|
||||||
ClutterLayerNode *lnode = (ClutterLayerNode *) node;
|
ClutterLayerNode *lnode = (ClutterLayerNode *) node;
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
|
|
||||||
/* if we were unable to create an offscreen buffer for this node, then
|
/* if we were unable to create an offscreen buffer for this node, then
|
||||||
* we simply ignore it
|
* we simply ignore it
|
||||||
@ -1404,7 +1404,7 @@ clutter_layer_node_init (ClutterLayerNode *self)
|
|||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
ClutterPaintNode *
|
ClutterPaintNode *
|
||||||
clutter_layer_node_new (const CoglMatrix *projection,
|
clutter_layer_node_new (const graphene_matrix_t *projection,
|
||||||
const cairo_rectangle_t *viewport,
|
const cairo_rectangle_t *viewport,
|
||||||
float width,
|
float width,
|
||||||
float height,
|
float height,
|
||||||
|
@ -202,7 +202,7 @@ CLUTTER_EXPORT
|
|||||||
GType clutter_layer_node_get_type (void) G_GNUC_CONST;
|
GType clutter_layer_node_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
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,
|
const cairo_rectangle_t *viewport,
|
||||||
float width,
|
float width,
|
||||||
float height,
|
float height,
|
||||||
@ -228,7 +228,7 @@ CLUTTER_EXPORT
|
|||||||
GType clutter_transform_node_get_type (void) G_GNUC_CONST;
|
GType clutter_transform_node_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterPaintNode * clutter_transform_node_new (const CoglMatrix *projection);
|
ClutterPaintNode * clutter_transform_node_new (const graphene_matrix_t *projection);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -111,12 +111,12 @@ void _clutter_paint_volume_set_from_volume (ClutterPaintVolu
|
|||||||
const ClutterPaintVolume *src);
|
const ClutterPaintVolume *src);
|
||||||
|
|
||||||
void _clutter_paint_volume_complete (ClutterPaintVolume *pv);
|
void _clutter_paint_volume_complete (ClutterPaintVolume *pv);
|
||||||
void _clutter_paint_volume_transform (ClutterPaintVolume *pv,
|
void _clutter_paint_volume_transform (ClutterPaintVolume *pv,
|
||||||
const CoglMatrix *matrix);
|
const graphene_matrix_t *matrix);
|
||||||
void _clutter_paint_volume_project (ClutterPaintVolume *pv,
|
void _clutter_paint_volume_project (ClutterPaintVolume *pv,
|
||||||
const CoglMatrix *modelview,
|
const graphene_matrix_t *modelview,
|
||||||
const CoglMatrix *projection,
|
const graphene_matrix_t *projection,
|
||||||
const float *viewport);
|
const float *viewport);
|
||||||
void _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv,
|
void _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv,
|
||||||
ClutterActorBox *box);
|
ClutterActorBox *box);
|
||||||
void _clutter_paint_volume_axis_align (ClutterPaintVolume *pv);
|
void _clutter_paint_volume_axis_align (ClutterPaintVolume *pv);
|
||||||
|
@ -808,8 +808,8 @@ _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv,
|
|||||||
|
|
||||||
void
|
void
|
||||||
_clutter_paint_volume_project (ClutterPaintVolume *pv,
|
_clutter_paint_volume_project (ClutterPaintVolume *pv,
|
||||||
const CoglMatrix *modelview,
|
const graphene_matrix_t *modelview,
|
||||||
const CoglMatrix *projection,
|
const graphene_matrix_t *projection,
|
||||||
const float *viewport)
|
const float *viewport)
|
||||||
{
|
{
|
||||||
int transform_count;
|
int transform_count;
|
||||||
@ -849,7 +849,7 @@ _clutter_paint_volume_project (ClutterPaintVolume *pv,
|
|||||||
|
|
||||||
void
|
void
|
||||||
_clutter_paint_volume_transform (ClutterPaintVolume *pv,
|
_clutter_paint_volume_transform (ClutterPaintVolume *pv,
|
||||||
const CoglMatrix *matrix)
|
const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
int transform_count;
|
int transform_count;
|
||||||
|
|
||||||
@ -1130,8 +1130,8 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
|
|||||||
ClutterActorBox *box)
|
ClutterActorBox *box)
|
||||||
{
|
{
|
||||||
ClutterPaintVolume projected_pv;
|
ClutterPaintVolume projected_pv;
|
||||||
CoglMatrix modelview;
|
graphene_matrix_t modelview;
|
||||||
CoglMatrix projection;
|
graphene_matrix_t projection;
|
||||||
float viewport[4];
|
float viewport[4];
|
||||||
|
|
||||||
_clutter_paint_volume_copy_static (pv, &projected_pv);
|
_clutter_paint_volume_copy_static (pv, &projected_pv);
|
||||||
@ -1181,7 +1181,7 @@ void
|
|||||||
_clutter_paint_volume_transform_relative (ClutterPaintVolume *pv,
|
_clutter_paint_volume_transform_relative (ClutterPaintVolume *pv,
|
||||||
ClutterActor *relative_to_ancestor)
|
ClutterActor *relative_to_ancestor)
|
||||||
{
|
{
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
|
|
||||||
actor = pv->actor;
|
actor = pv->actor;
|
||||||
|
@ -354,7 +354,7 @@ clutter_pan_action_real_pan (ClutterPanAction *self,
|
|||||||
gboolean is_interpolated)
|
gboolean is_interpolated)
|
||||||
{
|
{
|
||||||
gfloat dx, dy;
|
gfloat dx, dy;
|
||||||
CoglMatrix transform;
|
graphene_matrix_t transform;
|
||||||
|
|
||||||
clutter_pan_action_get_constrained_motion_delta (self, 0, &dx, &dy);
|
clutter_pan_action_get_constrained_motion_delta (self, 0, &dx, &dy);
|
||||||
|
|
||||||
|
@ -210,8 +210,8 @@ void _clutter_run_repaint_functions (ClutterRepaintFlags flags);
|
|||||||
|
|
||||||
GType _clutter_layout_manager_get_child_meta_type (ClutterLayoutManager *manager);
|
GType _clutter_layout_manager_get_child_meta_type (ClutterLayoutManager *manager);
|
||||||
|
|
||||||
void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
void _clutter_util_fully_transform_vertices (const graphene_matrix_t *modelview,
|
||||||
const CoglMatrix *projection,
|
const graphene_matrix_t *projection,
|
||||||
const float *viewport,
|
const float *viewport,
|
||||||
const graphene_point3d_t *vertices_in,
|
const graphene_point3d_t *vertices_in,
|
||||||
graphene_point3d_t *vertices_out,
|
graphene_point3d_t *vertices_out,
|
||||||
|
@ -99,7 +99,7 @@ clutter_scroll_actor_set_scroll_to_internal (ClutterScrollActor *self,
|
|||||||
{
|
{
|
||||||
ClutterScrollActorPrivate *priv = self->priv;
|
ClutterScrollActorPrivate *priv = self->priv;
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||||
CoglMatrix m;
|
graphene_matrix_t m;
|
||||||
float dx, dy;
|
float dx, dy;
|
||||||
|
|
||||||
cogl_matrix_init_identity (&m);
|
cogl_matrix_init_identity (&m);
|
||||||
|
@ -55,7 +55,7 @@ void _clutter_stage_set_window (ClutterStage
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage);
|
ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage);
|
||||||
void _clutter_stage_get_projection_matrix (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_dirty_projection (ClutterStage *stage);
|
||||||
void _clutter_stage_get_viewport (ClutterStage *stage,
|
void _clutter_stage_get_viewport (ClutterStage *stage,
|
||||||
float *x,
|
float *x,
|
||||||
|
@ -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_invalidate_projection (ClutterStageView *view);
|
||||||
|
|
||||||
void clutter_stage_view_set_projection (ClutterStageView *view,
|
void clutter_stage_view_set_projection (ClutterStageView *view,
|
||||||
const CoglMatrix *matrix);
|
const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
||||||
const cairo_rectangle_int_t *clip);
|
const cairo_rectangle_int_t *clip);
|
||||||
|
@ -213,7 +213,7 @@ paint_transformed_framebuffer (ClutterStageView *view,
|
|||||||
CoglFramebuffer *dst_framebuffer,
|
CoglFramebuffer *dst_framebuffer,
|
||||||
const cairo_region_t *redraw_clip)
|
const cairo_region_t *redraw_clip)
|
||||||
{
|
{
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
unsigned int n_rectangles, i;
|
unsigned int n_rectangles, i;
|
||||||
int dst_width, dst_height;
|
int dst_width, dst_height;
|
||||||
cairo_rectangle_int_t view_layout;
|
cairo_rectangle_int_t view_layout;
|
||||||
@ -882,8 +882,8 @@ clutter_stage_view_invalidate_projection (ClutterStageView *view)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_stage_view_set_projection (ClutterStageView *view,
|
clutter_stage_view_set_projection (ClutterStageView *view,
|
||||||
const CoglMatrix *matrix)
|
const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
ClutterStageViewPrivate *priv =
|
ClutterStageViewPrivate *priv =
|
||||||
clutter_stage_view_get_instance_private (view);
|
clutter_stage_view_get_instance_private (view);
|
||||||
@ -895,8 +895,8 @@ clutter_stage_view_set_projection (ClutterStageView *view,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
ClutterStageViewClass *view_class = CLUTTER_STAGE_VIEW_GET_CLASS (view);
|
ClutterStageViewClass *view_class = CLUTTER_STAGE_VIEW_GET_CLASS (view);
|
||||||
|
|
||||||
@ -984,8 +984,8 @@ clutter_stage_view_take_redraw_clip (ClutterStageView *view)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_default_get_offscreen_transformation_matrix (ClutterStageView *view,
|
clutter_stage_default_get_offscreen_transformation_matrix (ClutterStageView *view,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
cogl_matrix_init_identity (matrix);
|
cogl_matrix_init_identity (matrix);
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,8 @@ struct _ClutterStageViewClass
|
|||||||
void (* setup_offscreen_blit_pipeline) (ClutterStageView *view,
|
void (* setup_offscreen_blit_pipeline) (ClutterStageView *view,
|
||||||
CoglPipeline *pipeline);
|
CoglPipeline *pipeline);
|
||||||
|
|
||||||
void (* get_offscreen_transformation_matrix) (ClutterStageView *view,
|
void (* get_offscreen_transformation_matrix) (ClutterStageView *view,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
|
|
||||||
void (* transform_rect_to_onscreen) (ClutterStageView *view,
|
void (* transform_rect_to_onscreen) (ClutterStageView *view,
|
||||||
const cairo_rectangle_int_t *src_rect,
|
const cairo_rectangle_int_t *src_rect,
|
||||||
@ -70,8 +70,8 @@ CLUTTER_EXPORT
|
|||||||
float clutter_stage_view_get_scale (ClutterStageView *view);
|
float clutter_stage_view_get_scale (ClutterStageView *view);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
void clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterFrameClock * clutter_stage_view_get_frame_clock (ClutterStageView *view);
|
ClutterFrameClock * clutter_stage_view_get_frame_clock (ClutterStageView *view);
|
||||||
|
@ -103,9 +103,9 @@ struct _ClutterStagePrivate
|
|||||||
ClutterStageWindow *impl;
|
ClutterStageWindow *impl;
|
||||||
|
|
||||||
ClutterPerspective perspective;
|
ClutterPerspective perspective;
|
||||||
CoglMatrix projection;
|
graphene_matrix_t projection;
|
||||||
CoglMatrix inverse_projection;
|
graphene_matrix_t inverse_projection;
|
||||||
CoglMatrix view;
|
graphene_matrix_t view;
|
||||||
float viewport[4];
|
float viewport[4];
|
||||||
|
|
||||||
gchar *title;
|
gchar *title;
|
||||||
@ -662,8 +662,8 @@ static void
|
|||||||
_cogl_util_get_eye_planes_for_screen_poly (float *polygon,
|
_cogl_util_get_eye_planes_for_screen_poly (float *polygon,
|
||||||
int n_vertices,
|
int n_vertices,
|
||||||
float *viewport,
|
float *viewport,
|
||||||
const CoglMatrix *projection,
|
const graphene_matrix_t *projection,
|
||||||
const CoglMatrix *inverse_project,
|
const graphene_matrix_t *inverse_project,
|
||||||
ClutterPlane *planes)
|
ClutterPlane *planes)
|
||||||
{
|
{
|
||||||
float Wc;
|
float Wc;
|
||||||
@ -1578,8 +1578,8 @@ _clutter_stage_do_pick (ClutterStage *stage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_real_apply_transform (ClutterActor *stage,
|
clutter_stage_real_apply_transform (ClutterActor *stage,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
ClutterStagePrivate *priv = CLUTTER_STAGE (stage)->priv;
|
ClutterStagePrivate *priv = CLUTTER_STAGE (stage)->priv;
|
||||||
|
|
||||||
@ -2098,7 +2098,7 @@ clutter_stage_get_perspective (ClutterStage *stage,
|
|||||||
/*
|
/*
|
||||||
* clutter_stage_get_projection_matrix:
|
* clutter_stage_get_projection_matrix:
|
||||||
* @stage: A #ClutterStage
|
* @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
|
* perspective projection applied to actors on the given
|
||||||
* @stage.
|
* @stage.
|
||||||
*
|
*
|
||||||
@ -2108,8 +2108,8 @@ clutter_stage_get_perspective (ClutterStage *stage,
|
|||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_clutter_stage_get_projection_matrix (ClutterStage *stage,
|
_clutter_stage_get_projection_matrix (ClutterStage *stage,
|
||||||
CoglMatrix *projection)
|
graphene_matrix_t *projection)
|
||||||
{
|
{
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
||||||
g_return_if_fail (projection != NULL);
|
g_return_if_fail (projection != NULL);
|
||||||
|
@ -58,14 +58,14 @@ typedef struct
|
|||||||
} ClutterVertex4;
|
} ClutterVertex4;
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
_clutter_util_fully_transform_vertices (const graphene_matrix_t *modelview,
|
||||||
const CoglMatrix *projection,
|
const graphene_matrix_t *projection,
|
||||||
const float *viewport,
|
const float *viewport,
|
||||||
const graphene_point3d_t *vertices_in,
|
const graphene_point3d_t *vertices_in,
|
||||||
graphene_point3d_t *vertices_out,
|
graphene_point3d_t *vertices_out,
|
||||||
int n_vertices)
|
int n_vertices)
|
||||||
{
|
{
|
||||||
CoglMatrix modelview_projection;
|
graphene_matrix_t modelview_projection;
|
||||||
ClutterVertex4 *vertices_tmp;
|
ClutterVertex4 *vertices_tmp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ paint_damage_region (ClutterStageWindow *stage_window,
|
|||||||
static CoglPipeline *overlay_blue = NULL;
|
static CoglPipeline *overlay_blue = NULL;
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
|
ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
|
||||||
CoglMatrix transform;
|
graphene_matrix_t transform;
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
|
|
||||||
cogl_framebuffer_push_matrix (framebuffer);
|
cogl_framebuffer_push_matrix (framebuffer);
|
||||||
|
@ -69,14 +69,14 @@ _cogl_clip_stack_push_entry (CoglClipStack *clip_stack,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_transformed_corners (float x_1,
|
get_transformed_corners (float x_1,
|
||||||
float y_1,
|
float y_1,
|
||||||
float x_2,
|
float x_2,
|
||||||
float y_2,
|
float y_2,
|
||||||
CoglMatrix *modelview,
|
graphene_matrix_t *modelview,
|
||||||
CoglMatrix *projection,
|
graphene_matrix_t *projection,
|
||||||
const float *viewport,
|
const float *viewport,
|
||||||
float *transformed_corners)
|
float *transformed_corners)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -160,9 +160,9 @@ _cogl_clip_stack_push_rectangle (CoglClipStack *stack,
|
|||||||
const float *viewport)
|
const float *viewport)
|
||||||
{
|
{
|
||||||
CoglClipStackRect *entry;
|
CoglClipStackRect *entry;
|
||||||
CoglMatrix modelview;
|
graphene_matrix_t modelview;
|
||||||
CoglMatrix projection;
|
graphene_matrix_t projection;
|
||||||
CoglMatrix modelview_projection;
|
graphene_matrix_t modelview_projection;
|
||||||
|
|
||||||
/* Corners of the given rectangle in an clockwise order:
|
/* Corners of the given rectangle in an clockwise order:
|
||||||
* (0, 1) (2, 3)
|
* (0, 1) (2, 3)
|
||||||
@ -260,8 +260,8 @@ _cogl_clip_stack_push_primitive (CoglClipStack *stack,
|
|||||||
const float *viewport)
|
const float *viewport)
|
||||||
{
|
{
|
||||||
CoglClipStackPrimitive *entry;
|
CoglClipStackPrimitive *entry;
|
||||||
CoglMatrix modelview;
|
graphene_matrix_t modelview;
|
||||||
CoglMatrix projection;
|
graphene_matrix_t projection;
|
||||||
float transformed_corners[8];
|
float transformed_corners[8];
|
||||||
|
|
||||||
entry = _cogl_clip_stack_push_entry (stack,
|
entry = _cogl_clip_stack_push_entry (stack,
|
||||||
|
@ -111,8 +111,8 @@ struct _CoglContext
|
|||||||
gboolean legacy_backface_culling_enabled;
|
gboolean legacy_backface_culling_enabled;
|
||||||
|
|
||||||
/* A few handy matrix constants */
|
/* A few handy matrix constants */
|
||||||
CoglMatrix identity_matrix;
|
graphene_matrix_t identity_matrix;
|
||||||
CoglMatrix y_flip_matrix;
|
graphene_matrix_t y_flip_matrix;
|
||||||
|
|
||||||
/* The matrix stack entries that should be flushed during the next
|
/* The matrix stack entries that should be flushed during the next
|
||||||
* pipeline state flush */
|
* pipeline state flush */
|
||||||
|
@ -1503,8 +1503,8 @@ cogl_framebuffer_rotate_euler (CoglFramebuffer *framebuffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
|
||||||
const CoglMatrix *matrix)
|
const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
||||||
@ -1577,7 +1577,7 @@ cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
|
|||||||
float near,
|
float near,
|
||||||
float far)
|
float far)
|
||||||
{
|
{
|
||||||
CoglMatrix ortho;
|
graphene_matrix_t ortho;
|
||||||
CoglMatrixStack *projection_stack =
|
CoglMatrixStack *projection_stack =
|
||||||
_cogl_framebuffer_get_projection_stack (framebuffer);
|
_cogl_framebuffer_get_projection_stack (framebuffer);
|
||||||
|
|
||||||
@ -1595,8 +1595,8 @@ cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixEntry *modelview_entry =
|
CoglMatrixEntry *modelview_entry =
|
||||||
_cogl_framebuffer_get_modelview_entry (framebuffer);
|
_cogl_framebuffer_get_modelview_entry (framebuffer);
|
||||||
@ -1605,8 +1605,8 @@ cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
|
||||||
const CoglMatrix *matrix)
|
const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *modelview_stack =
|
CoglMatrixStack *modelview_stack =
|
||||||
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
||||||
@ -1620,8 +1620,8 @@ cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixEntry *projection_entry =
|
CoglMatrixEntry *projection_entry =
|
||||||
_cogl_framebuffer_get_projection_entry (framebuffer);
|
_cogl_framebuffer_get_projection_entry (framebuffer);
|
||||||
@ -1630,8 +1630,8 @@ cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
|
||||||
const CoglMatrix *matrix)
|
const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixStack *projection_stack =
|
CoglMatrixStack *projection_stack =
|
||||||
_cogl_framebuffer_get_projection_stack (framebuffer);
|
_cogl_framebuffer_get_projection_stack (framebuffer);
|
||||||
|
@ -390,8 +390,8 @@ cogl_framebuffer_rotate_euler (CoglFramebuffer *framebuffer,
|
|||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
|
||||||
const CoglMatrix *matrix);
|
const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_framebuffer_get_modelview_matrix:
|
* cogl_framebuffer_get_modelview_matrix:
|
||||||
@ -404,8 +404,8 @@ cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
|
|||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_framebuffer_set_modelview_matrix:
|
* cogl_framebuffer_set_modelview_matrix:
|
||||||
@ -418,8 +418,8 @@ cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
|
|||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
|
||||||
const CoglMatrix *matrix);
|
const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_framebuffer_perspective:
|
* cogl_framebuffer_perspective:
|
||||||
@ -518,8 +518,8 @@ cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
|
|||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_framebuffer_set_projection_matrix:
|
* cogl_framebuffer_set_projection_matrix:
|
||||||
@ -532,8 +532,8 @@ cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
|
|||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
|
||||||
const CoglMatrix *matrix);
|
const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_framebuffer_push_scissor_clip:
|
* cogl_framebuffer_push_scissor_clip:
|
||||||
|
@ -1161,7 +1161,7 @@ upload_vertices (CoglJournal *journal,
|
|||||||
int entry_num;
|
int entry_num;
|
||||||
int i;
|
int i;
|
||||||
CoglMatrixEntry *last_modelview_entry = NULL;
|
CoglMatrixEntry *last_modelview_entry = NULL;
|
||||||
CoglMatrix modelview;
|
graphene_matrix_t modelview;
|
||||||
|
|
||||||
g_assert (needed_vbo_len);
|
g_assert (needed_vbo_len);
|
||||||
|
|
||||||
@ -1643,8 +1643,8 @@ entry_to_screen_polygon (CoglFramebuffer *framebuffer,
|
|||||||
size_t array_stride =
|
size_t array_stride =
|
||||||
GET_JOURNAL_ARRAY_STRIDE_FOR_N_LAYERS (entry->n_layers);
|
GET_JOURNAL_ARRAY_STRIDE_FOR_N_LAYERS (entry->n_layers);
|
||||||
CoglMatrixStack *projection_stack;
|
CoglMatrixStack *projection_stack;
|
||||||
CoglMatrix projection;
|
graphene_matrix_t projection;
|
||||||
CoglMatrix modelview;
|
graphene_matrix_t modelview;
|
||||||
int i;
|
int i;
|
||||||
const float *viewport = entry->viewport;
|
const float *viewport = entry->viewport;
|
||||||
|
|
||||||
|
@ -46,11 +46,11 @@ G_BEGIN_DECLS
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_cogl_matrix_prefix_print (const char *prefix, const CoglMatrix *matrix);
|
_cogl_matrix_prefix_print (const char *prefix, const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
void
|
void
|
||||||
_cogl_matrix_init_from_matrix_without_inverse (CoglMatrix *matrix,
|
_cogl_matrix_init_from_matrix_without_inverse (graphene_matrix_t *matrix,
|
||||||
const CoglMatrix *src);
|
const graphene_matrix_t *src);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ typedef struct _CoglMatrixEntryMultiply
|
|||||||
{
|
{
|
||||||
CoglMatrixEntry _parent_data;
|
CoglMatrixEntry _parent_data;
|
||||||
|
|
||||||
CoglMatrix *matrix;
|
graphene_matrix_t *matrix;
|
||||||
|
|
||||||
} CoglMatrixEntryMultiply;
|
} CoglMatrixEntryMultiply;
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ typedef struct _CoglMatrixEntryLoad
|
|||||||
{
|
{
|
||||||
CoglMatrixEntry _parent_data;
|
CoglMatrixEntry _parent_data;
|
||||||
|
|
||||||
CoglMatrix *matrix;
|
graphene_matrix_t *matrix;
|
||||||
|
|
||||||
} CoglMatrixEntryLoad;
|
} CoglMatrixEntryLoad;
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ typedef struct _CoglMatrixEntrySave
|
|||||||
{
|
{
|
||||||
CoglMatrixEntry _parent_data;
|
CoglMatrixEntry _parent_data;
|
||||||
|
|
||||||
CoglMatrix *cache;
|
graphene_matrix_t *cache;
|
||||||
gboolean cache_valid;
|
gboolean cache_valid;
|
||||||
|
|
||||||
} CoglMatrixEntrySave;
|
} CoglMatrixEntrySave;
|
||||||
|
@ -202,8 +202,8 @@ cogl_matrix_stack_scale (CoglMatrixStack *stack,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_stack_multiply (CoglMatrixStack *stack,
|
cogl_matrix_stack_multiply (CoglMatrixStack *stack,
|
||||||
const CoglMatrix *matrix)
|
const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixEntryMultiply *entry;
|
CoglMatrixEntryMultiply *entry;
|
||||||
|
|
||||||
@ -216,8 +216,8 @@ cogl_matrix_stack_multiply (CoglMatrixStack *stack,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_stack_set (CoglMatrixStack *stack,
|
cogl_matrix_stack_set (CoglMatrixStack *stack,
|
||||||
const CoglMatrix *matrix)
|
const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
CoglMatrixEntryLoad *entry;
|
CoglMatrixEntryLoad *entry;
|
||||||
|
|
||||||
@ -404,11 +404,11 @@ cogl_matrix_stack_pop (CoglMatrixStack *stack)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
|
cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
|
||||||
CoglMatrix *inverse)
|
graphene_matrix_t *inverse)
|
||||||
{
|
{
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
CoglMatrix *internal = cogl_matrix_stack_get (stack, &matrix);
|
graphene_matrix_t *internal = cogl_matrix_stack_get (stack, &matrix);
|
||||||
|
|
||||||
if (internal)
|
if (internal)
|
||||||
return cogl_matrix_get_inverse (internal, inverse);
|
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
|
* to a matrix too so if we are querying the inverse matrix we
|
||||||
* should query from the return matrix so that the result can
|
* should query from the return matrix so that the result can
|
||||||
* be cached within the stack. */
|
* be cached within the stack. */
|
||||||
CoglMatrix *
|
graphene_matrix_t *
|
||||||
cogl_matrix_entry_get (CoglMatrixEntry *entry,
|
cogl_matrix_entry_get (CoglMatrixEntry *entry,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
int depth;
|
int depth;
|
||||||
CoglMatrixEntry *current;
|
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
|
* to a matrix too so if we are querying the inverse matrix we
|
||||||
* should query from the return matrix so that the result can
|
* should query from the return matrix so that the result can
|
||||||
* be cached within the stack. */
|
* be cached within the stack. */
|
||||||
CoglMatrix *
|
graphene_matrix_t *
|
||||||
cogl_matrix_stack_get (CoglMatrixStack *stack,
|
cogl_matrix_stack_get (CoglMatrixStack *stack,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
return cogl_matrix_entry_get (stack->last_entry, 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_matrix_stack_magazine =
|
||||||
_cogl_magazine_new (sizeof (CoglMatrixEntryFull), 20);
|
_cogl_magazine_new (sizeof (CoglMatrixEntryFull), 20);
|
||||||
cogl_matrix_stack_matrices_magazine =
|
cogl_matrix_stack_matrices_magazine =
|
||||||
_cogl_magazine_new (sizeof (CoglMatrix), 20);
|
_cogl_magazine_new (sizeof (graphene_matrix_t), 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
stack->context = ctx;
|
stack->context = ctx;
|
||||||
|
@ -53,11 +53,11 @@
|
|||||||
* transforms of objects, texture transforms, and projective
|
* transforms of objects, texture transforms, and projective
|
||||||
* transforms.
|
* 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
|
* matrices representing a single transformation but if you need to
|
||||||
* track many-many such transformations for many objects that are
|
* track many-many such transformations for many objects that are
|
||||||
* organized in a scenegraph for example then using a separate
|
* 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
|
* A #CoglMatrixStack enables applications to track lots of
|
||||||
* transformations that are related to each other in some kind 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
|
* transformation. The #CoglMatrixStack API is suited to tracking lots
|
||||||
* of transformations that fit this kind of model.
|
* 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
|
* related transforms, these can be some advantages to using a
|
||||||
* #CoglMatrixStack:
|
* #CoglMatrixStack:
|
||||||
* <itemizedlist>
|
* <itemizedlist>
|
||||||
@ -83,14 +83,14 @@
|
|||||||
* </itemizedlist>
|
* </itemizedlist>
|
||||||
*
|
*
|
||||||
* For reference (to give an idea of when a #CoglMatrixStack can
|
* 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
|
* bytes whereas a single #CoglMatrixEntry in a #CoglMatrixStack is
|
||||||
* currently around 32 bytes on a 32bit CPU or 36 bytes on a 64bit
|
* 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
|
* CPU. An entry is needed for each individual operation applied to
|
||||||
* the stack (such as rotate, scale, translate) so if most of your
|
* the stack (such as rotate, scale, translate) so if most of your
|
||||||
* leaf node transformations only need one or two simple operations
|
* leaf node transformations only need one or two simple operations
|
||||||
* relative to their parent then a matrix stack will likely take less
|
* 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
|
* Even without any space saving though the ability to perform fast
|
||||||
* comparisons and avoid redundant arithmetic (especially sine and
|
* 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.
|
* Multiplies the current matrix by the given matrix.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_stack_multiply (CoglMatrixStack *stack,
|
cogl_matrix_stack_multiply (CoglMatrixStack *stack,
|
||||||
const CoglMatrix *matrix);
|
const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_stack_frustum:
|
* cogl_matrix_stack_frustum:
|
||||||
@ -414,15 +414,15 @@ cogl_matrix_stack_orthographic (CoglMatrixStack *stack,
|
|||||||
* @inverse: (out): The destination for a 4x4 inverse transformation matrix
|
* @inverse: (out): The destination for a 4x4 inverse transformation matrix
|
||||||
*
|
*
|
||||||
* Gets the inverse transform of the current matrix and uses it to
|
* 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
|
* Return value: %TRUE if the inverse was successfully calculated or %FALSE
|
||||||
* for degenerate transformations that can't be inverted (in this case the
|
* for degenerate transformations that can't be inverted (in this case the
|
||||||
* @inverse matrix will simply be initialized with the identity matrix)
|
* @inverse matrix will simply be initialized with the identity matrix)
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT gboolean
|
COGL_EXPORT gboolean
|
||||||
cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
|
cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
|
||||||
CoglMatrix *inverse);
|
graphene_matrix_t *inverse);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_stack_get_entry:
|
* cogl_matrix_stack_get_entry:
|
||||||
@ -450,13 +450,13 @@ cogl_matrix_stack_get_entry (CoglMatrixStack *stack);
|
|||||||
* @stack: A #CoglMatrixStack
|
* @stack: A #CoglMatrixStack
|
||||||
* @matrix: (out): The potential destination for the current matrix
|
* @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
|
* combining the operations that have been applied to build up the
|
||||||
* current transform.
|
* current transform.
|
||||||
*
|
*
|
||||||
* There are two possible ways that this function may return its
|
* There are two possible ways that this function may return its
|
||||||
* result depending on whether the stack is able to directly point
|
* 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.
|
* composed of multiple operations.
|
||||||
*
|
*
|
||||||
* If an internal matrix contains the required result then this
|
* 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
|
* and in that case @matrix will be initialized with
|
||||||
* the value of the current transform.
|
* the value of the current transform.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT CoglMatrix *
|
COGL_EXPORT graphene_matrix_t *
|
||||||
cogl_matrix_stack_get (CoglMatrixStack *stack,
|
cogl_matrix_stack_get (CoglMatrixStack *stack,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_entry_get:
|
* cogl_matrix_entry_get:
|
||||||
@ -481,13 +481,13 @@ cogl_matrix_stack_get (CoglMatrixStack *stack,
|
|||||||
* @matrix: (out): The potential destination for the transform as
|
* @matrix: (out): The potential destination for the transform as
|
||||||
* a matrix
|
* 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
|
* combining the sequence of operations that have been applied to
|
||||||
* build up the current transform.
|
* build up the current transform.
|
||||||
*
|
*
|
||||||
* There are two possible ways that this function may return its
|
* There are two possible ways that this function may return its
|
||||||
* result depending on whether it's possible to directly point
|
* 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.
|
* composed of multiple operations.
|
||||||
*
|
*
|
||||||
* If an internal matrix contains the required result then this
|
* 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
|
* <note>@matrix will be left untouched if a direct pointer is
|
||||||
* returned.</note>
|
* 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
|
* and in that case @matrix will be initialized with
|
||||||
* the effective transform represented by @entry.
|
* the effective transform represented by @entry.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT CoglMatrix *
|
COGL_EXPORT graphene_matrix_t *
|
||||||
cogl_matrix_entry_get (CoglMatrixEntry *entry,
|
cogl_matrix_entry_get (CoglMatrixEntry *entry,
|
||||||
CoglMatrix *matrix);
|
graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_stack_set:
|
* cogl_matrix_stack_set:
|
||||||
* @stack: A #CoglMatrixStack
|
* @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.
|
* Replaces the current @stack matrix value with the value of @matrix.
|
||||||
* This effectively discards any other operations that were applied
|
* This effectively discards any other operations that were applied
|
||||||
@ -517,8 +517,8 @@ cogl_matrix_entry_get (CoglMatrixEntry *entry,
|
|||||||
* the stack was initialized.
|
* the stack was initialized.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_stack_set (CoglMatrixStack *stack,
|
cogl_matrix_stack_set (CoglMatrixStack *stack,
|
||||||
const CoglMatrix *matrix);
|
const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_is_matrix_stack:
|
* cogl_is_matrix_stack:
|
||||||
|
@ -43,25 +43,26 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_multiply (CoglMatrix *result,
|
cogl_matrix_multiply (graphene_matrix_t *result,
|
||||||
const CoglMatrix *a,
|
const graphene_matrix_t *a,
|
||||||
const CoglMatrix *b)
|
const graphene_matrix_t *b)
|
||||||
{
|
{
|
||||||
graphene_matrix_multiply (b, a, result);
|
graphene_matrix_multiply (b, a, result);
|
||||||
_COGL_MATRIX_DEBUG_PRINT (result);
|
_COGL_MATRIX_DEBUG_PRINT (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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);
|
graphene_matrix_print (matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dumps the contents of a CoglMatrix structure.
|
* Dumps the contents of a graphene_matrix_t structure.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
cogl_debug_matrix_print (const CoglMatrix *matrix)
|
cogl_debug_matrix_print (const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
_cogl_matrix_prefix_print ("", matrix);
|
_cogl_matrix_prefix_print ("", matrix);
|
||||||
}
|
}
|
||||||
@ -69,19 +70,19 @@ cogl_debug_matrix_print (const CoglMatrix *matrix)
|
|||||||
/*
|
/*
|
||||||
* Compute inverse of a transformation matrix.
|
* Compute inverse of a transformation matrix.
|
||||||
*
|
*
|
||||||
* @mat pointer to a CoglMatrix structure. The matrix inverse will be
|
* @mat pointer to a graphene_matrix_t structure. The matrix inverse will be
|
||||||
* stored in the CoglMatrix::inv attribute.
|
* stored in the graphene_matrix_t::inv attribute.
|
||||||
*
|
*
|
||||||
* Returns: %TRUE for success, %FALSE for failure (\p singular matrix).
|
* Returns: %TRUE for success, %FALSE for failure (\p singular matrix).
|
||||||
*
|
*
|
||||||
* Calls the matrix inversion function in inv_mat_tab corresponding to the
|
* 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,
|
* 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
|
static inline gboolean
|
||||||
calculate_inverse (const CoglMatrix *matrix,
|
calculate_inverse (const graphene_matrix_t *matrix,
|
||||||
CoglMatrix *inverse)
|
graphene_matrix_t *inverse)
|
||||||
{
|
{
|
||||||
graphene_matrix_t scaled;
|
graphene_matrix_t scaled;
|
||||||
graphene_matrix_t m;
|
graphene_matrix_t m;
|
||||||
@ -115,17 +116,18 @@ calculate_inverse (const CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
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);
|
return calculate_inverse (matrix, inverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_rotate (CoglMatrix *matrix,
|
cogl_matrix_rotate (graphene_matrix_t *matrix,
|
||||||
float angle,
|
float angle,
|
||||||
float x,
|
float x,
|
||||||
float y,
|
float y,
|
||||||
float z)
|
float z)
|
||||||
{
|
{
|
||||||
graphene_matrix_t rotation;
|
graphene_matrix_t rotation;
|
||||||
graphene_vec3_t axis;
|
graphene_vec3_t axis;
|
||||||
@ -138,23 +140,23 @@ cogl_matrix_rotate (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_rotate_euler (CoglMatrix *matrix,
|
cogl_matrix_rotate_euler (graphene_matrix_t *matrix,
|
||||||
const graphene_euler_t *euler)
|
const graphene_euler_t *euler)
|
||||||
{
|
{
|
||||||
CoglMatrix rotation_transform;
|
graphene_matrix_t rotation_transform;
|
||||||
|
|
||||||
cogl_matrix_init_from_euler (&rotation_transform, euler);
|
cogl_matrix_init_from_euler (&rotation_transform, euler);
|
||||||
cogl_matrix_multiply (matrix, matrix, &rotation_transform);
|
cogl_matrix_multiply (matrix, matrix, &rotation_transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_frustum (CoglMatrix *matrix,
|
cogl_matrix_frustum (graphene_matrix_t *matrix,
|
||||||
float left,
|
float left,
|
||||||
float right,
|
float right,
|
||||||
float bottom,
|
float bottom,
|
||||||
float top,
|
float top,
|
||||||
float z_near,
|
float z_near,
|
||||||
float z_far)
|
float z_far)
|
||||||
{
|
{
|
||||||
graphene_matrix_t frustum;
|
graphene_matrix_t frustum;
|
||||||
|
|
||||||
@ -168,11 +170,11 @@ cogl_matrix_frustum (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_perspective (CoglMatrix *matrix,
|
cogl_matrix_perspective (graphene_matrix_t *matrix,
|
||||||
float fov_y,
|
float fov_y,
|
||||||
float aspect,
|
float aspect,
|
||||||
float z_near,
|
float z_near,
|
||||||
float z_far)
|
float z_far)
|
||||||
{
|
{
|
||||||
float ymax = z_near * tan (fov_y * G_PI / 360.0);
|
float ymax = z_near * tan (fov_y * G_PI / 360.0);
|
||||||
|
|
||||||
@ -187,13 +189,13 @@ cogl_matrix_perspective (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_orthographic (CoglMatrix *matrix,
|
cogl_matrix_orthographic (graphene_matrix_t *matrix,
|
||||||
float left,
|
float left,
|
||||||
float bottom,
|
float bottom,
|
||||||
float right,
|
float right,
|
||||||
float top,
|
float top,
|
||||||
float near,
|
float near,
|
||||||
float far)
|
float far)
|
||||||
{
|
{
|
||||||
graphene_matrix_t ortho;
|
graphene_matrix_t ortho;
|
||||||
|
|
||||||
@ -207,10 +209,10 @@ cogl_matrix_orthographic (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_scale (CoglMatrix *matrix,
|
cogl_matrix_scale (graphene_matrix_t *matrix,
|
||||||
float sx,
|
float sx,
|
||||||
float sy,
|
float sy,
|
||||||
float sz)
|
float sz)
|
||||||
{
|
{
|
||||||
graphene_matrix_t scale;
|
graphene_matrix_t scale;
|
||||||
|
|
||||||
@ -221,10 +223,10 @@ cogl_matrix_scale (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_translate (CoglMatrix *matrix,
|
cogl_matrix_translate (graphene_matrix_t *matrix,
|
||||||
float x,
|
float x,
|
||||||
float y,
|
float y,
|
||||||
float z)
|
float z)
|
||||||
{
|
{
|
||||||
graphene_matrix_t translation;
|
graphene_matrix_t translation;
|
||||||
|
|
||||||
@ -236,61 +238,63 @@ cogl_matrix_translate (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_init_identity (CoglMatrix *matrix)
|
cogl_matrix_init_identity (graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
graphene_matrix_init_identity (matrix);
|
graphene_matrix_init_identity (matrix);
|
||||||
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_init_translation (CoglMatrix *matrix,
|
cogl_matrix_init_translation (graphene_matrix_t *matrix,
|
||||||
float tx,
|
float tx,
|
||||||
float ty,
|
float ty,
|
||||||
float tz)
|
float tz)
|
||||||
{
|
{
|
||||||
graphene_matrix_init_translate (matrix, &GRAPHENE_POINT3D_INIT (tx, ty, tz));
|
graphene_matrix_init_translate (matrix, &GRAPHENE_POINT3D_INIT (tx, ty, tz));
|
||||||
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loads a matrix array into CoglMatrix.
|
* Loads a matrix array into graphene_matrix_t.
|
||||||
*
|
*
|
||||||
* @m matrix array.
|
* @m matrix array.
|
||||||
* @mat matrix.
|
* @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
|
* MAT_DIRTY_ALL
|
||||||
* flags.
|
* flags.
|
||||||
*/
|
*/
|
||||||
static void
|
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);
|
graphene_matrix_init_from_float (matrix, array);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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_init_from_array (matrix, array);
|
||||||
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
_COGL_MATRIX_DEBUG_PRINT (matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_init_from_matrix (CoglMatrix *matrix,
|
cogl_matrix_init_from_matrix (graphene_matrix_t *matrix,
|
||||||
const CoglMatrix *source)
|
const graphene_matrix_t *source)
|
||||||
{
|
{
|
||||||
memcpy (matrix, source, sizeof (CoglMatrix));
|
memcpy (matrix, source, sizeof (graphene_matrix_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_cogl_matrix_init_from_matrix_without_inverse (CoglMatrix *matrix,
|
_cogl_matrix_init_from_matrix_without_inverse (graphene_matrix_t *matrix,
|
||||||
const CoglMatrix *src)
|
const graphene_matrix_t *src)
|
||||||
{
|
{
|
||||||
graphene_matrix_init_from_matrix (matrix, src);
|
graphene_matrix_init_from_matrix (matrix, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_init_from_euler (CoglMatrix *matrix,
|
cogl_matrix_init_from_euler (graphene_matrix_t *matrix,
|
||||||
const graphene_euler_t *euler)
|
const graphene_euler_t *euler)
|
||||||
{
|
{
|
||||||
graphene_matrix_init_identity (matrix);
|
graphene_matrix_init_identity (matrix);
|
||||||
@ -298,15 +302,15 @@ cogl_matrix_init_from_euler (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
|
cogl_matrix_view_2d_in_frustum (graphene_matrix_t *matrix,
|
||||||
float left,
|
float left,
|
||||||
float right,
|
float right,
|
||||||
float bottom,
|
float bottom,
|
||||||
float top,
|
float top,
|
||||||
float z_near,
|
float z_near,
|
||||||
float z_2d,
|
float z_2d,
|
||||||
float width_2d,
|
float width_2d,
|
||||||
float height_2d)
|
float height_2d)
|
||||||
{
|
{
|
||||||
float left_2d_plane = left / z_near * z_2d;
|
float left_2d_plane = left / z_near * z_2d;
|
||||||
float right_2d_plane = right / 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.
|
* given width and height.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
|
cogl_matrix_view_2d_in_perspective (graphene_matrix_t *matrix,
|
||||||
float fov_y,
|
float fov_y,
|
||||||
float aspect,
|
float aspect,
|
||||||
float z_near,
|
float z_near,
|
||||||
float z_2d,
|
float z_2d,
|
||||||
float width_2d,
|
float width_2d,
|
||||||
float height_2d)
|
float height_2d)
|
||||||
{
|
{
|
||||||
float top = z_near * tan (fov_y * G_PI / 360.0);
|
float top = z_near * tan (fov_y * G_PI / 360.0);
|
||||||
cogl_matrix_view_2d_in_frustum (matrix,
|
cogl_matrix_view_2d_in_frustum (matrix,
|
||||||
@ -357,8 +361,8 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
|
|||||||
gboolean
|
gboolean
|
||||||
cogl_matrix_equal (const void *v1, const void *v2)
|
cogl_matrix_equal (const void *v1, const void *v2)
|
||||||
{
|
{
|
||||||
const CoglMatrix *a = v1;
|
const graphene_matrix_t *a = v1;
|
||||||
const CoglMatrix *b = v2;
|
const graphene_matrix_t *b = v2;
|
||||||
|
|
||||||
g_return_val_if_fail (v1 != NULL, FALSE);
|
g_return_val_if_fail (v1 != NULL, FALSE);
|
||||||
g_return_val_if_fail (v2 != 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);
|
return graphene_matrix_equal_fast (a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
CoglMatrix *
|
graphene_matrix_t *
|
||||||
cogl_matrix_copy (const CoglMatrix *matrix)
|
cogl_matrix_copy (const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
if (G_LIKELY (matrix))
|
if (G_LIKELY (matrix))
|
||||||
return g_slice_dup (CoglMatrix, matrix);
|
return g_slice_dup (graphene_matrix_t, matrix);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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
|
void
|
||||||
cogl_matrix_to_float (const CoglMatrix *matrix,
|
cogl_matrix_to_float (const graphene_matrix_t *matrix,
|
||||||
float *out_array)
|
float *out_array)
|
||||||
{
|
{
|
||||||
graphene_matrix_to_float (matrix, out_array);
|
graphene_matrix_to_float (matrix, out_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
cogl_matrix_get_value (const CoglMatrix *matrix,
|
cogl_matrix_get_value (const graphene_matrix_t *matrix,
|
||||||
unsigned int row,
|
unsigned int row,
|
||||||
unsigned int column)
|
unsigned int column)
|
||||||
{
|
{
|
||||||
return graphene_matrix_get_value (matrix, column, row);
|
return graphene_matrix_get_value (matrix, column, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cogl_matrix_is_identity (const CoglMatrix *matrix)
|
cogl_matrix_is_identity (const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
return graphene_matrix_is_identity (matrix);
|
return graphene_matrix_is_identity (matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_look_at (CoglMatrix *matrix,
|
cogl_matrix_look_at (graphene_matrix_t *matrix,
|
||||||
float eye_position_x,
|
float eye_position_x,
|
||||||
float eye_position_y,
|
float eye_position_y,
|
||||||
float eye_position_z,
|
float eye_position_z,
|
||||||
float object_x,
|
float object_x,
|
||||||
float object_y,
|
float object_y,
|
||||||
float object_z,
|
float object_z,
|
||||||
float world_up_x,
|
float world_up_x,
|
||||||
float world_up_y,
|
float world_up_y,
|
||||||
float world_up_z)
|
float world_up_z)
|
||||||
{
|
{
|
||||||
graphene_vec3_t eye;
|
graphene_vec3_t eye;
|
||||||
graphene_vec3_t center;
|
graphene_vec3_t center;
|
||||||
graphene_vec3_t up;
|
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 (&eye, eye_position_x, eye_position_y, eye_position_z);
|
||||||
graphene_vec3_init (¢er, object_x, object_y, object_z);
|
graphene_vec3_init (¢er, object_x, object_y, object_z);
|
||||||
@ -429,7 +433,7 @@ cogl_matrix_look_at (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
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 */
|
/* We don't need to do anything if the matrix is the identity matrix */
|
||||||
if (graphene_matrix_is_identity (matrix))
|
if (graphene_matrix_is_identity (matrix))
|
||||||
@ -439,8 +443,8 @@ cogl_matrix_transpose (CoglMatrix *matrix)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_skew_xy (CoglMatrix *matrix,
|
cogl_matrix_skew_xy (graphene_matrix_t *matrix,
|
||||||
float factor)
|
float factor)
|
||||||
{
|
{
|
||||||
graphene_matrix_t skew;
|
graphene_matrix_t skew;
|
||||||
|
|
||||||
@ -452,8 +456,8 @@ cogl_matrix_skew_xy (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_skew_xz (CoglMatrix *matrix,
|
cogl_matrix_skew_xz (graphene_matrix_t *matrix,
|
||||||
float factor)
|
float factor)
|
||||||
{
|
{
|
||||||
graphene_matrix_t skew;
|
graphene_matrix_t skew;
|
||||||
|
|
||||||
@ -465,8 +469,8 @@ cogl_matrix_skew_xz (CoglMatrix *matrix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_matrix_skew_yz (CoglMatrix *matrix,
|
cogl_matrix_skew_yz (graphene_matrix_t *matrix,
|
||||||
float factor)
|
float factor)
|
||||||
{
|
{
|
||||||
graphene_matrix_t skew;
|
graphene_matrix_t skew;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ G_BEGIN_DECLS
|
|||||||
* ]|
|
* ]|
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_init_identity (CoglMatrix *matrix);
|
cogl_matrix_init_identity (graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_init_translation:
|
* cogl_matrix_init_translation:
|
||||||
@ -91,10 +91,10 @@ cogl_matrix_init_identity (CoglMatrix *matrix);
|
|||||||
* Since: 2.0
|
* Since: 2.0
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_init_translation (CoglMatrix *matrix,
|
cogl_matrix_init_translation (graphene_matrix_t *matrix,
|
||||||
float tx,
|
float tx,
|
||||||
float ty,
|
float ty,
|
||||||
float tz);
|
float tz);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_multiply:
|
* 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>
|
* @result can be equal to @a but can't be equal to @b.</note>
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_multiply (CoglMatrix *result,
|
cogl_matrix_multiply (graphene_matrix_t *result,
|
||||||
const CoglMatrix *a,
|
const graphene_matrix_t *a,
|
||||||
const CoglMatrix *b);
|
const graphene_matrix_t *b);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_rotate:
|
* cogl_matrix_rotate:
|
||||||
@ -125,11 +125,11 @@ cogl_matrix_multiply (CoglMatrix *result,
|
|||||||
* of @angle degrees around the specified 3D vector.
|
* of @angle degrees around the specified 3D vector.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_rotate (CoglMatrix *matrix,
|
cogl_matrix_rotate (graphene_matrix_t *matrix,
|
||||||
float angle,
|
float angle,
|
||||||
float x,
|
float x,
|
||||||
float y,
|
float y,
|
||||||
float z);
|
float z);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_rotate_euler:
|
* cogl_matrix_rotate_euler:
|
||||||
@ -142,7 +142,7 @@ cogl_matrix_rotate (CoglMatrix *matrix,
|
|||||||
* Since: 2.0
|
* Since: 2.0
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_rotate_euler (CoglMatrix *matrix,
|
cogl_matrix_rotate_euler (graphene_matrix_t *matrix,
|
||||||
const graphene_euler_t *euler);
|
const graphene_euler_t *euler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,10 +156,10 @@ cogl_matrix_rotate_euler (CoglMatrix *matrix,
|
|||||||
* the X, Y and Z axis.
|
* the X, Y and Z axis.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_translate (CoglMatrix *matrix,
|
cogl_matrix_translate (graphene_matrix_t *matrix,
|
||||||
float x,
|
float x,
|
||||||
float y,
|
float y,
|
||||||
float z);
|
float z);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_scale:
|
* cogl_matrix_scale:
|
||||||
@ -172,7 +172,7 @@ cogl_matrix_translate (CoglMatrix *matrix,
|
|||||||
* Y and Z axis.
|
* Y and Z axis.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_scale (CoglMatrix *matrix,
|
cogl_matrix_scale (graphene_matrix_t *matrix,
|
||||||
float sx,
|
float sx,
|
||||||
float sy,
|
float sy,
|
||||||
float sz);
|
float sz);
|
||||||
@ -221,16 +221,16 @@ cogl_matrix_scale (CoglMatrix *matrix,
|
|||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_look_at (CoglMatrix *matrix,
|
cogl_matrix_look_at (graphene_matrix_t *matrix,
|
||||||
float eye_position_x,
|
float eye_position_x,
|
||||||
float eye_position_y,
|
float eye_position_y,
|
||||||
float eye_position_z,
|
float eye_position_z,
|
||||||
float object_x,
|
float object_x,
|
||||||
float object_y,
|
float object_y,
|
||||||
float object_z,
|
float object_z,
|
||||||
float world_up_x,
|
float world_up_x,
|
||||||
float world_up_y,
|
float world_up_y,
|
||||||
float world_up_z);
|
float world_up_z);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_frustum:
|
* cogl_matrix_frustum:
|
||||||
@ -249,13 +249,13 @@ cogl_matrix_look_at (CoglMatrix *matrix,
|
|||||||
* Multiplies @matrix by the given frustum perspective matrix.
|
* Multiplies @matrix by the given frustum perspective matrix.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_frustum (CoglMatrix *matrix,
|
cogl_matrix_frustum (graphene_matrix_t *matrix,
|
||||||
float left,
|
float left,
|
||||||
float right,
|
float right,
|
||||||
float bottom,
|
float bottom,
|
||||||
float top,
|
float top,
|
||||||
float z_near,
|
float z_near,
|
||||||
float z_far);
|
float z_far);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_perspective:
|
* cogl_matrix_perspective:
|
||||||
@ -274,11 +274,11 @@ cogl_matrix_frustum (CoglMatrix *matrix,
|
|||||||
* objects near to each other.</note>
|
* objects near to each other.</note>
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_perspective (CoglMatrix *matrix,
|
cogl_matrix_perspective (graphene_matrix_t *matrix,
|
||||||
float fov_y,
|
float fov_y,
|
||||||
float aspect,
|
float aspect,
|
||||||
float z_near,
|
float z_near,
|
||||||
float z_far);
|
float z_far);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_orthographic:
|
* cogl_matrix_orthographic:
|
||||||
@ -300,13 +300,13 @@ cogl_matrix_perspective (CoglMatrix *matrix,
|
|||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_orthographic (CoglMatrix *matrix,
|
cogl_matrix_orthographic (graphene_matrix_t *matrix,
|
||||||
float left,
|
float left,
|
||||||
float bottom,
|
float bottom,
|
||||||
float right,
|
float right,
|
||||||
float top,
|
float top,
|
||||||
float near,
|
float near,
|
||||||
float far);
|
float far);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_view_2d_in_frustum:
|
* cogl_matrix_view_2d_in_frustum:
|
||||||
@ -339,15 +339,15 @@ cogl_matrix_orthographic (CoglMatrix *matrix,
|
|||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
|
cogl_matrix_view_2d_in_frustum (graphene_matrix_t *matrix,
|
||||||
float left,
|
float left,
|
||||||
float right,
|
float right,
|
||||||
float bottom,
|
float bottom,
|
||||||
float top,
|
float top,
|
||||||
float z_near,
|
float z_near,
|
||||||
float z_2d,
|
float z_2d,
|
||||||
float width_2d,
|
float width_2d,
|
||||||
float height_2d);
|
float height_2d);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_view_2d_in_perspective:
|
* cogl_matrix_view_2d_in_perspective:
|
||||||
@ -378,13 +378,13 @@ cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
|
|||||||
* Stability: unstable
|
* Stability: unstable
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
|
cogl_matrix_view_2d_in_perspective (graphene_matrix_t *matrix,
|
||||||
float fov_y,
|
float fov_y,
|
||||||
float aspect,
|
float aspect,
|
||||||
float z_near,
|
float z_near,
|
||||||
float z_2d,
|
float z_2d,
|
||||||
float width_2d,
|
float width_2d,
|
||||||
float height_2d);
|
float height_2d);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_init_from_array:
|
* cogl_matrix_init_from_array:
|
||||||
@ -394,19 +394,19 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
|
|||||||
* Initializes @matrix with the contents of @array
|
* Initializes @matrix with the contents of @array
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_init_from_array (CoglMatrix *matrix,
|
cogl_matrix_init_from_array (graphene_matrix_t *matrix,
|
||||||
const float *array);
|
const float *array);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_init_from_matrix:
|
* cogl_matrix_init_from_matrix:
|
||||||
* @matrix: A 4x4 transformation 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
|
* Initializes @matrix with the contents of @source
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_init_from_matrix (CoglMatrix *matrix,
|
cogl_matrix_init_from_matrix (graphene_matrix_t *matrix,
|
||||||
const CoglMatrix *source);
|
const graphene_matrix_t *source);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_to_float:
|
* 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.
|
* Casts @matrix to a float array which can be directly passed to OpenGL.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_to_float (const CoglMatrix *matrix,
|
cogl_matrix_to_float (const graphene_matrix_t *matrix,
|
||||||
float *out_array);
|
float *out_array);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_get_value:
|
* cogl_matrix_get_value:
|
||||||
@ -428,9 +428,9 @@ cogl_matrix_to_float (const CoglMatrix *matrix,
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT float
|
COGL_EXPORT float
|
||||||
cogl_matrix_get_value (const CoglMatrix *matrix,
|
cogl_matrix_get_value (const graphene_matrix_t *matrix,
|
||||||
unsigned int row,
|
unsigned int row,
|
||||||
unsigned int column);
|
unsigned int column);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_init_from_euler:
|
* cogl_matrix_init_from_euler:
|
||||||
@ -440,7 +440,7 @@ cogl_matrix_get_value (const CoglMatrix *matrix,
|
|||||||
* Initializes @matrix from a #graphene_euler_t rotation.
|
* Initializes @matrix from a #graphene_euler_t rotation.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_init_from_euler (CoglMatrix *matrix,
|
cogl_matrix_init_from_euler (graphene_matrix_t *matrix,
|
||||||
const graphene_euler_t *euler);
|
const graphene_euler_t *euler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -462,28 +462,28 @@ cogl_matrix_equal (const void *v1, const void *v2);
|
|||||||
* cogl_matrix_copy:
|
* cogl_matrix_copy:
|
||||||
* @matrix: A 4x4 transformation matrix you want to 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.
|
* 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()
|
* should be freed using cogl_matrix_free()
|
||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT CoglMatrix *
|
COGL_EXPORT graphene_matrix_t *
|
||||||
cogl_matrix_copy (const CoglMatrix *matrix);
|
cogl_matrix_copy (const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_free:
|
* cogl_matrix_free:
|
||||||
* @matrix: A 4x4 transformation matrix you want to 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().
|
* cogl_matrix_copy().
|
||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_free (CoglMatrix *matrix);
|
cogl_matrix_free (graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_get_inverse:
|
* cogl_matrix_get_inverse:
|
||||||
@ -491,7 +491,7 @@ cogl_matrix_free (CoglMatrix *matrix);
|
|||||||
* @inverse: (out): The destination for a 4x4 inverse transformation matrix
|
* @inverse: (out): The destination for a 4x4 inverse transformation matrix
|
||||||
*
|
*
|
||||||
* Gets the inverse transform of a given matrix and uses it to initialize
|
* 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
|
* Return value: %TRUE if the inverse was successfully calculated or %FALSE
|
||||||
* for degenerate transformations that can't be inverted (in this case the
|
* for degenerate transformations that can't be inverted (in this case the
|
||||||
@ -500,12 +500,12 @@ cogl_matrix_free (CoglMatrix *matrix);
|
|||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT gboolean
|
COGL_EXPORT gboolean
|
||||||
cogl_matrix_get_inverse (const CoglMatrix *matrix,
|
cogl_matrix_get_inverse (const graphene_matrix_t *matrix,
|
||||||
CoglMatrix *inverse);
|
graphene_matrix_t *inverse);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_is_identity:
|
* cogl_matrix_is_identity:
|
||||||
* @matrix: A #CoglMatrix
|
* @matrix: A #graphene_matrix_t
|
||||||
*
|
*
|
||||||
* Determines if the given matrix is an identity matrix.
|
* Determines if the given matrix is an identity matrix.
|
||||||
*
|
*
|
||||||
@ -513,11 +513,11 @@ cogl_matrix_get_inverse (const CoglMatrix *matrix,
|
|||||||
* Since: 1.8
|
* Since: 1.8
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT gboolean
|
COGL_EXPORT gboolean
|
||||||
cogl_matrix_is_identity (const CoglMatrix *matrix);
|
cogl_matrix_is_identity (const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_transpose:
|
* cogl_matrix_transpose:
|
||||||
* @matrix: A #CoglMatrix
|
* @matrix: A #graphene_matrix_t
|
||||||
*
|
*
|
||||||
* Replaces @matrix with its transpose. Ie, every element (i,j) in the
|
* Replaces @matrix with its transpose. Ie, every element (i,j) in the
|
||||||
* new matrix is taken from element (j,i) in the old matrix.
|
* 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
|
* Since: 1.10
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_transpose (CoglMatrix *matrix);
|
cogl_matrix_transpose (graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_debug_matrix_print:
|
* 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
|
* Since: 2.0
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_debug_matrix_print (const CoglMatrix *matrix);
|
cogl_debug_matrix_print (const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_determinant:
|
* cogl_matrix_determinant:
|
||||||
* @matrix: a #CoglMatrix
|
* @matrix: a #graphene_matrix_t
|
||||||
*
|
*
|
||||||
* Computes the determinant of the @matrix.
|
* Computes the determinant of the @matrix.
|
||||||
*
|
*
|
||||||
* Returns: the value of the determinant
|
* Returns: the value of the determinant
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT float
|
COGL_EXPORT float
|
||||||
cogl_matrix_determinant (const CoglMatrix *matrix);
|
cogl_matrix_determinant (const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_skew_xy:
|
* cogl_matrix_skew_xy:
|
||||||
* @matrix: a #CoglMatrix
|
* @matrix: a #graphene_matrix_t
|
||||||
* @factor: skew factor
|
* @factor: skew factor
|
||||||
*
|
*
|
||||||
* Adds a skew of factor on the X and Y axis to @matrix.
|
* Adds a skew of factor on the X and Y axis to @matrix.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_skew_xy (CoglMatrix *matrix,
|
cogl_matrix_skew_xy (graphene_matrix_t *matrix,
|
||||||
float factor);
|
float factor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_skew_xz:
|
* cogl_matrix_skew_xz:
|
||||||
* @matrix: a #CoglMatrix
|
* @matrix: a #graphene_matrix_t
|
||||||
* @factor: skew factor
|
* @factor: skew factor
|
||||||
*
|
*
|
||||||
* Adds a skew of factor on the X and Z axis to @matrix.
|
* Adds a skew of factor on the X and Z axis to @matrix.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_skew_xz (CoglMatrix *matrix,
|
cogl_matrix_skew_xz (graphene_matrix_t *matrix,
|
||||||
float factor);
|
float factor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_matrix_skew_yz:
|
* cogl_matrix_skew_yz:
|
||||||
* @matrix: a #CoglMatrix
|
* @matrix: a #graphene_matrix_t
|
||||||
* @factor: skew factor
|
* @factor: skew factor
|
||||||
*
|
*
|
||||||
* Adds a skew of factor on the Y and Z axis to @matrix.
|
* Adds a skew of factor on the Y and Z axis to @matrix.
|
||||||
*/
|
*/
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_matrix_skew_yz (CoglMatrix *matrix,
|
cogl_matrix_skew_yz (graphene_matrix_t *matrix,
|
||||||
float factor);
|
float factor);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ typedef struct
|
|||||||
float texture_combine_constant[4];
|
float texture_combine_constant[4];
|
||||||
|
|
||||||
/* The texture matrix dscribes how to transform texture coordinates */
|
/* The texture matrix dscribes how to transform texture coordinates */
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
|
|
||||||
CoglPipelineSnippetList vertex_snippets;
|
CoglPipelineSnippetList vertex_snippets;
|
||||||
CoglPipelineSnippetList fragment_snippets;
|
CoglPipelineSnippetList fragment_snippets;
|
||||||
|
@ -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
|
/* 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
|
matrix out-param. For an internal API it's good to be able to avoid
|
||||||
copying the matrix */
|
copying the matrix */
|
||||||
const CoglMatrix *
|
const graphene_matrix_t *
|
||||||
_cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline, int layer_index)
|
_cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline, int layer_index)
|
||||||
{
|
{
|
||||||
CoglPipelineLayerState change =
|
CoglPipelineLayerState change =
|
||||||
@ -1143,7 +1143,7 @@ _cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline, int layer_index)
|
|||||||
void
|
void
|
||||||
cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
|
cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
|
||||||
int layer_index,
|
int layer_index,
|
||||||
const CoglMatrix *matrix)
|
const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
CoglPipelineLayerState state = COGL_PIPELINE_LAYER_STATE_USER_MATRIX;
|
CoglPipelineLayerState state = COGL_PIPELINE_LAYER_STATE_USER_MATRIX;
|
||||||
CoglPipelineLayer *layer;
|
CoglPipelineLayer *layer;
|
||||||
|
@ -336,7 +336,7 @@ cogl_pipeline_set_layer_combine_constant (CoglPipeline *pipeline,
|
|||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
|
cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
|
||||||
int layer_index,
|
int layer_index,
|
||||||
const CoglMatrix *matrix);
|
const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_pipeline_get_n_layers:
|
* cogl_pipeline_get_n_layers:
|
||||||
|
@ -732,7 +732,7 @@ _cogl_pipeline_journal_ref (CoglPipeline *pipeline);
|
|||||||
void
|
void
|
||||||
_cogl_pipeline_journal_unref (CoglPipeline *pipeline);
|
_cogl_pipeline_journal_unref (CoglPipeline *pipeline);
|
||||||
|
|
||||||
const CoglMatrix *
|
const graphene_matrix_t *
|
||||||
_cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline,
|
_cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline,
|
||||||
int layer_index);
|
int layer_index);
|
||||||
|
|
||||||
|
@ -715,7 +715,7 @@ cogl_pipeline_set_uniform_int (CoglPipeline *pipeline,
|
|||||||
*
|
*
|
||||||
* If @transpose is %FALSE then the matrix is expected to be in
|
* 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
|
* 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
|
* the result of cogl_matrix_to_float() in @value and setting
|
||||||
* @transpose to %FALSE.
|
* @transpose to %FALSE.
|
||||||
*
|
*
|
||||||
|
@ -79,11 +79,11 @@ typedef enum _CoglPipelineEvalFlags
|
|||||||
} CoglPipelineEvalFlags;
|
} CoglPipelineEvalFlags;
|
||||||
|
|
||||||
void
|
void
|
||||||
_cogl_transform_point (const CoglMatrix *matrix_mv,
|
_cogl_transform_point (const graphene_matrix_t *matrix_mv,
|
||||||
const CoglMatrix *matrix_p,
|
const graphene_matrix_t *matrix_p,
|
||||||
const float *viewport,
|
const float *viewport,
|
||||||
float *x,
|
float *x,
|
||||||
float *y);
|
float *y);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_cogl_check_extension (const char *name, char * const *ext);
|
_cogl_check_extension (const char *name, char * const *ext);
|
||||||
|
@ -86,10 +86,6 @@ typedef void * CoglHandle;
|
|||||||
COGL_EXPORT GType
|
COGL_EXPORT GType
|
||||||
cogl_handle_get_type (void) G_GNUC_CONST;
|
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:
|
* CoglAngle:
|
||||||
*
|
*
|
||||||
|
@ -175,11 +175,11 @@ _cogl_driver_error_quark (void)
|
|||||||
/* Transform a homogeneous vertex position from model space to Cogl
|
/* Transform a homogeneous vertex position from model space to Cogl
|
||||||
* window coordinates (with 0,0 being top left) */
|
* window coordinates (with 0,0 being top left) */
|
||||||
void
|
void
|
||||||
_cogl_transform_point (const CoglMatrix *matrix_mv,
|
_cogl_transform_point (const graphene_matrix_t *matrix_mv,
|
||||||
const CoglMatrix *matrix_p,
|
const graphene_matrix_t *matrix_p,
|
||||||
const float *viewport,
|
const float *viewport,
|
||||||
float *x,
|
float *x,
|
||||||
float *y)
|
float *y)
|
||||||
{
|
{
|
||||||
float z = 0;
|
float z = 0;
|
||||||
float w = 1;
|
float w = 1;
|
||||||
|
@ -129,9 +129,9 @@ cogl_material_set_layer_combine_constant (CoglMaterial *material,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_material_set_layer_matrix (CoglMaterial *material,
|
cogl_material_set_layer_matrix (CoglMaterial *material,
|
||||||
int layer_index,
|
int layer_index,
|
||||||
const CoglMatrix *matrix)
|
const graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
cogl_pipeline_set_layer_matrix (COGL_PIPELINE (material),
|
cogl_pipeline_set_layer_matrix (COGL_PIPELINE (material),
|
||||||
layer_index, matrix);
|
layer_index, matrix);
|
||||||
|
@ -590,9 +590,9 @@ cogl_material_set_layer_combine_constant (CoglMaterial *material,
|
|||||||
*/
|
*/
|
||||||
COGL_DEPRECATED_FOR (cogl_pipeline_set_layer_matrix)
|
COGL_DEPRECATED_FOR (cogl_pipeline_set_layer_matrix)
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_material_set_layer_matrix (CoglMaterial *material,
|
cogl_material_set_layer_matrix (CoglMaterial *material,
|
||||||
int layer_index,
|
int layer_index,
|
||||||
const CoglMatrix *matrix);
|
const graphene_matrix_t *matrix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_material_set_layer_filters:
|
* cogl_material_set_layer_filters:
|
||||||
|
@ -133,7 +133,7 @@ add_stencil_clip_region (CoglFramebuffer *framebuffer,
|
|||||||
{
|
{
|
||||||
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
||||||
CoglMatrixEntry *old_projection_entry, *old_modelview_entry;
|
CoglMatrixEntry *old_projection_entry, *old_modelview_entry;
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
int num_rectangles = cairo_region_num_rectangles (region);
|
int num_rectangles = cairo_region_num_rectangles (region);
|
||||||
int i;
|
int i;
|
||||||
CoglVertexP2 *vertices;
|
CoglVertexP2 *vertices;
|
||||||
|
@ -431,7 +431,7 @@ update_constants_cb (CoglPipeline *pipeline,
|
|||||||
if (unit_state->texture_matrix_uniform != -1 &&
|
if (unit_state->texture_matrix_uniform != -1 &&
|
||||||
(state->update_all || unit_state->dirty_texture_matrix))
|
(state->update_all || unit_state->dirty_texture_matrix))
|
||||||
{
|
{
|
||||||
const CoglMatrix *matrix;
|
const graphene_matrix_t *matrix;
|
||||||
float array[16];
|
float array[16];
|
||||||
|
|
||||||
matrix = _cogl_pipeline_get_layer_matrix (pipeline, layer_index);
|
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 projection_changed;
|
||||||
gboolean need_modelview;
|
gboolean need_modelview;
|
||||||
gboolean need_projection;
|
gboolean need_projection;
|
||||||
CoglMatrix modelview, projection;
|
graphene_matrix_t modelview, projection;
|
||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_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)
|
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_entry_get (projection_entry, &tmp_matrix);
|
||||||
cogl_matrix_multiply (&projection,
|
cogl_matrix_multiply (&projection,
|
||||||
&ctx->y_flip_matrix,
|
&ctx->y_flip_matrix,
|
||||||
@ -1095,7 +1095,7 @@ _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CoglMatrix combined;
|
graphene_matrix_t combined;
|
||||||
|
|
||||||
cogl_matrix_multiply (&combined,
|
cogl_matrix_multiply (&combined,
|
||||||
&projection,
|
&projection,
|
||||||
|
@ -218,7 +218,7 @@ paint_color_pipelines (TestState *state)
|
|||||||
static void
|
static void
|
||||||
paint_matrix_pipeline (CoglPipeline *pipeline)
|
paint_matrix_pipeline (CoglPipeline *pipeline)
|
||||||
{
|
{
|
||||||
CoglMatrix matrices[4];
|
graphene_matrix_t matrices[4];
|
||||||
float matrix_floats[16 * 4];
|
float matrix_floats[16 * 4];
|
||||||
int uniform_location;
|
int uniform_location;
|
||||||
int i;
|
int i;
|
||||||
|
@ -54,7 +54,7 @@ paint (TestState *state)
|
|||||||
};
|
};
|
||||||
CoglTexture *tex0, *tex1;
|
CoglTexture *tex0, *tex1;
|
||||||
CoglPipeline *pipeline;
|
CoglPipeline *pipeline;
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
cogl_framebuffer_orthographic (test_fb,
|
cogl_framebuffer_orthographic (test_fb,
|
||||||
|
@ -8,7 +8,7 @@ typedef CoglVertexP2C4 Vertex;
|
|||||||
static void
|
static void
|
||||||
setup_orthographic_modelview (void)
|
setup_orthographic_modelview (void)
|
||||||
{
|
{
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
int fb_width = cogl_framebuffer_get_width (test_fb);
|
int fb_width = cogl_framebuffer_get_width (test_fb);
|
||||||
int fb_height = cogl_framebuffer_get_height (test_fb);
|
int fb_height = cogl_framebuffer_get_height (test_fb);
|
||||||
|
|
||||||
|
@ -20,9 +20,9 @@ on_paint (ClutterActor *actor,
|
|||||||
void *state)
|
void *state)
|
||||||
{
|
{
|
||||||
float saved_viewport[4];
|
float saved_viewport[4];
|
||||||
CoglMatrix saved_projection;
|
graphene_matrix_t saved_projection;
|
||||||
CoglMatrix projection;
|
graphene_matrix_t projection;
|
||||||
CoglMatrix modelview;
|
graphene_matrix_t modelview;
|
||||||
guchar *data;
|
guchar *data;
|
||||||
CoglHandle tex;
|
CoglHandle tex;
|
||||||
CoglHandle offscreen;
|
CoglHandle offscreen;
|
||||||
|
@ -431,7 +431,7 @@ test_modify_vertex_layer (TestState *state)
|
|||||||
{
|
{
|
||||||
CoglPipeline *pipeline;
|
CoglPipeline *pipeline;
|
||||||
CoglSnippet *snippet;
|
CoglSnippet *snippet;
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
|
|
||||||
/* Test modifying the vertex layer code */
|
/* Test modifying the vertex layer code */
|
||||||
pipeline = create_texture_pipeline (state);
|
pipeline = create_texture_pipeline (state);
|
||||||
@ -460,7 +460,7 @@ test_replace_vertex_layer (TestState *state)
|
|||||||
{
|
{
|
||||||
CoglPipeline *pipeline;
|
CoglPipeline *pipeline;
|
||||||
CoglSnippet *snippet;
|
CoglSnippet *snippet;
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
|
|
||||||
/* Test replacing the vertex layer code */
|
/* Test replacing the vertex layer code */
|
||||||
pipeline = create_texture_pipeline (state);
|
pipeline = create_texture_pipeline (state);
|
||||||
@ -490,8 +490,8 @@ test_vertex_transform_hook (TestState *state)
|
|||||||
{
|
{
|
||||||
CoglPipeline *pipeline;
|
CoglPipeline *pipeline;
|
||||||
CoglSnippet *snippet;
|
CoglSnippet *snippet;
|
||||||
CoglMatrix identity_matrix;
|
graphene_matrix_t identity_matrix;
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
float v[16];
|
float v[16];
|
||||||
int location;
|
int location;
|
||||||
|
|
||||||
|
@ -71,9 +71,9 @@ on_paint (ClutterActor *actor,
|
|||||||
void *state)
|
void *state)
|
||||||
{
|
{
|
||||||
float saved_viewport[4];
|
float saved_viewport[4];
|
||||||
CoglMatrix saved_projection;
|
graphene_matrix_t saved_projection;
|
||||||
CoglMatrix projection;
|
graphene_matrix_t projection;
|
||||||
CoglMatrix modelview;
|
graphene_matrix_t modelview;
|
||||||
guchar *data;
|
guchar *data;
|
||||||
CoglHandle tex;
|
CoglHandle tex;
|
||||||
CoglHandle offscreen;
|
CoglHandle offscreen;
|
||||||
|
@ -74,8 +74,8 @@ meta_renderer_view_get_crtc (MetaRendererView *view)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_renderer_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
meta_renderer_view_get_offscreen_transformation_matrix (ClutterStageView *view,
|
||||||
CoglMatrix *matrix)
|
graphene_matrix_t *matrix)
|
||||||
{
|
{
|
||||||
MetaRendererView *renderer_view = META_RENDERER_VIEW (view);
|
MetaRendererView *renderer_view = META_RENDERER_VIEW (view);
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ static void
|
|||||||
meta_renderer_view_setup_offscreen_blit_pipeline (ClutterStageView *view,
|
meta_renderer_view_setup_offscreen_blit_pipeline (ClutterStageView *view,
|
||||||
CoglPipeline *pipeline)
|
CoglPipeline *pipeline)
|
||||||
{
|
{
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
|
|
||||||
meta_renderer_view_get_offscreen_transformation_matrix (view, &matrix);
|
meta_renderer_view_get_offscreen_transformation_matrix (view, &matrix);
|
||||||
cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix);
|
cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix);
|
||||||
|
@ -110,8 +110,8 @@ draw_view (MetaStageX11Nested *stage_nested,
|
|||||||
ClutterStageView *stage_view = CLUTTER_STAGE_VIEW (renderer_view);
|
ClutterStageView *stage_view = CLUTTER_STAGE_VIEW (renderer_view);
|
||||||
MetaCrtc *crtc;
|
MetaCrtc *crtc;
|
||||||
const MetaCrtcConfig *crtc_config;
|
const MetaCrtcConfig *crtc_config;
|
||||||
CoglMatrix projection_matrix;
|
graphene_matrix_t projection_matrix;
|
||||||
CoglMatrix transform;
|
graphene_matrix_t transform;
|
||||||
float texture_width, texture_height;
|
float texture_width, texture_height;
|
||||||
float sample_x, sample_y, sample_width, sample_height;
|
float sample_x, sample_y, sample_width, sample_height;
|
||||||
float s_1, t_1, s_2, t_2;
|
float s_1, t_1, s_2, t_2;
|
||||||
|
@ -140,7 +140,7 @@ meta_actor_painting_untransformed (CoglFramebuffer *fb,
|
|||||||
int *x_origin,
|
int *x_origin,
|
||||||
int *y_origin)
|
int *y_origin)
|
||||||
{
|
{
|
||||||
CoglMatrix modelview, projection, modelview_projection;
|
graphene_matrix_t modelview, projection, modelview_projection;
|
||||||
graphene_point3d_t vertices[4];
|
graphene_point3d_t vertices[4];
|
||||||
float viewport[4];
|
float viewport[4];
|
||||||
int i;
|
int i;
|
||||||
|
@ -273,7 +273,7 @@ get_base_pipeline (MetaShapedTexture *stex,
|
|||||||
CoglContext *ctx)
|
CoglContext *ctx)
|
||||||
{
|
{
|
||||||
CoglPipeline *pipeline;
|
CoglPipeline *pipeline;
|
||||||
CoglMatrix matrix;
|
graphene_matrix_t matrix;
|
||||||
|
|
||||||
if (stex->base_pipeline)
|
if (stex->base_pipeline)
|
||||||
return stex->base_pipeline;
|
return stex->base_pipeline;
|
||||||
@ -1364,7 +1364,7 @@ get_image_via_offscreen (MetaShapedTexture *stex,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
CoglOffscreen *offscreen;
|
CoglOffscreen *offscreen;
|
||||||
CoglFramebuffer *fb;
|
CoglFramebuffer *fb;
|
||||||
CoglMatrix projection_matrix;
|
graphene_matrix_t projection_matrix;
|
||||||
cairo_rectangle_int_t fallback_clip;
|
cairo_rectangle_int_t fallback_clip;
|
||||||
ClutterColor clear_color;
|
ClutterColor clear_color;
|
||||||
ClutterPaintContext *paint_context;
|
ClutterPaintContext *paint_context;
|
||||||
|
@ -248,7 +248,7 @@ get_paint_level (ClutterPaintContext *paint_context,
|
|||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
CoglMatrix projection, modelview, pm;
|
graphene_matrix_t projection, modelview, pm;
|
||||||
float xx, xy, xw;
|
float xx, xy, xw;
|
||||||
float yx, yy, yw;
|
float yx, yy, yw;
|
||||||
float wx, wy, ww;
|
float wx, wy, ww;
|
||||||
|
@ -1111,7 +1111,7 @@ meta_window_actor_set_geometry_scale (MetaWindowActor *window_actor,
|
|||||||
{
|
{
|
||||||
MetaWindowActorPrivate *priv =
|
MetaWindowActorPrivate *priv =
|
||||||
meta_window_actor_get_instance_private (window_actor);
|
meta_window_actor_get_instance_private (window_actor);
|
||||||
CoglMatrix child_transform;
|
graphene_matrix_t child_transform;
|
||||||
|
|
||||||
if (priv->geometry_scale == geometry_scale)
|
if (priv->geometry_scale == geometry_scale)
|
||||||
return;
|
return;
|
||||||
|
@ -10,7 +10,7 @@ static void
|
|||||||
actor_pivot (void)
|
actor_pivot (void)
|
||||||
{
|
{
|
||||||
ClutterActor *stage, *actor_implicit, *actor_explicit;
|
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);
|
ClutterActorBox allocation = CLUTTER_ACTOR_BOX_INIT (0, 0, 90, 30);
|
||||||
gfloat angle = 30;
|
gfloat angle = 30;
|
||||||
|
|
||||||
|
@ -21,13 +21,13 @@ typedef struct _TestMultiLayerMaterialState
|
|||||||
ClutterTimeline *timeline;
|
ClutterTimeline *timeline;
|
||||||
|
|
||||||
CoglHandle material0;
|
CoglHandle material0;
|
||||||
CoglMatrix tex_matrix0;
|
graphene_matrix_t tex_matrix0;
|
||||||
CoglMatrix rot_matrix0;
|
graphene_matrix_t rot_matrix0;
|
||||||
CoglHandle light_tex0;
|
CoglHandle light_tex0;
|
||||||
|
|
||||||
CoglHandle material1;
|
CoglHandle material1;
|
||||||
CoglMatrix tex_matrix1;
|
graphene_matrix_t tex_matrix1;
|
||||||
CoglMatrix rot_matrix1;
|
graphene_matrix_t rot_matrix1;
|
||||||
CoglHandle light_tex1;
|
CoglHandle light_tex1;
|
||||||
|
|
||||||
} TestMultiLayerMaterialState;
|
} TestMultiLayerMaterialState;
|
||||||
|
@ -181,8 +181,8 @@ setup_viewport (CoglFramebuffer *framebuffer,
|
|||||||
float z_far)
|
float z_far)
|
||||||
{
|
{
|
||||||
float z_camera;
|
float z_camera;
|
||||||
CoglMatrix projection_matrix;
|
graphene_matrix_t projection_matrix;
|
||||||
CoglMatrix mv_matrix;
|
graphene_matrix_t mv_matrix;
|
||||||
|
|
||||||
cogl_framebuffer_set_viewport (framebuffer, 0, 0, width, height);
|
cogl_framebuffer_set_viewport (framebuffer, 0, 0, width, height);
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ paint_cb (ClutterActor *stage,
|
|||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer =
|
CoglFramebuffer *framebuffer =
|
||||||
clutter_paint_context_get_framebuffer (paint_context);
|
clutter_paint_context_get_framebuffer (paint_context);
|
||||||
CoglMatrix old_matrix, new_matrix;
|
graphene_matrix_t old_matrix, new_matrix;
|
||||||
int i;
|
int i;
|
||||||
float diff_time;
|
float diff_time;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user