diff --git a/cogl/cogl-matrix-stack.c b/cogl/cogl-matrix-stack.c index 7b4ad69f8..d4defd1ce 100644 --- a/cogl/cogl-matrix-stack.c +++ b/cogl/cogl-matrix-stack.c @@ -473,3 +473,9 @@ _cogl_matrix_stack_get_age (CoglMatrixStack *stack) { return stack->age; } + +gboolean +_cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack) +{ + return _cogl_matrix_stack_top (stack)->is_identity; +} diff --git a/cogl/cogl-matrix-stack.h b/cogl/cogl-matrix-stack.h index 8efca3fed..5c8b954a1 100644 --- a/cogl/cogl-matrix-stack.h +++ b/cogl/cogl-matrix-stack.h @@ -110,4 +110,11 @@ _cogl_matrix_stack_dirty (CoglMatrixStack *stack); unsigned int _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 */