mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 08:24:09 +00:00
cogl-matrix-stack: Adds _cogl_matrix_stack_equal
Adds a function for comparing the top matrix entries of two matrix stacks. Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
parent
a4f3d0d18b
commit
595311ba55
@ -552,3 +552,19 @@ _cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack)
|
||||
{
|
||||
return _cogl_matrix_stack_top (stack)->is_identity;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_cogl_matrix_stack_equal (CoglMatrixStack *stack0,
|
||||
CoglMatrixStack *stack1)
|
||||
{
|
||||
CoglMatrixState *state0 = _cogl_matrix_stack_top (stack0);
|
||||
CoglMatrixState *state1 = _cogl_matrix_stack_top (stack1);
|
||||
|
||||
if (state0->is_identity != state1->is_identity)
|
||||
return FALSE;
|
||||
|
||||
if (state0->is_identity)
|
||||
return TRUE;
|
||||
else
|
||||
return cogl_matrix_equal (&state0->matrix, &state1->matrix);
|
||||
}
|
||||
|
@ -127,4 +127,8 @@ _cogl_matrix_stack_prepare_for_flush (CoglMatrixStack *stack,
|
||||
CoglMatrixStackFlushFunc callback,
|
||||
void *user_data);
|
||||
|
||||
gboolean
|
||||
_cogl_matrix_stack_equal (CoglMatrixStack *stack0,
|
||||
CoglMatrixStack *stack1);
|
||||
|
||||
#endif /* __COGL_MATRIX_STACK_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user