1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

d2d1/effect: Fix GetImageLocalBounds() prototype.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2024-05-07 23:13:32 +02:00 committed by Alexandre Julliard
parent 3e3e347ed0
commit a1dadf3683
3 changed files with 17 additions and 7 deletions

View File

@ -2292,7 +2292,7 @@ static BOOL STDMETHODCALLTYPE d2d_device_context_IsBufferPrecisionSupported(ID2D
return !!(support & D3D11_FORMAT_SUPPORT_BUFFER);
}
static void STDMETHODCALLTYPE d2d_device_context_GetImageLocalBounds(ID2D1DeviceContext6 *iface,
static HRESULT STDMETHODCALLTYPE d2d_device_context_GetImageLocalBounds(ID2D1DeviceContext6 *iface,
ID2D1Image *image, D2D1_RECT_F *local_bounds)
{
struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface);
@ -2325,10 +2325,14 @@ static void STDMETHODCALLTYPE d2d_device_context_GetImageLocalBounds(ID2D1Device
break;
}
ID2D1Bitmap_Release(bitmap);
return S_OK;
}
else
{
FIXME("Unable to get local bounds of image %p.\n", image);
return E_NOTIMPL;
}
}

View File

@ -12481,7 +12481,8 @@ static void test_effect_2d_affine(BOOL d3d11)
}
ID2D1Effect_GetOutput(effect, &output);
ID2D1DeviceContext_GetImageLocalBounds(context, output, &output_bounds);
hr = ID2D1DeviceContext_GetImageLocalBounds(context, output, &output_bounds);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine
ok(compare_rect(&output_bounds, test->bounds.left, test->bounds.top, test->bounds.right, test->bounds.bottom, 1),
"Got unexpected output bounds {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n",
@ -12603,7 +12604,9 @@ static void test_effect_crop(BOOL d3d11)
ID2D1Effect_GetOutput(effect, &output);
set_rect(&output_bounds, -1.0f, -1.0f, -1.0f, -1.0f);
ID2D1DeviceContext_GetImageLocalBounds(context, output, &output_bounds);
hr = ID2D1DeviceContext_GetImageLocalBounds(context, output, &output_bounds);
todo_wine
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine
ok(compare_rect(&output_bounds, test->bounds.left, test->bounds.top, test->bounds.right, test->bounds.bottom, 0),
"Got unexpected output bounds {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n",
@ -13650,7 +13653,8 @@ static void test_image_bounds(BOOL d3d11)
set_rect(&bounds, 0.0f, 0.0f, 0.0f, 0.0f);
size = ID2D1Bitmap_GetSize(bitmap);
ID2D1DeviceContext_GetImageLocalBounds(context, (ID2D1Image *)bitmap, &bounds);
hr = ID2D1DeviceContext_GetImageLocalBounds(context, (ID2D1Image *)bitmap, &bounds);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(compare_rect(&bounds, 0.0f, 0.0f, size.width, size.height, 0),
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n",
bounds.left, bounds.top, bounds.right, bounds.bottom, 0.0f, 0.0f, size.width, size.height);
@ -13658,7 +13662,8 @@ static void test_image_bounds(BOOL d3d11)
/* Test bitmap local bounds after changing context dpi */
ID2D1DeviceContext_GetDpi(context, &dpi_x, &dpi_y);
ID2D1DeviceContext_SetDpi(context, dpi_x * 2.0f, dpi_y * 2.0f);
ID2D1DeviceContext_GetImageLocalBounds(context, (ID2D1Image *)bitmap, &bounds);
hr = ID2D1DeviceContext_GetImageLocalBounds(context, (ID2D1Image *)bitmap, &bounds);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(compare_rect(&bounds, 0.0f, 0.0f, size.width, size.height, 0),
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n",
bounds.left, bounds.top, bounds.right, bounds.bottom, 0.0f, 0.0f, size.width, size.height);
@ -13668,7 +13673,8 @@ static void test_image_bounds(BOOL d3d11)
unit_mode = ID2D1DeviceContext_GetUnitMode(context);
ok(unit_mode == D2D1_UNIT_MODE_DIPS, "Got unexpected unit mode %#x.\n", unit_mode);
ID2D1DeviceContext_SetUnitMode(context, D2D1_UNIT_MODE_PIXELS);
ID2D1DeviceContext_GetImageLocalBounds(context, (ID2D1Image *)bitmap, &bounds);
hr = ID2D1DeviceContext_GetImageLocalBounds(context, (ID2D1Image *)bitmap, &bounds);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(compare_rect(&bounds, 0.0f, 0.0f, test->pixel_size.width, test->pixel_size.height, 0),
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n",
bounds.left, bounds.top, bounds.right, bounds.bottom, 0.0f, 0.0f,

View File

@ -798,7 +798,7 @@ interface ID2D1DeviceContext : ID2D1RenderTarget
BOOL IsBufferPrecisionSupported(
[in] D2D1_BUFFER_PRECISION buffer_precision
);
void GetImageLocalBounds(
HRESULT GetImageLocalBounds(
[in] ID2D1Image *image,
[out] D2D1_RECT_F *local_bounds
);