cogl-matrix-stack: Add _cogl_matrix_stack_has_identity_flag

This adds an internal function to quickly determine whether the top of
the matrix stack is known to be the identity matrix.
This commit is contained in:
Neil Roberts 2010-12-10 17:42:39 +00:00
parent c11f72fd6d
commit 35b07f6b83
2 changed files with 13 additions and 0 deletions

View File

@ -473,3 +473,9 @@ _cogl_matrix_stack_get_age (CoglMatrixStack *stack)
{ {
return stack->age; return stack->age;
} }
gboolean
_cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack)
{
return _cogl_matrix_stack_top (stack)->is_identity;
}

View File

@ -110,4 +110,11 @@ _cogl_matrix_stack_dirty (CoglMatrixStack *stack);
unsigned int unsigned int
_cogl_matrix_stack_get_age (CoglMatrixStack *stack); _cogl_matrix_stack_get_age (CoglMatrixStack *stack);
/* If this returns TRUE then the top of the matrix is definitely the
identity matrix. If it returns FALSE it may or may not be the
identity matrix but no expensive comparison is performed to verify
it. */
gboolean
_cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack);
#endif /* __COGL_MATRIX_STACK_H */ #endif /* __COGL_MATRIX_STACK_H */