mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
cogl-matrix-stack: Convert to be a CoglObject
We will want to use ref-counting on the CoglMatrixStack so it might as well be a CoglObject.
This commit is contained in:
@ -34,6 +34,7 @@
|
||||
#include "cogl-internal.h"
|
||||
#include "cogl-matrix-stack.h"
|
||||
#include "cogl-framebuffer-private.h"
|
||||
#include "cogl-object-private.h"
|
||||
|
||||
typedef struct {
|
||||
CoglMatrix matrix;
|
||||
@ -53,6 +54,8 @@ typedef struct {
|
||||
*/
|
||||
struct _CoglMatrixStack
|
||||
{
|
||||
CoglObject _parent;
|
||||
|
||||
GArray *stack;
|
||||
|
||||
/* which state does GL have, NULL if unknown */
|
||||
@ -62,6 +65,10 @@ struct _CoglMatrixStack
|
||||
unsigned int age;
|
||||
};
|
||||
|
||||
static void _cogl_matrix_stack_free (CoglMatrixStack *stack);
|
||||
|
||||
COGL_OBJECT_INTERNAL_DEFINE (MatrixStack, matrix_stack);
|
||||
|
||||
/* XXX: this doesn't initialize the matrix! */
|
||||
static void
|
||||
_cogl_matrix_state_init (CoglMatrixState *state)
|
||||
@ -142,11 +149,11 @@ _cogl_matrix_stack_new (void)
|
||||
|
||||
stack->age = 0;
|
||||
|
||||
return stack;
|
||||
return _cogl_matrix_stack_object_new (stack);
|
||||
}
|
||||
|
||||
void
|
||||
_cogl_matrix_stack_destroy (CoglMatrixStack *stack)
|
||||
static void
|
||||
_cogl_matrix_stack_free (CoglMatrixStack *stack)
|
||||
{
|
||||
g_array_free (stack->stack, TRUE);
|
||||
g_slice_free (CoglMatrixStack, stack);
|
||||
|
Reference in New Issue
Block a user