From: Santino Mazza <smazza@codeweavers.com> --- dlls/d2d1/d2d1_private.h | 6 +++ dlls/d2d1/device.c | 10 +++- dlls/d2d1/sprite_batch.c | 105 +++++++++++++++++++++++++++++++++++---- dlls/d2d1/tests/d2d1.c | 98 ++++++++++++++++++------------------ 4 files changed, 157 insertions(+), 62 deletions(-) diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index a54077f8f98..54ae00c6ac6 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -463,10 +463,16 @@ struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface); struct d2d_sprite_batch { ID2D1SpriteBatch ID2D1SpriteBatch_iface; + ID2D1Factory *factory; LONG refcount; + + UINT32 sprite_count; + UINT32 sprites_allocated; + D2D1_RECT_F *destination_rectangles; }; HRESULT d2d_create_sprite_batch(struct d2d_device_context *ctx, ID2D1SpriteBatch **iface); +struct d2d_sprite_batch *unsafe_impl_from_ID2D1SpriteBatch(ID2D1SpriteBatch *iface); struct d2d_state_block { diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 0082288b4e9..c0322870692 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -3050,9 +3050,15 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawSpriteBatch(ID2D1DeviceCont ID2D1SpriteBatch *sprite_batch, UINT32 start_index, UINT32 sprite_count, ID2D1Bitmap *bitmap, D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode, D2D1_SPRITE_OPTIONS sprite_options) { - FIXME("iface %p, sprite_batch %p, start_index %u, sprite_count %u, bitmap %p, interpolation_mode %u," - "sprite_options %u stub!\n", iface, sprite_batch, start_index, sprite_count, bitmap, + struct d2d_sprite_batch *sprite_batch_impl = unsafe_impl_from_ID2D1SpriteBatch(sprite_batch); + TRACE("iface %p, sprite_batch %p, start_index %u, sprite_count %u, bitmap %p, interpolation_mode %u," + "sprite_options %u\n", iface, sprite_batch, start_index, sprite_count, bitmap, interpolation_mode, sprite_options); + + for (int i = start_index; i < start_index + sprite_count; ++i) { + ID2D1DeviceContext6_DrawBitmap(iface, bitmap, &sprite_batch_impl->destination_rectangles[i], 1.0f, + (D2D1_INTERPOLATION_MODE)interpolation_mode, 0, 0); + } } static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateSvgGlyphStyle(ID2D1DeviceContext6 *iface, diff --git a/dlls/d2d1/sprite_batch.c b/dlls/d2d1/sprite_batch.c index e5d8c0c88a6..667501ffb84 100644 --- a/dlls/d2d1/sprite_batch.c +++ b/dlls/d2d1/sprite_batch.c @@ -31,6 +31,7 @@ static HRESULT STDMETHODCALLTYPE d2d_sprite_batch_QueryInterface(ID2D1SpriteBatc TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); if (IsEqualGUID(iid, &IID_ID2D1SpriteBatch) + || IsEqualGUID(iid, &IID_ID2D1Resource) || IsEqualGUID(iid, &IID_IUnknown)) { ID2D1SpriteBatch_AddRef(iface); @@ -62,6 +63,8 @@ static ULONG STDMETHODCALLTYPE d2d_sprite_batch_Release(ID2D1SpriteBatch *iface) TRACE("%p decreasing refcount to %lu.\n", iface, refcount); if (!refcount) { + ID2D1Factory_Release(batch->factory); + free(batch->destination_rectangles); free(batch); } @@ -70,7 +73,12 @@ static ULONG STDMETHODCALLTYPE d2d_sprite_batch_Release(ID2D1SpriteBatch *iface) static void STDMETHODCALLTYPE d2d_sprite_batch_GetFactory(ID2D1SpriteBatch *iface, ID2D1Factory **factory) { - FIXME("(%p): stub\n", iface); + struct d2d_sprite_batch *batch = impl_from_ID2D1SpriteBatch(iface); + + TRACE("iface %p, factory %p.\n", iface, factory); + + *factory = batch->factory; + ID2D1Factory_AddRef(*factory); } static HRESULT STDMETHODCALLTYPE d2d_sprite_batch_AddSprites(ID2D1SpriteBatch *iface, UINT32 sprite_count, @@ -78,9 +86,34 @@ static HRESULT STDMETHODCALLTYPE d2d_sprite_batch_AddSprites(ID2D1SpriteBatch *i const D2D1_MATRIX_3X2_F *transforms, UINT32 destination_rectangles_stride, UINT32 source_rectangles_stride, UINT32 colors_stride, UINT32 transforms_stride) { - FIXME("(%p): stub\n", iface); + struct d2d_sprite_batch *batch = impl_from_ID2D1SpriteBatch(iface); + + TRACE("(%p)\n", iface); + + if (!destination_rectangles) + return S_OK; + + if (source_rectangles) + FIXME("Source rectangles not implemented.\n"); + + if (colors) + FIXME("Color mask not implemented\n"); + + if (transforms) + FIXME("Transform matrixes not implemented.\n"); + + if (batch->sprites_allocated <= batch->sprite_count + sprite_count) + { + batch->sprites_allocated = max(batch->sprites_allocated + sprite_count, batch->sprites_allocated * 2); + batch->destination_rectangles = realloc(batch->destination_rectangles, sizeof(D2D1_RECT_F) * batch->sprites_allocated); + } + + for (int i = 0; i < sprite_count; ++i) + batch->destination_rectangles[i + batch->sprite_count] = *(D2D1_RECT_F *)(((UCHAR*)destination_rectangles) + i * destination_rectangles_stride); - return E_NOTIMPL; + batch->sprite_count += sprite_count; + + return S_OK; } static HRESULT STDMETHODCALLTYPE d2d_sprite_batch_SetSprites(ID2D1SpriteBatch *iface, UINT32 start_index, UINT32 sprite_count, @@ -88,30 +121,66 @@ static HRESULT STDMETHODCALLTYPE d2d_sprite_batch_SetSprites(ID2D1SpriteBatch *i const D2D1_MATRIX_3X2_F *transforms, UINT32 destination_rectangles_stride, UINT32 source_rectangles_stride, UINT32 colors_stride, UINT32 transforms_stride) { - FIXME("(%p): stub\n", iface); + struct d2d_sprite_batch *batch = impl_from_ID2D1SpriteBatch(iface); + + TRACE("(%p)\n", iface); + + if (!sprite_count) + return S_OK; + + if (start_index >= batch->sprite_count || sprite_count > batch->sprite_count - start_index) + return E_INVALIDARG; + + if (colors) + FIXME("Color mask not implemented\n"); - return E_NOTIMPL; + if (source_rectangles) + FIXME("Source rectangles not implemented\n"); + + if (transforms) + FIXME("Transform matrixes not implemented\n"); + + for (int i = start_index; i < start_index + sprite_count; ++i) + { + if (destination_rectangles) + batch->destination_rectangles[i] = *(D2D1_RECT_F *)(((UCHAR*)destination_rectangles) + i * destination_rectangles_stride); + } + + return S_OK; } static HRESULT STDMETHODCALLTYPE d2d_sprite_batch_GetSprites(ID2D1SpriteBatch *iface, UINT32 start_index, UINT32 sprite_count, D2D1_RECT_F *destination_rectangles, D2D1_RECT_U *source_rectangles, D2D1_COLOR_F *colors, D2D1_MATRIX_3X2_F *transforms) { - FIXME("(%p): stub\n", iface); + struct d2d_sprite_batch *batch = impl_from_ID2D1SpriteBatch(iface); + TRACE("(%p)\n", iface); + + if (!sprite_count) + return S_OK; + + if (start_index >= batch->sprite_count || sprite_count > batch->sprite_count - start_index) + return E_INVALIDARG; + + if (destination_rectangles) + memcpy(destination_rectangles, &batch->destination_rectangles[start_index], sizeof(D2D1_RECT_F) * sprite_count); - return E_NOTIMPL; + return S_OK; } static UINT32 STDMETHODCALLTYPE d2d_sprite_batch_GetSpritesCount(ID2D1SpriteBatch *iface) { - FIXME("(%p): stub\n", iface); - - return 0; + struct d2d_sprite_batch *batch = impl_from_ID2D1SpriteBatch(iface); + TRACE("(%p)\n", iface); + return batch->sprite_count; } static void STDMETHODCALLTYPE d2d_sprite_batch_Clear(ID2D1SpriteBatch *iface) { - FIXME("(%p): stub\n", iface); + struct d2d_sprite_batch *batch = impl_from_ID2D1SpriteBatch(iface); + TRACE("(%p)\n", iface); + + batch->sprite_count = 0; } static const struct ID2D1SpriteBatchVtbl d2d_sprite_batch_vtbl = { @@ -134,8 +203,22 @@ HRESULT d2d_create_sprite_batch(struct d2d_device_context *ctx, ID2D1SpriteBatch sprite_batch->ID2D1SpriteBatch_iface.lpVtbl = &d2d_sprite_batch_vtbl; + sprite_batch->sprites_allocated = 1; + sprite_batch->destination_rectangles = calloc(sprite_batch->sprites_allocated, sizeof(D2D1_RECT_F)); + + ID2D1Factory_AddRef(ctx->factory); + sprite_batch->factory = ctx->factory; + ID2D1SpriteBatch_AddRef(&sprite_batch->ID2D1SpriteBatch_iface); *iface = &sprite_batch->ID2D1SpriteBatch_iface; return S_OK; } + +struct d2d_sprite_batch *unsafe_impl_from_ID2D1SpriteBatch(ID2D1SpriteBatch *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == (ID2D1SpriteBatchVtbl *)&d2d_sprite_batch_vtbl); + return CONTAINING_RECORD(iface, struct d2d_sprite_batch, ID2D1SpriteBatch_iface); +} diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 7404c3aa2a4..11d8c6966ca 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -18058,91 +18058,91 @@ static void test_sprite_batches(BOOL d3d11) { hr = ID2D1DeviceContext3_CreateSpriteBatch(device, &sprite_batch); ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); - todo_wine check_interface(sprite_batch, &IID_ID2D1Resource, TRUE); + check_interface(sprite_batch, &IID_ID2D1Resource, TRUE); hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, NULL, NULL, NULL, NULL, 0, 0, 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); sprite_count = ID2D1SpriteBatch_GetSpriteCount(sprite_batch); ok(sprite_count == 0, "Expected sprite count of 0 got %d\n", sprite_count); hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, NULL, test_source_rect, NULL, NULL, 0, 0, 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); sprite_count = ID2D1SpriteBatch_GetSpriteCount(sprite_batch); ok(sprite_count == 0, "Expected sprite count of 0 got %d\n", sprite_count); hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, test_destination_rect, NULL, NULL, NULL, 0, 0, 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); sprite_count = ID2D1SpriteBatch_GetSpriteCount(sprite_batch); - todo_wine ok(sprite_count == 2, "Expected sprite count of 2 got %d\n", sprite_count); + ok(sprite_count == 2, "Expected sprite count of 2 got %d\n", sprite_count); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 2, destination_rects, source_rects, colors, transforms); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); - todo_wine ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), + ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[0].left, destination_rects[0].top, destination_rects[0].right, destination_rects[0].bottom); - todo_wine ok(compare_rect_f(&destination_rects[1], 0, 0, 4, 4, 0), + ok(compare_rect_f(&destination_rects[1], 0, 0, 4, 4, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[1].left, destination_rects[1].top, destination_rects[1].right, destination_rects[1].bottom); hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, test_destination_rect, NULL, NULL, NULL, sizeof(*test_destination_rect), 0, 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); sprite_count = ID2D1SpriteBatch_GetSpriteCount(sprite_batch); - todo_wine ok(sprite_count == 4, "Expected sprite count of 4 got %d\n", sprite_count); + ok(sprite_count == 4, "Expected sprite count of 4 got %d\n", sprite_count); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 4, destination_rects, source_rects, colors, transforms); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); - todo_wine ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), + ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[0].left, destination_rects[0].top, destination_rects[0].right, destination_rects[0].bottom); - todo_wine ok(compare_rect_f(&destination_rects[1], 0, 0, 4, 4, 0), + ok(compare_rect_f(&destination_rects[1], 0, 0, 4, 4, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[1].left, destination_rects[1].top, destination_rects[1].right, destination_rects[1].bottom); - todo_wine ok(compare_rect_f(&destination_rects[2], 0, 0, 4, 4, 0), + ok(compare_rect_f(&destination_rects[2], 0, 0, 4, 4, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[2].left, destination_rects[2].top, destination_rects[2].right, destination_rects[2].bottom); - todo_wine ok(compare_rect_f(&destination_rects[3], 5, 5, 9, 9, 0), + ok(compare_rect_f(&destination_rects[3], 5, 5, 9, 9, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[3].left, destination_rects[3].top, destination_rects[3].right, destination_rects[3].bottom); hr = ID2D1SpriteBatch_SetSprites(sprite_batch, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_SetSprites(sprite_batch, 0, 8, NULL, NULL, NULL, NULL, 0, 0, 0, 0); - todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_SetSprites(sprite_batch, 5, 1, NULL, NULL, NULL, NULL, 0, 0, 0, 0); - todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_SetSprites(sprite_batch, 0, 1, NULL, NULL, NULL, NULL, 0, 0, 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_SetSprites(sprite_batch, 0, 8, &test_destination_rect[1], NULL, NULL, NULL, 0, 0, 0, 0); - todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_SetSprites(sprite_batch, 0, 1, &test_destination_rect[1], NULL, NULL, NULL, 0, 0, 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 1, destination_rects, NULL, NULL, NULL); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); - todo_wine ok(compare_rect_f(&destination_rects[0], 5, 5, 9, 9, 0), + ok(compare_rect_f(&destination_rects[0], 5, 5, 9, 9, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[0].left, destination_rects[0].top, destination_rects[0].right, destination_rects[0].bottom); @@ -18153,20 +18153,20 @@ static void test_sprite_batches(BOOL d3d11) { hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, test_destination_rect, NULL, NULL, NULL, sizeof(test_destination_rect->top), 0, 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); sprite_count = ID2D1SpriteBatch_GetSpriteCount(sprite_batch); - todo_wine ok(sprite_count == 2, "Expected sprite count of 2 got %d\n", sprite_count); + ok(sprite_count == 2, "Expected sprite count of 2 got %d\n", sprite_count); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 2, destination_rects, source_rects, colors, transforms); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); - todo_wine ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), + ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[0].left, destination_rects[0].top, destination_rects[0].right, destination_rects[0].bottom); - todo_wine ok(compare_rect_f(&destination_rects[1], 0, 4, 4, 5, 0), + ok(compare_rect_f(&destination_rects[1], 0, 4, 4, 5, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[1].left, destination_rects[1].top, destination_rects[1].right, destination_rects[1].bottom); @@ -18177,42 +18177,42 @@ static void test_sprite_batches(BOOL d3d11) { hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, test_destination_rect, NULL, NULL, NULL, sizeof(*test_destination_rect), 0, 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); sprite_count = ID2D1SpriteBatch_GetSpriteCount(sprite_batch); - todo_wine ok(sprite_count == 2, "Expected sprite count of 2 got %d\n", sprite_count); + ok(sprite_count == 2, "Expected sprite count of 2 got %d\n", sprite_count); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 4, destination_rects, source_rects, colors, transforms); - todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 3, 1, destination_rects, source_rects, colors, transforms); - todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 3, 0, destination_rects, source_rects, colors, transforms); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 0, destination_rects, source_rects, colors, transforms); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 2, NULL, NULL, NULL, NULL); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 2, destination_rects, source_rects, colors, transforms); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 2, NULL, source_rects, NULL, NULL); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 2, destination_rects, NULL, NULL, NULL); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); - todo_wine ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), + ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[0].left, destination_rects[0].top, destination_rects[0].right, destination_rects[0].bottom); - todo_wine ok(compare_rect_f(&destination_rects[1], 5, 5, 9, 9, 0), + ok(compare_rect_f(&destination_rects[1], 5, 5, 9, 9, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[1].left, destination_rects[1].top, destination_rects[1].right, destination_rects[1].bottom); @@ -18227,31 +18227,31 @@ static void test_sprite_batches(BOOL d3d11) { hr = ID2D1DeviceContext3_EndDraw(device, 0, 0); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); check = compare_surface(&ctx, "5e8144c13d1a71f0b59d54eba7156218693fa7bd"); - todo_wine ok(check, "Surface does not match.\n"); + ok(check, "Surface does not match.\n"); ID2D1DeviceContext3_BeginDraw(device); ID2D1DeviceContext3_DrawSpriteBatch(device, sprite_batch, 0, 2, bitmap, 0, D2D1_SPRITE_OPTIONS_NONE); hr = ID2D1DeviceContext3_EndDraw(device, 0, 0); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); check = compare_surface(&ctx, "064e9e8b46799904cab52b14d69a235d4f41409b"); - todo_wine ok(check, "Surface does not match.\n"); + ok(check, "Surface does not match.\n"); ID2D1SpriteBatch_Clear(sprite_batch); sprite_count = ID2D1SpriteBatch_GetSpriteCount(sprite_batch); ok(sprite_count == 0, "Expected sprite count of 0 got %d\n", sprite_count); hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, test_destination_rect, test_source_rect, NULL, NULL, sizeof(*test_destination_rect), sizeof(*test_source_rect), 0, 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); hr = ID2D1SpriteBatch_GetSprites(sprite_batch, 0, 2, destination_rects, source_rects, NULL, NULL); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); - todo_wine ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), + ok(compare_rect_f(&destination_rects[0], 0, 0, 4, 4, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[0].left, destination_rects[0].top, destination_rects[0].right, destination_rects[0].bottom); - todo_wine ok(compare_rect_f(&destination_rects[1], 5, 5, 9, 9, 0), + ok(compare_rect_f(&destination_rects[1], 5, 5, 9, 9, 0), "Got unexpected rectangle {%f, %f, %f, %f}.\n", destination_rects[1].left, destination_rects[1].top, destination_rects[1].right, destination_rects[1].bottom); @@ -18281,7 +18281,7 @@ static void test_sprite_batches(BOOL d3d11) { set_matrix_identity(&test_matrixes[1]); scale_matrix(&test_matrixes[1], 4.0f, 4.0f); hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, test_destination_rect, test_source_rect, NULL, test_matrixes, sizeof(*test_destination_rect), sizeof(*test_source_rect), 0, sizeof(D2D1_MATRIX_3X2_F)); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); ID2D1DeviceContext3_BeginDraw(device); ID2D1DeviceContext3_DrawSpriteBatch(device, sprite_batch, 0, 2, bitmap, 0, D2D1_SPRITE_OPTIONS_NONE); @@ -18296,7 +18296,7 @@ static void test_sprite_batches(BOOL d3d11) { ok(sprite_count == 0, "Expected sprite count of 0 got %d\n", sprite_count); hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, test_destination_rect, test_source_rect, test_colors, NULL, sizeof(*test_destination_rect), sizeof(*test_source_rect), sizeof(D2D1_COLOR_F), 0); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); ID2D1DeviceContext3_BeginDraw(device); ID2D1DeviceContext3_DrawSpriteBatch(device, sprite_batch, 0, 2, bitmap, 0, D2D1_SPRITE_OPTIONS_NONE); @@ -18313,7 +18313,7 @@ static void test_sprite_batches(BOOL d3d11) { set_matrix_identity(&test_matrixes[1]); skew_matrix(&test_matrixes[1], 0.5f, 0.5f); hr = ID2D1SpriteBatch_AddSprites(sprite_batch, 2, test_destination_rect, test_source_rect, NULL, test_matrixes, sizeof(*test_destination_rect), sizeof(*test_source_rect), 0, sizeof(D2D1_MATRIX_3X2_F)); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx\n", hr); ID2D1DeviceContext3_BeginDraw(device); ID2D1DeviceContext3_DrawSpriteBatch(device, sprite_batch, 0, 2, bitmap, 0, D2D1_SPRITE_OPTIONS_NONE); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11249