<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 24, 2016 at 3:39 PM, Stefan Dösinger <span dir="ltr"><<a href="mailto:stefandoesinger@gmail.com" target="_blank">stefandoesinger@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
Hi,<br>
<br>
I think it'd be a good idea to add some lines testing InitFromImage on<br>
a texture that was created with CreateTexture and trying to call<br>
InitFromImage twice (with the first call succeeding).<br>
<span class=""><br>
Am 2016-04-24 um 06:46 schrieb Aaryaman Vasishta:<br>
> +    /* InitFromImage tests */<br>
> +    d3drm_img = NULL;<br>
> +    hr = IDirect3DRM2_CreateObject(d3drm2, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture2, (void **)&texture2);<br>
> +    ok(SUCCEEDED(hr), "Cannot get IDirect3DRMTexture2 interface (hr = %x).\n", hr);<br>
> +    ref2 = get_refcount((IUnknown *)texture2);<br>
</span>Did you forget IDirect3DRM::CreateObject(Texture1), or is there a<br>
reason why it is omitted?<br></blockquote><div>InitFromImage only exists for versions 2 and 3, so the tests for that were added accordingly, there wasn't any need for a CreateObject(Texture1) in this case. <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> +    hr = IDirect3DRMTexture2_InitFromImage(texture2, NULL);<br>
> +    todo_wine ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %x.\n", hr);<br>
> +    ref3 = get_refcount((IUnknown *)texture2);<br>
> +    ok(ref3 == ref2, "expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3);<br>
</span>You're not testing the reference count of d3drm1/2/3. My guess is that<br>
you plan to add this later since the InitFrom() increments it, and not<br>
the create. Is my understanding of your plans correct?<br></blockquote><div>No you're right, I should've added refcount tests for d3drm1/2/3 as well. Even though InitFrom* is not implemented at this point, it's still a good idea to keep them as todo's and removing them when I send the implementation for InitFromImage. What do you think?<br><br>InitFrom* does increment the refcount, whereas CreateObject doesn't seem to. I think it was meant to be like that as every object creatable by CreateObject has a corresponding init method, which I guess increments the refcount when called.<br>I will resend this patch with the changes.<br><br></div><div>Cheers,<br></div>Aaryaman<br></div></div></div>