[PATCH 2/6] d3drm: Implement IDirect3DRMTexture{2-3}_InitFromImage. (v3)

Aaryaman Vasishta jem456.vasishta at gmail.com
Sun May 8 11:31:15 CDT 2016


On Sun, May 8, 2016 at 9:39 PM, Stefan Dösinger <stefandoesinger at gmx.at>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
>
>
> Am 2016-05-08 um 11:31 schrieb Aaryaman Vasishta:
> > +    hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg);
> > +    ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT,
> got %x.\n", hr);
> > +    /* Release leaked reference to d3drm1 */
> > +    IDirect3DRM_Release(d3drm1);
> I think it's a good idea to explicitly test the increased refcount
> after this failing call.
>
The refcount tests which happen following the leak do (indirectly) test the
increased refcount. If I hadn't released d3drm1 here, the following
refcount tests would fail.

>
> > +    if (!image
> > +            || !image->rgb
> > +            || !image->red_mask
> > +            || !image->green_mask
> > +            || !image->blue_mask
> > +            || !image->buffer1)
> > +    {
> > +        return FALSE;
> > +    }
> I guess that there's some way to pass palletized images, e.g. by
> setting rgb = 0, palette_size != 0 and palette != NULL. This shouldn't
> be part of this patch though and I am fine with this code as it is.
>
Agreed, that also needs to be tested. I'll add that test in this patch and
rework this function.

Cheers,
Aaryaman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160508/66919ce1/attachment.html>


More information about the wine-devel mailing list