[Cogl] [PATCH 1/2] Add cogl_color_init_from_color()

Neil Roberts neil at linux.intel.com
Thu May 31 03:59:13 PDT 2012


I think we need to agree some policy for these caller-allocated types.
It's already guaranteed in the API that CoglColor has no other resources
because there is no destroy function. In that case it should be
completely fine to just copy the color using the assignment operator.
The same applies for CoglVector3, CoglEuler, CoglQuaternion, CoglMatrix
etc. We should either agree that assignment is ok and mention that in
the documentation for all of these types or agree that the init_from
functions are useful for consistency and add it to all of them at the
same time. I'd vote for the former because the overhead of a function is
relatively high when you are copying such a small amount of bytes and
it's not really any more convenient. If we do that we should remove
cogl_quaternion_init_from_quaternion().

Regards,
- Neil


More information about the Cogl mailing list