[Cogl] [PATCH] indices: Fix cogl_get_rectangle_indices clipping bug

Neil Roberts neil at linux.intel.com
Fri May 17 06:21:38 PDT 2013


Thanks for the patch. I just have a couple of comments:

Plamena Manolova <plamena.n.manolova at intel.com> writes:

> +  else if (n_indices < 4294967295 / 4 * 6 &&

That integer constant is going to end up bigger than 32 bits. It looks
like when you compile on a 32 bit architecture it ends up wrapping
around and actually compares against 0x7ffffffa. I think we can safely
assume that sizeof(int) is never going to be bigger than 4 so it's
actually impossible to pass in a value that won't fit in unsigned int
indices. In that case the comparison isn't really necessary. It also
gives a warning.

> +           cogl_has_feature (COGL_FEATURE_ID_UNSIGNED_INT_INDICES))

cogl_has_feature() takes two arguments so this doesn't compile.

> +          if (ctx->rectangle_int_indices_len == 0)
> +            ctx->rectangle_int_indices_len = 1024;

This might as well start at 65536 because there's always going to be
at least that many indices.

Regards,
- Neil
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



More information about the Cogl mailing list