[1/4] gid32: Add matrix helper functions.

Nikolay Sivov bunglehead at gmail.com
Tue Jan 7 07:54:56 CST 2014


On 1/7/2014 17:31, Ralf Habacker wrote:
> Contains basic functions required by further patches
> ---
>   dlls/gdi32/dibdrv/graphics.c | 49
> ++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 49 insertions(+)
>
That should be merged with a first patch that uses it.
> +/*
> + check matrix for condition
> +*/
> +BOOL hasRotatedAndSameScaledMatrixOnly(XFORM *xform)
> +{
> +    return xform->eM11 == xform->eM22 &&
> +          -xform->eM21 == xform->eM12;
> +}
> +
Comment is telling nothing, 'xform' should be const probably.

> +    double determinant = 0;
> +
> +    /* xform = xfrom-transposed * xform */
> +    xform->eM11 = sqrt( xform->eM11 * xform->eM11 + xform->eM21 * xform->eM21 );
> +    xform->eM22 = sqrt( xform->eM12 * xform->eM12 + xform->eM22 * xform->eM22 );
> +    xform->eM12 = 0;
> +    xform->eM21 = 0;
> +    xform->eDx = 0;
> +    xform->eDy = 0;
> +
> +    if ( rotation_and_translation == NULL )
> +        return TRUE;
> +
> +    determinant = xform->eM11 * xform->eM22;
> +
> +    inverse_matrix_scale.eM11 = xform->eM22 / determinant;
Is it possible to get 0 determinant here? Function never returns FALSE, 
so return value is useless.

Also please follow function and variable naming conventions used in this 
file.



More information about the wine-devel mailing list