actor: Cache per-actor transforms
authorRobert Bragg <robert@linux.intel.com>
Fri, 4 Feb 2011 09:17:16 +0000 (09:17 +0000)
committerRobert Bragg <robert@linux.intel.com>
Mon, 7 Mar 2011 13:26:20 +0000 (13:26 +0000)
commit3b88029f38ef9172bbd07608cbbb863c81aad845
tree6a519b1a99a33da9bdda39a13b7a59cd816b092d
parent19b86229831a049e8f337e2d7a7a4782961b664c
actor: Cache per-actor transforms

Previously each time we needed to retrieve the model transform for a
given actor we would call the apply_transform vfunc which would build up
a transformation matrix based on the actor's current anchor point, its
scale, its allocation and rotation. The apply_transform implementation
would repeatedly call API like cogl_matrix_rotate, cogl_matrix_translate
and cogl_matrix_scale.

All this micro matrix manipulation APIs were starting to show up in the
profiles of dynamic applications so this adds priv->transform matrix
cache which maintains the combined result of the actors scale, rotation
and anchor point etc. Whenever something like the rotation changes then
then the matrix is marked as dirty, but so long as the matrix isn't
dirty then the apply_transform vfunc now just calls cogl_matrix_multiply
with the cached transform matrix.
clutter/clutter-actor.c