On 5/13/22 15:36, Dmitry Timoshkov wrote:
+HRESULT d2d_image_brush_create(ID2D1Factory *factory, ID2D1Image *image,
const D2D1_IMAGE_BRUSH_PROPERTIES *image_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
struct d2d_brush **brush)
+{
- if (!(*brush = heap_alloc_zero(sizeof(**brush))))
return E_OUTOFMEMORY;
- d2d_brush_init(*brush, factory, D2D_BRUSH_TYPE_IMAGE,
brush_desc, (ID2D1BrushVtbl *)&d2d_image_brush_vtbl);
- if (((*brush)->u.image.image = image))
ID2D1Image_AddRef((*brush)->u.image.image);
- if (image_brush_desc)
- {
FIXME("sourceRectangle %s is ignored.\n", debug_d2d_rect_f(&image_brush_desc->sourceRectangle));
(*brush)->u.image.extend_mode_x = image_brush_desc->extendModeX;
(*brush)->u.image.extend_mode_y = image_brush_desc->extendModeY;
(*brush)->u.image.interpolation_mode = image_brush_desc->interpolationMode;
- }
- else
- {
(*brush)->u.image.extend_mode_x = D2D1_EXTEND_MODE_CLAMP;
(*brush)->u.image.extend_mode_y = D2D1_EXTEND_MODE_CLAMP;
(*brush)->u.image.interpolation_mode = D2D1_INTERPOLATION_MODE_LINEAR;
- }
- TRACE("Created brush %p.\n", *brush);
- return S_OK;
+}
Basic tests, please. I did a quick check, and image_brush_desc is not optional, image pointer is optional.