mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against 6b76648a8b773838ecde00719ca54a433edf5ce6
This commit is contained in:
parent
1edb7d5bc5
commit
3dab9e5e6b
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "152cda38df79cf04aae589f1d721de3cac1cd49e"
|
||||
echo "6b76648a8b773838ecde00719ca54a433edf5ce6"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -2568,7 +2568,7 @@ fi
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/bcrypt/bcrypt.spec, dlls/bcrypt/bcrypt_internal.h, dlls/bcrypt/bcrypt_main.c, dlls/bcrypt/gnutls.c,
|
||||
# | dlls/bcrypt/tests/bcrypt.c, dlls/ncrypt/ncrypt.spec, include/bcrypt.h
|
||||
# | dlls/bcrypt/macos.c, dlls/bcrypt/tests/bcrypt.c, dlls/ncrypt/ncrypt.spec, include/bcrypt.h
|
||||
# |
|
||||
if test "$enable_bcrypt_BCryptGenerateKeyPair" -eq 1; then
|
||||
patch_apply bcrypt-BCryptGenerateKeyPair/0001-bcrypt-Implement-BCryptGenerate-FinalizeKeyPair-for-.patch
|
||||
@ -6862,38 +6862,27 @@ fi
|
||||
# Patchset windowscodecs-GIF_Encoder
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/gdiplus/tests/image.c, dlls/windowscodecs/clsfactory.c, dlls/windowscodecs/converter.c,
|
||||
# | dlls/windowscodecs/gifformat.c, dlls/windowscodecs/info.c, dlls/windowscodecs/regsvr.c,
|
||||
# | dlls/windowscodecs/tests/converter.c, dlls/windowscodecs/wincodecs_private.h,
|
||||
# | * dlls/gdiplus/tests/image.c, dlls/windowscodecs/clsfactory.c, dlls/windowscodecs/gifformat.c,
|
||||
# | dlls/windowscodecs/regsvr.c, dlls/windowscodecs/tests/converter.c, dlls/windowscodecs/wincodecs_private.h,
|
||||
# | dlls/windowscodecs/windowscodecs_wincodec.idl
|
||||
# |
|
||||
if test "$enable_windowscodecs_GIF_Encoder" -eq 1; then
|
||||
patch_apply windowscodecs-GIF_Encoder/0007-windowscodecs-tests-Add-IWICBitmapEncoderInfo-test.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0008-windowscodecs-Add-initial-implementation-of-the-GIF-.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0016-windowscodecs-WICConvertBitmapSource-should-ask-IWIC.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0020-windowscodecs-Add-registration-of-the-GIF-encoder.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0021-windowscodecs-Fix-IWICBitmapDecoder-CopyPalette-for-.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0022-windowscodecs-Better-follow-the-GIF-spec-and-don-t-s.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0023-windowscodecs-Fix-behaviour-of-format-converter-for-.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0024-windowscodecs-tests-Add-a-bunch-of-new-tests-for-ind.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0025-windowscodecs-tests-Add-some-tests-for-converting-24.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0026-windowscodecs-tests-Add-the-tests-for-GIF-encoder-an.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0027-windowscodecs-tests-Add-a-missing-check-for-IWICBitm.patch
|
||||
patch_apply windowscodecs-GIF_Encoder/0028-windowscodecs-Correctly-indicate-that-the-global-inf.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Alistair Leslie-Hughes", "windowscodecs/tests: Add IWICBitmapEncoderInfo test.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add initial implementation of the GIF encoder.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Initialize empty property bag in GIF encoder'\''s CreateNewFrame implementation.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: WICConvertBitmapSource should ask IWICFormatConverter::Initialize to use an optimized palette.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add registration of the GIF encoder.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Fix IWICBitmapDecoder::CopyPalette for a not initialized case in the GIF decoder.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Better follow the GIF spec and don'\''t specify the local color table size if there is no local palette.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Fix behaviour of format converter for indexed formats when NULL or empty palette has been provided.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs/tests: Add a bunch of new tests for indexed format conversions.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs/tests: Add some tests for converting 24bppBGR to 8bppIndexed format.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs/tests: Add the tests for GIF encoder and decoder.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs/tests: Add a missing check for IWICBitmapFrameDecode::GetPixelFormat return value.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Correctly indicate that the global info was written even without the global palette.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b396392de5b090fb78a358dec7a8790ecedf2240 Mon Sep 17 00:00:00 2001
|
||||
From dd19f26a49f288dec1d287ebaaeb7a2dd2e7f0cd Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Mon, 15 Oct 2018 12:05:41 +1100
|
||||
Subject: [PATCH] setupapi: Add SetupDiInstallDeviceInterfaces
|
||||
@ -11,12 +11,12 @@ Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
2 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
|
||||
index 771fc70..b15e580 100644
|
||||
index 632d704c9bd..129b7384162 100644
|
||||
--- a/dlls/setupapi/devinst.c
|
||||
+++ b/dlls/setupapi/devinst.c
|
||||
@@ -4020,3 +4020,15 @@ BOOL WINAPI SetupDiGetDevicePropertyW(HDEVINFO info_set, PSP_DEVINFO_DATA info_d
|
||||
SetLastError(ERROR_NOT_FOUND);
|
||||
return FALSE;
|
||||
@@ -4002,3 +4002,15 @@ BOOL WINAPI SetupDiGetDevicePropertyW(HDEVINFO devinfo, PSP_DEVINFO_DATA device_
|
||||
SetLastError(ls);
|
||||
return !ls;
|
||||
}
|
||||
+
|
||||
+/***********************************************************************
|
||||
@ -31,7 +31,7 @@ index 771fc70..b15e580 100644
|
||||
+}
|
||||
+
|
||||
diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec
|
||||
index 99509e1..3f906ed 100644
|
||||
index 3cd5663a01e..984f2218f02 100644
|
||||
--- a/dlls/setupapi/setupapi.spec
|
||||
+++ b/dlls/setupapi/setupapi.spec
|
||||
@@ -367,6 +367,7 @@
|
||||
@ -43,5 +43,5 @@ index 99509e1..3f906ed 100644
|
||||
@ stdcall SetupDiLoadClassIcon(ptr ptr ptr)
|
||||
@ stub SetupDiMoveDuplicateDevice
|
||||
--
|
||||
1.9.1
|
||||
2.20.1
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 8d2a6325a891a2fab8bf7c091cb8fb73468ae1ea Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 20 Oct 2016 16:57:51 +0800
|
||||
Subject: windowscodecs: WICConvertBitmapSource should ask
|
||||
IWICFormatConverter::Initialize to use an optimized palette.
|
||||
|
||||
This matches Windows' behaviour, and makes a simple test application that converts
|
||||
any WIC compatible RGB(A) source image to 8bppIndexed format (GIF for instance) work.
|
||||
---
|
||||
dlls/windowscodecs/info.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c
|
||||
index 1a93491..c1e8a66 100644
|
||||
--- a/dlls/windowscodecs/info.c
|
||||
+++ b/dlls/windowscodecs/info.c
|
||||
@@ -2336,7 +2336,7 @@ HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitma
|
||||
|
||||
if (SUCCEEDED(res) && canconvert)
|
||||
res = IWICFormatConverter_Initialize(converter, pISrc, dstFormat, WICBitmapDitherTypeNone,
|
||||
- NULL, 0.0, WICBitmapPaletteTypeCustom);
|
||||
+ NULL, 0.0, WICBitmapPaletteTypeMedianCut);
|
||||
|
||||
if (FAILED(res) || !canconvert)
|
||||
{
|
||||
--
|
||||
2.9.0
|
||||
|
@ -1,100 +0,0 @@
|
||||
From 9ddafc9d2cd0fc899e513807a34ef4e875851fca Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 27 Oct 2016 14:55:03 +0800
|
||||
Subject: windowscodecs: Fix behaviour of format converter for indexed formats
|
||||
when NULL or empty palette has been provided.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/converter.c | 32 ++++++++++++++++++++++++--------
|
||||
1 file changed, 24 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
|
||||
index c6a2514..4ee980e 100644
|
||||
--- a/dlls/windowscodecs/converter.c
|
||||
+++ b/dlls/windowscodecs/converter.c
|
||||
@@ -1240,7 +1240,6 @@ static HRESULT copypixels_to_8bppIndexed(struct FormatConverter *This, const WIC
|
||||
|
||||
hr = IWICPalette_GetColors(This->palette, 256, colors, &count);
|
||||
if (hr != S_OK) return hr;
|
||||
- if (!count) return WINCODEC_ERR_WRONGSTATE;
|
||||
|
||||
srcstride = 3 * prc->Width;
|
||||
srcdatasize = srcstride * prc->Height;
|
||||
@@ -1409,7 +1408,18 @@ static HRESULT WINAPI FormatConverter_CopyPalette(IWICFormatConverter *iface,
|
||||
TRACE("(%p,%p)\n", iface, palette);
|
||||
|
||||
if (!palette) return E_INVALIDARG;
|
||||
- if (!This->palette) return WINCODEC_ERR_WRONGSTATE;
|
||||
+ if (!This->source) return WINCODEC_ERR_WRONGSTATE;
|
||||
+
|
||||
+ if (!This->palette)
|
||||
+ {
|
||||
+ HRESULT hr;
|
||||
+ UINT bpp;
|
||||
+
|
||||
+ hr = get_pixelformat_bpp(This->dst_format->guid, &bpp);
|
||||
+ if (hr != S_OK) return hr;
|
||||
+ if (bpp <= 8) return WINCODEC_ERR_WRONGSTATE;
|
||||
+ return IWICBitmapSource_CopyPalette(This->source, palette);
|
||||
+ }
|
||||
|
||||
return IWICPalette_InitializeFromPalette(palette, This->palette);
|
||||
}
|
||||
@@ -1440,7 +1450,7 @@ static HRESULT WINAPI FormatConverter_CopyPixels(IWICFormatConverter *iface,
|
||||
pbBuffer, This->src_format->format);
|
||||
}
|
||||
else
|
||||
- return WINCODEC_ERR_NOTINITIALIZED;
|
||||
+ return WINCODEC_ERR_WRONGSTATE;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
|
||||
@@ -1457,6 +1467,10 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
|
||||
|
||||
if (!palette)
|
||||
{
|
||||
+ UINT bpp;
|
||||
+ res = get_pixelformat_bpp(dstFormat, &bpp);
|
||||
+ if (res != S_OK) return res;
|
||||
+
|
||||
res = PaletteImpl_Create(&palette);
|
||||
if (res != S_OK) return res;
|
||||
|
||||
@@ -1465,20 +1479,19 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
|
||||
case WICBitmapPaletteTypeCustom:
|
||||
IWICPalette_Release(palette);
|
||||
palette = NULL;
|
||||
- res = S_OK;
|
||||
+ if (bpp <= 8) return E_INVALIDARG;
|
||||
break;
|
||||
|
||||
case WICBitmapPaletteTypeMedianCut:
|
||||
{
|
||||
- UINT bpp;
|
||||
- res = get_pixelformat_bpp(dstFormat, &bpp);
|
||||
- if (res == S_OK && bpp <= 8)
|
||||
+ if (bpp <= 8)
|
||||
res = IWICPalette_InitializeFromBitmap(palette, source, 1 << bpp, FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
- res = IWICPalette_InitializePredefined(palette, palette_type, FALSE);
|
||||
+ if (bpp <= 8)
|
||||
+ res = IWICPalette_InitializePredefined(palette, palette_type, FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1538,6 +1551,9 @@ end:
|
||||
|
||||
LeaveCriticalSection(&This->lock);
|
||||
|
||||
+ if (res != S_OK && palette)
|
||||
+ IWICPalette_Release(palette);
|
||||
+
|
||||
return res;
|
||||
}
|
||||
|
||||
--
|
||||
2.9.0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,189 +0,0 @@
|
||||
From e27b9d2889f424ecffabc57e449e995fab80274f Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 27 Oct 2016 15:13:24 +0800
|
||||
Subject: [PATCH] windowscodecs/tests: Add some tests for converting
|
||||
24bppBGR to 8bppIndexed format.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/tests/converter.c | 158 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 158 insertions(+)
|
||||
|
||||
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
|
||||
index 4eea13b..089926b 100644
|
||||
--- a/dlls/windowscodecs/tests/converter.c
|
||||
+++ b/dlls/windowscodecs/tests/converter.c
|
||||
@@ -1468,6 +1468,163 @@ static const struct setting png_interlace_settings[] = {
|
||||
{NULL}
|
||||
};
|
||||
|
||||
+static void test_converter_8bppIndexed(void)
|
||||
+{
|
||||
+ HRESULT hr;
|
||||
+ BitmapTestSrc *src_obj;
|
||||
+ IWICFormatConverter *converter;
|
||||
+ IWICPalette *palette;
|
||||
+ UINT count, i;
|
||||
+ BYTE buf[32 * 2 * 3]; /* enough to hold 32x2 24bppBGR data */
|
||||
+
|
||||
+ CreateTestBitmap(&testdata_24bppBGR, &src_obj);
|
||||
+
|
||||
+ hr = IWICImagingFactory_CreatePalette(factory, &palette);
|
||||
+ ok(hr == S_OK, "CreatePalette error %#x\n", hr);
|
||||
+ count = 0xdeadbeef;
|
||||
+ hr = IWICPalette_GetColorCount(palette, &count);
|
||||
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
|
||||
+ ok(count == 0, "expected 0, got %u\n", count);
|
||||
+
|
||||
+ /* NULL palette + Custom type*/
|
||||
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
|
||||
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
|
||||
+ &GUID_WICPixelFormat24bppBGR, WICBitmapDitherTypeNone,
|
||||
+ NULL, 0.0, WICBitmapPaletteTypeCustom);
|
||||
+ ok(hr == S_OK, "Initialize error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_CopyPalette(converter, palette);
|
||||
+ ok(hr == 0xdeadbeef, "unexpected error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_CopyPixels(converter, NULL, 32 * 3, sizeof(buf), buf);
|
||||
+ ok(hr == S_OK, "CopyPixels error %#x\n", hr);
|
||||
+ IWICFormatConverter_Release(converter);
|
||||
+
|
||||
+ /* NULL palette + Custom type*/
|
||||
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
|
||||
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
|
||||
+ &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
|
||||
+ NULL, 0.0, WICBitmapPaletteTypeCustom);
|
||||
+ ok(hr == E_INVALIDARG, "unexpected error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_CopyPalette(converter, palette);
|
||||
+ ok(hr == WINCODEC_ERR_WRONGSTATE, "unexpected error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
|
||||
+ ok(hr == WINCODEC_ERR_WRONGSTATE, "unexpected error %#x\n", hr);
|
||||
+ IWICFormatConverter_Release(converter);
|
||||
+
|
||||
+ /* empty palette + Custom type*/
|
||||
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
|
||||
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
|
||||
+ &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
|
||||
+ palette, 0.0, WICBitmapPaletteTypeCustom);
|
||||
+ ok(hr == S_OK, "Initialize error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_CopyPalette(converter, palette);
|
||||
+ ok(hr == S_OK, "CopyPalette error %#x\n", hr);
|
||||
+ count = 0xdeadbeef;
|
||||
+ hr = IWICPalette_GetColorCount(palette, &count);
|
||||
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
|
||||
+ ok(count == 0, "expected 0, got %u\n", count);
|
||||
+ memset(buf, 0xaa, sizeof(buf));
|
||||
+ hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
|
||||
+ ok(hr == S_OK, "CopyPixels error %#x\n", hr);
|
||||
+ count = 0;
|
||||
+ for (i = 0; i < 32 * 2; i++)
|
||||
+ if (buf[i] != 0) count++;
|
||||
+ ok(count == 0, "expected 0\n");
|
||||
+ IWICFormatConverter_Release(converter);
|
||||
+
|
||||
+ /* NULL palette + Predefined type*/
|
||||
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
|
||||
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
|
||||
+ &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
|
||||
+ NULL, 0.0, WICBitmapPaletteTypeFixedGray16);
|
||||
+ ok(hr == S_OK, "Initialize error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_CopyPalette(converter, palette);
|
||||
+ ok(hr == S_OK, "CopyPalette error %#x\n", hr);
|
||||
+ count = 0xdeadbeef;
|
||||
+ hr = IWICPalette_GetColorCount(palette, &count);
|
||||
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
|
||||
+ ok(count == 16, "expected 16, got %u\n", count);
|
||||
+ hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
|
||||
+ ok(hr == S_OK, "CopyPixels error %#x\n", hr);
|
||||
+ count = 0;
|
||||
+ for (i = 0; i < 32 * 2; i++)
|
||||
+ if (buf[i] != 0) count++;
|
||||
+ ok(count != 0, "expected != 0\n");
|
||||
+ IWICFormatConverter_Release(converter);
|
||||
+
|
||||
+ /* not empty palette + Predefined type*/
|
||||
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
|
||||
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
|
||||
+ &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
|
||||
+ palette, 0.0, WICBitmapPaletteTypeFixedHalftone64);
|
||||
+ ok(hr == S_OK, "Initialize error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_CopyPalette(converter, palette);
|
||||
+ ok(hr == S_OK, "CopyPalette error %#x\n", hr);
|
||||
+ count = 0xdeadbeef;
|
||||
+ hr = IWICPalette_GetColorCount(palette, &count);
|
||||
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
|
||||
+ ok(count == 16, "expected 16, got %u\n", count);
|
||||
+ hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
|
||||
+ ok(hr == S_OK, "CopyPixels error %#x\n", hr);
|
||||
+ count = 0;
|
||||
+ for (i = 0; i < 32 * 2; i++)
|
||||
+ if (buf[i] != 0) count++;
|
||||
+ ok(count != 0, "expected != 0\n");
|
||||
+ IWICFormatConverter_Release(converter);
|
||||
+
|
||||
+ /* not empty palette + MedianCut type*/
|
||||
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
|
||||
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
|
||||
+ &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
|
||||
+ palette, 0.0, WICBitmapPaletteTypeMedianCut);
|
||||
+ ok(hr == S_OK, "Initialize error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_CopyPalette(converter, palette);
|
||||
+ ok(hr == S_OK, "CopyPalette error %#x\n", hr);
|
||||
+ count = 0xdeadbeef;
|
||||
+ hr = IWICPalette_GetColorCount(palette, &count);
|
||||
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
|
||||
+ ok(count == 16, "expected 16, got %u\n", count);
|
||||
+ hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
|
||||
+ ok(hr == S_OK, "CopyPixels error %#x\n", hr);
|
||||
+ count = 0;
|
||||
+ for (i = 0; i < 32 * 2; i++)
|
||||
+ if (buf[i] != 0) count++;
|
||||
+ ok(count != 0, "expected != 0\n");
|
||||
+ IWICFormatConverter_Release(converter);
|
||||
+
|
||||
+ /* NULL palette + MedianCut type*/
|
||||
+ hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
|
||||
+ ok(hr == S_OK, "CreateFormatConverter error %#x\n", hr);
|
||||
+ hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
|
||||
+ &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
|
||||
+ NULL, 0.0, WICBitmapPaletteTypeMedianCut);
|
||||
+ ok(hr == S_OK || broken(hr == E_INVALIDARG) /* XP */, "Initialize error %#x\n", hr);
|
||||
+ if (hr == S_OK)
|
||||
+ {
|
||||
+ hr = IWICFormatConverter_CopyPalette(converter, palette);
|
||||
+ ok(hr == S_OK, "CopyPalette error %#x\n", hr);
|
||||
+ count = 0xdeadbeef;
|
||||
+ hr = IWICPalette_GetColorCount(palette, &count);
|
||||
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
|
||||
+ ok(count == 8, "expected 8, got %u\n", count);
|
||||
+ hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
|
||||
+ ok(hr == S_OK, "CopyPixels error %#x\n", hr);
|
||||
+ count = 0;
|
||||
+ for (i = 0; i < 32 * 2; i++)
|
||||
+ if (buf[i] != 0) count++;
|
||||
+ ok(count != 0, "expected != 0\n");
|
||||
+ }
|
||||
+ IWICFormatConverter_Release(converter);
|
||||
+
|
||||
+ IWICPalette_Release(palette);
|
||||
+ DeleteTestBitmap(src_obj);
|
||||
+}
|
||||
+
|
||||
START_TEST(converter)
|
||||
{
|
||||
HRESULT hr;
|
||||
@@ -1502,6 +1659,7 @@ START_TEST(converter)
|
||||
|
||||
test_invalid_conversion();
|
||||
test_default_converter();
|
||||
+ test_converter_8bppIndexed();
|
||||
|
||||
test_encoder(&testdata_BlackWhite, &CLSID_WICPngEncoder,
|
||||
&testdata_BlackWhite, &CLSID_WICPngDecoder, "PNG encoder BlackWhite");
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,25 +0,0 @@
|
||||
From 18eb6add9eac40d84a809d75d340600e44cc1dae Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Sun, 6 Nov 2016 16:25:12 +0800
|
||||
Subject: windowscodecs/tests: Add a missing check for
|
||||
IWICBitmapFrameDecode::GetPixelFormat return value.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/tests/converter.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
|
||||
index 430c0ed..6d782f3 100644
|
||||
--- a/dlls/windowscodecs/tests/converter.c
|
||||
+++ b/dlls/windowscodecs/tests/converter.c
|
||||
@@ -1311,6 +1311,7 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &pixelformat);
|
||||
+ ok(hr == S_OK, "GetPixelFormat) failed, hr=%x (%s)\n", hr, name);
|
||||
if (IsEqualGUID(&pixelformat, dsts[i]->format))
|
||||
compare_bitmap_data(srcs[i], dsts[i], (IWICBitmapSource*)framedecode, name);
|
||||
|
||||
--
|
||||
2.9.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user