[PATCH 1/2] d2d1: Implement GetSurface() for bitmaps.

Nikolay Sivov nsivov at codeweavers.com
Fri Sep 14 11:05:22 CDT 2018


On 09/14/2018 07:02 PM, Henri Verbeet wrote:

> On 14 September 2018 at 20:13, Nikolay Sivov <nsivov at codeweavers.com> wrote:
>> On 09/14/2018 06:15 PM, Henri Verbeet wrote:
>>> This seems a little more complicated than it really needs to be. In
>>> d2d_bitmap_GetSurface(), can't you just do something like the
>>> following?
>>>
>>>       ID3D10ShaderResourceView_GetResource(bitmap->view, &resource);
>>>       ID3D10Resource_QueryInterface(resource, &IID_IDXGISurface, &surface);
>> Yes, that would be an alternative to separate surface pointer in bitmap
>> structure. The problem is that this method is not supposed to always work.
>> According to tests it only works for bitmaps created from DXGI target/device
>> context. I can use some flag instead to indicate that if you think it's
>> better.
> Sure, you can just flag it on bitmap creation. It's perhaps
> unfortunate that D2D1_BITMAP_OPTIONS doesn't have a flag for that.

Yes, I don't think you can tell from options if it will work.

>
> I'm not necessarily opposed to storing the surface in struct
> d2d_bitmap though, but in that case I think you should retrieve it
> from the SRV in d2d_bitmap_init() as well, instead of doing that in
> its callers.

Right, I'll keep this field then, thanks for the suggestion.



More information about the wine-devel mailing list