On 09/14/2018 06:15 PM, Henri Verbeet wrote:
On 14 September 2018 at 10:20, Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d2d1/bitmap.c | 69 ++++++++++++++++++++++++---------------- dlls/d2d1/d2d1_private.h | 12 +++++-- dlls/d2d1/device.c | 9 ++---- dlls/d2d1/tests/d2d1.c | 63 ++++++++++++++++++++---------------- 4 files changed, 90 insertions(+), 63 deletions(-)
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.