[PATCH] d2d1: Implement ID2D1DeviceContext::CreateImageBrush().
Dmitry Timoshkov
dmitry at baikal.ru
Fri May 6 04:47:23 CDT 2022
Nikolay Sivov <nsivov at codeweavers.com> wrote:
> On 5/6/22 12:32, Dmitry Timoshkov wrote:
> > +
> > + hr = ID2D1Image_QueryInterface(image, &IID_ID2D1Bitmap, (void **)&bitmap);
> > + if (FAILED(hr))
> > + {
> > + FIXME("ID2D1Image doesn't support ID2D1Bitmap interface.\n");
> > + return hr;
> > + }
> > +
> > + bitmap_brush_desc.extendModeX = image_brush_desc->extendModeX;
> > + bitmap_brush_desc.extendModeY = image_brush_desc->extendModeY;
> > + bitmap_brush_desc.interpolationMode = image_brush_desc->interpolationMode;
> > +
> > + if (SUCCEEDED(hr = d2d_bitmap_brush_create(context->factory, bitmap, &bitmap_brush_desc,
> > + brush_desc, &object)))
> > + *brush = (ID2D1ImageBrush *)&object->ID2D1Brush_iface;
> > +
> > + ID2D1Bitmap_Release(bitmap);
> > +
> > + return hr;
> > }
> >
> > static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_CreateBitmapBrush(ID2D1DeviceContext *iface,
> I don't think this can work, ID2D1ImageBrush is not compatible with what
> d2d_bitmap_brush_create() returns.
Ah, I see, thanks for spotting that. Apparently the app that I have here
doesn't call anything from ID2D1ImageBrush that is not compatible with what
ID2D1BitmapBrush provides, so it worked here.
--
Dmitry.
More information about the wine-devel
mailing list