[Cogl] [PATCH] Re-design the matrix stack using a graph of ops

Neil Roberts neil at linux.intel.com
Fri Apr 20 07:28:59 PDT 2012


This looks really good. I just had one small comment:

> +  if (cache->flipped != flip)
> +    {
> +      cache->flipped = flip;
> +      updated = TRUE;
> +    }
> +
> +  is_identity = (entry->op == COGL_MATRIX_OP_LOAD_IDENTITY);
> +  if (cache->flushed_identity != is_identity)
> +    {
> +      cache->flushed_identity = is_identity;
> +      updated = TRUE;
> +    }
> +
> +  if (cache->entry != entry)
> +    {
> +      _cogl_matrix_entry_ref (entry);
> +      if (cache->entry)
> +        _cogl_matrix_entry_unref (cache->entry);
> +      cache->entry = entry;
> +      updated = TRUE;
> +    }

In this last if-statement, maybe it should only set updated to TRUE if
is_identity == FALSE. Otherwise if you happen to end up with two
different entries that are both the identity then it will redundantly
reflush the identity matrix.

Reviewed-by: Neil Roberts <neil at linux.intel.com>

Regards,
- Neil


More information about the Cogl mailing list