[PATCH] d3drm/tests: Add tests for IDirect3DRM*::LoadTexture (try 7).

Stefan Dösinger stefandoesinger at gmail.com
Sat Jan 2 15:24:13 CST 2016


> Am 02.01.2016 um 07:24 schrieb Aaryaman Vasishta <jem456.vasishta at gmail.com>:
> 
> +    size = w * h * (bpp / 8);
> +    /* Saving pixels by directly accessing bitmap buffer is faster than using SetPixel */
> +    for (i = 0, j = 0; i < size;)
> +    {
> +        if (palettized)
> +        {
> +            buffer[i++] = j;
> +            buffer[i++] = j;
> +            buffer[i++] = j++;
> +            j %= 256;
> +        }
> +        else
> +        {
> +            buffer[i] = i % 256;
> +            i++;
> +            buffer[i] = j % 256;
> +            i++;
> +            j = (j % w) + 1;
> +        }
> +    }
This is different from earlier patch versions afair. Whats the reason for the change?

I guess this gets the job done, but it feels a bit odd to initialize 2/3rds of a rgb pixel or 3 palletized pixels per iteration. It can also cause trouble with writing past the end if size isn't a multiple of 2 or 3 respectively. (with 24 bit rgb even a multiple of 2 isn't guaranteed)

Also I think you can get rid of the DIB section and just use a HeapAlloced blob.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160102/d3f05ea6/attachment.sig>


More information about the wine-devel mailing list