mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 03:08:19 +00:00
windowscodecs: Fix return values for scaler's CopyPalette().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a05ce6ac6f
commit
8d75d949a6
|
@ -163,7 +163,7 @@ static HRESULT WINAPI BitmapScaler_CopyPalette(IWICBitmapScaler *iface,
|
|||
return E_INVALIDARG;
|
||||
|
||||
if (!This->source)
|
||||
return WINCODEC_ERR_WRONGSTATE;
|
||||
return WINCODEC_ERR_PALETTEUNAVAILABLE;
|
||||
|
||||
return IWICBitmapSource_CopyPalette(This->source, pIPalette);
|
||||
}
|
||||
|
|
|
@ -1084,6 +1084,7 @@ static void test_bitmap_scaler(void)
|
|||
{
|
||||
WICPixelFormatGUID pixel_format;
|
||||
IWICBitmapScaler *scaler;
|
||||
IWICPalette *palette;
|
||||
double res_x, res_y;
|
||||
IWICBitmap *bitmap;
|
||||
UINT width, height;
|
||||
|
@ -1148,6 +1149,15 @@ static void test_bitmap_scaler(void)
|
|||
ok(width == 123, "Unexpected width %u.\n", width);
|
||||
ok(height == 321, "Unexpected height %u.\n", height);
|
||||
|
||||
hr = IWICBitmapScaler_CopyPalette(scaler, NULL);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IWICImagingFactory_CreatePalette(factory, &palette);
|
||||
ok(hr == S_OK, "Failed to create a palette, hr %#x.\n", hr);
|
||||
hr = IWICBitmapScaler_CopyPalette(scaler, palette);
|
||||
ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
|
||||
IWICPalette_Release(palette);
|
||||
|
||||
hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 4, 0,
|
||||
WICBitmapInterpolationModeNearestNeighbor);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
|
@ -1224,6 +1234,12 @@ static void test_bitmap_scaler(void)
|
|||
ok(hr == S_OK, "Failed to get scaler resolution, hr %#x.\n", hr);
|
||||
ok(res_x == 0.0 && res_y == 0.0, "Unexpected resolution %f x %f.\n", res_x, res_y);
|
||||
|
||||
hr = IWICImagingFactory_CreatePalette(factory, &palette);
|
||||
ok(hr == S_OK, "Failed to create a palette, hr %#x.\n", hr);
|
||||
hr = IWICBitmapScaler_CopyPalette(scaler, palette);
|
||||
ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Unexpected hr %#x.\n", hr);
|
||||
IWICPalette_Release(palette);
|
||||
|
||||
IWICBitmapScaler_Release(scaler);
|
||||
|
||||
IWICBitmap_Release(bitmap);
|
||||
|
|
Loading…
Reference in a new issue