[PATCH] d2d1: Make ID2D1Device::CreateImageBrush() accept only bitmap as a source image.

Nikolay Sivov nsivov at codeweavers.com
Thu May 19 04:51:16 CDT 2022


On 5/19/22 12:16, Dmitry Timoshkov wrote:
> Nikolay Sivov <nsivov at codeweavers.com> wrote:
>
>> On 5/19/22 11:56, Dmitry Timoshkov wrote:
>>> ID2D1Bitmap derives from ID2D1Image, which in turn derives from ID2D1Resource.
>>> That means that ID2D1Device::CreateImageBrush() can't be really passed anything
>>> but a ID2D1Bitmap* represented as a ID2D1Image*.
>>>
>>> I've added QueryInterface+FIXME just in case, probably it could be dropped.
>> Command lists and effects outputs are also ID2D1Image, so it's not
>> always a bitmap.
> Thanks for pointing that out. Currently images that are not bitmaps can't
> work as brushes anyway, Henri already explaned that in response to original
> version of my patch. If anything besides bitmaps is supposed to be supported
> by ID2D1Device::CreateImageBrush() that needs quite a bit of work. For now
> accepting only bitmaps seems a fair limitation, and in fact that makes the app
> that I have here happy.
>
I'm not asking to make command lists and effects work before the bitmap 
image. But this change is backwards, if anything we could implement 
existing bitmap brush as an image brush with a bitmap.

Checking image type on creation is likely insufficient, because you can 
do SetImage() later. Also extend and interpolation modes will be ignored.



More information about the wine-devel mailing list