Rebase against ae5e029d2227b3a8024f597591f76fe0f37d52e3.

This commit is contained in:
Zebediah Figura 2018-12-07 19:39:19 -06:00
parent 7a69c317fc
commit 4912f27424
10 changed files with 632 additions and 407 deletions

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "5cc5b102c1b0a66aa63b66f43f2da9a1a9d15ab6"
echo "ae5e029d2227b3a8024f597591f76fe0f37d52e3"
}
# Show version information
@ -314,6 +314,7 @@ patch_enable_all ()
enable_user32_Refresh_MDI_Menus="$1"
enable_user32_ScrollWindowEx="$1"
enable_user32_ShowWindow="$1"
enable_user32_dialog_focus="$1"
enable_user32_msgbox_Support_WM_COPY_mesg="$1"
enable_uxtheme_CloseThemeClass="$1"
enable_uxtheme_GTK_Theming="$1"
@ -1095,6 +1096,9 @@ patch_enable ()
user32-ShowWindow)
enable_user32_ShowWindow="$2"
;;
user32-dialog_focus)
enable_user32_dialog_focus="$2"
;;
user32-msgbox-Support-WM_COPY-mesg)
enable_user32_msgbox_Support_WM_COPY_mesg="$2"
;;
@ -6436,6 +6440,21 @@ if test "$enable_user32_ShowWindow" -eq 1; then
) >> "$patchlist"
fi
# Patchset user32-dialog_focus
# |
# | This patchset fixes the following Wine bugs:
# | * [#46215] File Open Dialog fails to set focus to Filename text box
# |
# | Modified files:
# | * dlls/user32/dialog.c
# |
if test "$enable_user32_dialog_focus" -eq 1; then
patch_apply user32-dialog_focus/0001-user32-Dont-reset-focus-if-current-control-is-a-chil.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "user32: Dont reset focus if current control is a child of our parent.", 1 },';
) >> "$patchlist"
fi
# Patchset user32-msgbox-Support-WM_COPY-mesg
# |
# | This patchset fixes the following Wine bugs:
@ -6544,7 +6563,7 @@ fi
# |
# | 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/pngformat.c, dlls/windowscodecs/regsvr.c,
# | dlls/windowscodecs/gifformat.c, dlls/windowscodecs/info.c, dlls/windowscodecs/regsvr.c,
# | dlls/windowscodecs/tests/converter.c, dlls/windowscodecs/tiffformat.c, dlls/windowscodecs/wincodecs_private.h,
# | dlls/windowscodecs/windowscodecs_wincodec.idl
# |
@ -6552,35 +6571,33 @@ 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/0011-windowscodecs-Add-registration-for-GUID_WICPixelForm.patch
patch_apply windowscodecs-GIF_Encoder/0012-windowscodecs-Implement-IWICBitmapDecoder-GetMetadat.patch
patch_apply windowscodecs-GIF_Encoder/0014-windowscodecs-Fix-the-buffer-size-check-in-the-TIFF-.patch
patch_apply windowscodecs-GIF_Encoder/0015-windowscodecs-Add-support-for-converting-to-8bppInde.patch
patch_apply windowscodecs-GIF_Encoder/0016-windowscodecs-WICConvertBitmapSource-should-ask-IWIC.patch
patch_apply windowscodecs-GIF_Encoder/0019-windowscodecs-Improve-stub-for-IWICBitmapDecoder-Get.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: Add registration for GUID_WICPixelFormat32bppGrayFloat pixel format.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Implement IWICBitmapDecoder::GetMetadataQueryReader in the TIFF decoder.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Fix the buffer size check in the TIFF decoder'\''s IWICBitmapFrameDecode::CopyPixels implementation.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add support for converting to 8bppIndexed format to IWICFormatConverter.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: WICConvertBitmapSource should ask IWICFormatConverter::Initialize to use an optimized palette.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Improve stub for IWICBitmapDecoder::GetMetadataQueryReader in the PNG decoder.", 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
@ -6595,12 +6612,10 @@ fi
# | dlls/windowscodecs/tests/palette.c, include/gdiplusflat.h
# |
if test "$enable_windowscodecs_IWICPalette_InitializeFromBitmap" -eq 1; then
patch_apply windowscodecs-IWICPalette_InitializeFromBitmap/0001-windowscodecs-tests-Add-some-tests-for-IWICPalette-I.patch
patch_apply windowscodecs-IWICPalette_InitializeFromBitmap/0002-windowscodecs-Implement-IWICPalette-InitializeFromBi.patch
patch_apply windowscodecs-IWICPalette_InitializeFromBitmap/0003-gdiplus-Implement-GdipInitializePalette.-v2.patch
patch_apply windowscodecs-IWICPalette_InitializeFromBitmap/0004-gdiplus-tests-Add-some-tests-for-GdipInitializePalet.patch
(
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs/tests: Add some tests for IWICPalette::InitializeFromBitmap.", 2 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Implement IWICPalette::InitializeFromBitmap.", 5 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "gdiplus: Implement GdipInitializePalette.", 2 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "gdiplus/tests: Add some tests for GdipInitializePalette.", 2 },';

View File

@ -1,4 +1,4 @@
From e30f36cd750f0016cfd219e27c44bbaa90b78104 Mon Sep 17 00:00:00 2001
From 1f72ae3bb68ea11fab39e3b30205ea613f77876e Mon Sep 17 00:00:00 2001
From: Louis Lenders <xerox.xerox2000x@gmail.com>
Date: Thu, 7 Jun 2018 11:51:01 +0200
Subject: [PATCH] uianimation: add stub dll
@ -11,7 +11,7 @@ Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
configure | 2 +
configure.ac | 1 +
dlls/uianimation/Makefile.in | 7 +
dlls/uianimation/main.c | 1393 ++++++++++++++++++++++++++++++
dlls/uianimation/main.c | 1393 ++++++++++++++++++++++
dlls/uianimation/uianimation.spec | 4 +
dlls/uianimation/uianimation_typelib.idl | 23 +
6 files changed, 1430 insertions(+)
@ -21,19 +21,19 @@ Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
create mode 100644 dlls/uianimation/uianimation_typelib.idl
diff --git a/configure b/configure
index 12679bf..2f9434e 100755
index 4807d0a2..6f73764c 100755
--- a/configure
+++ b/configure
@@ -1534,6 +1534,7 @@ enable_tdi_sys
enable_traffic
@@ -1547,6 +1547,7 @@ enable_traffic
enable_twain_32
enable_tzres
enable_ucrtbase
+enable_uianimation
enable_uiautomationcore
enable_uiribbon
enable_unicows
@@ -19182,6 +19183,7 @@ wine_fn_config_makefile dlls/twain_32/tests enable_tests
wine_fn_config_makefile dlls/typelib.dll16 enable_win16
@@ -19876,6 +19877,7 @@ wine_fn_config_makefile dlls/typelib.dll16 enable_win16
wine_fn_config_makefile dlls/tzres enable_tzres
wine_fn_config_makefile dlls/ucrtbase enable_ucrtbase
wine_fn_config_makefile dlls/ucrtbase/tests enable_tests
+wine_fn_config_makefile dlls/uianimation enable_uianimation
@ -41,11 +41,11 @@ index 12679bf..2f9434e 100755
wine_fn_config_makefile dlls/uiribbon enable_uiribbon
wine_fn_config_makefile dlls/unicows enable_unicows
diff --git a/configure.ac b/configure.ac
index 6d7f5ac..f4c944b 100644
index 08fbc3c1..9d98005c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3681,6 +3681,7 @@ WINE_CONFIG_MAKEFILE(dlls/twain_32/tests)
WINE_CONFIG_MAKEFILE(dlls/typelib.dll16,enable_win16)
@@ -3714,6 +3714,7 @@ WINE_CONFIG_MAKEFILE(dlls/typelib.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/tzres)
WINE_CONFIG_MAKEFILE(dlls/ucrtbase)
WINE_CONFIG_MAKEFILE(dlls/ucrtbase/tests)
+WINE_CONFIG_MAKEFILE(dlls/uianimation)
@ -54,7 +54,7 @@ index 6d7f5ac..f4c944b 100644
WINE_CONFIG_MAKEFILE(dlls/unicows)
diff --git a/dlls/uianimation/Makefile.in b/dlls/uianimation/Makefile.in
new file mode 100644
index 0000000..bc303b3
index 00000000..bc303b30
--- /dev/null
+++ b/dlls/uianimation/Makefile.in
@@ -0,0 +1,7 @@
@ -67,7 +67,7 @@ index 0000000..bc303b3
+ uianimation_typelib.idl
diff --git a/dlls/uianimation/main.c b/dlls/uianimation/main.c
new file mode 100644
index 0000000..28687b6
index 00000000..28687b63
--- /dev/null
+++ b/dlls/uianimation/main.c
@@ -0,0 +1,1393 @@
@ -1466,7 +1466,7 @@ index 0000000..28687b6
+}
diff --git a/dlls/uianimation/uianimation.spec b/dlls/uianimation/uianimation.spec
new file mode 100644
index 0000000..b16365d
index 00000000..b16365d0
--- /dev/null
+++ b/dlls/uianimation/uianimation.spec
@@ -0,0 +1,4 @@
@ -1476,7 +1476,7 @@ index 0000000..b16365d
+@ stdcall -private DllUnregisterServer()
diff --git a/dlls/uianimation/uianimation_typelib.idl b/dlls/uianimation/uianimation_typelib.idl
new file mode 100644
index 0000000..9066c09
index 00000000..9066c09a
--- /dev/null
+++ b/dlls/uianimation/uianimation_typelib.idl
@@ -0,0 +1,23 @@
@ -1504,5 +1504,5 @@ index 0000000..9066c09
+
+#include "uianimation.idl"
--
1.9.1
2.19.1

View File

@ -1,15 +1,15 @@
From 39d690bf0ea117214e76419876188c7277ae1749 Mon Sep 17 00:00:00 2001
From ff6282f297e67822ee0def394a677a4fdc0fa609 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 26 Jan 2017 19:01:21 +0800
Subject: [PATCH] windowscodecs: Fix 32bppRGB to 32bppRGBA conversion.
Subject: windowscodecs: Fix 32bppRGB to 32bppRGBA conversion.
---
dlls/windowscodecs/converter.c | 2 ++
dlls/windowscodecs/tests/converter.c | 43 ++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
dlls/windowscodecs/tests/converter.c | 45 +++++++++++++++++++++++++++++++++++-
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
index 47de603..d23c262 100644
index 519860d9065..1378c85bc2d 100644
--- a/dlls/windowscodecs/converter.c
+++ b/dlls/windowscodecs/converter.c
@@ -868,7 +868,9 @@ static HRESULT copypixels_to_32bppRGBA(struct FormatConverter *This, const WICRe
@ -23,10 +23,10 @@ index 47de603..d23c262 100644
return IWICBitmapSource_CopyPixels(This->source, prc, cbStride, cbBufferSize, pbBuffer);
return S_OK;
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index 5480584..77db7e8 100644
index 1cafe90c734..17724d9ed01 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -258,6 +258,21 @@ static BOOL compare_bits(const struct bitmap_data *expect, UINT buffersize, cons
@@ -291,6 +291,21 @@ static BOOL compare_bits(const struct bitmap_data *expect, UINT buffersize, cons
if (!equal && expect->alt_data)
equal = compare_bits(expect->alt_data, buffersize, converted_bits);
@ -48,20 +48,21 @@ index 5480584..77db7e8 100644
return equal;
}
@@ -353,12 +368,34 @@ static const BYTE bits_32bppBGR[] = {
0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80};
@@ -438,6 +453,10 @@ static const BYTE bits_32bppBGR[] = {
0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80, 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80};
static const struct bitmap_data testdata_32bppBGR = {
&GUID_WICPixelFormat32bppBGR, 32, bits_32bppBGR, 4, 2, 96.0, 96.0};
&GUID_WICPixelFormat32bppBGR, 32, bits_32bppBGR, 32, 2, 96.0, 96.0};
+static const struct bitmap_data testdata_32bppBGRA80 = {
+ &GUID_WICPixelFormat32bppBGRA, 32, bits_32bppBGR, 32, 2, 96.0, 96.0};
+static const struct bitmap_data testdata_32bppRGBA80 = {
+ &GUID_WICPixelFormat32bppRGBA, 32, bits_32bppBGR, 32, 2, 96.0, 96.0};
static const BYTE bits_32bppBGRA[] = {
255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255};
255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255, 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
@@ -450,6 +469,24 @@ static const BYTE bits_32bppBGRA[] = {
0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255};
static const struct bitmap_data testdata_32bppBGRA = {
&GUID_WICPixelFormat32bppBGRA, 32, bits_32bppBGRA, 4, 2, 96.0, 96.0};
&GUID_WICPixelFormat32bppBGRA, 32, bits_32bppBGRA, 32, 2, 96.0, 96.0};
+static const struct bitmap_data testdata_32bppRGBA = {
+ &GUID_WICPixelFormat32bppRGBA, 32, bits_32bppBGRA, 32, 2, 96.0, 96.0};
+static const struct bitmap_data testdata_32bppRGB = {
@ -83,7 +84,16 @@ index 5480584..77db7e8 100644
/* XP and 2003 use linear color conversion, later versions use sRGB gamma */
static const float bits_32bppGrayFloat_xp[] = {
@@ -1684,6 +1721,12 @@ START_TEST(converter)
@@ -515,7 +552,7 @@ static void test_conversion(const struct bitmap_data *src, const struct bitmap_d
hr = WICConvertBitmapSource(dst->format, &src_obj->IWICBitmapSource_iface, &dst_bitmap);
todo_wine_if (todo)
ok(hr == S_OK ||
- broken(hr == E_INVALIDARG) /* XP */, "WICConvertBitmapSource(%s) failed, hr=%x\n", name, hr);
+ broken(hr == E_INVALIDARG || hr == WINCODEC_ERR_COMPONENTNOTFOUND) /* XP */, "WICConvertBitmapSource(%s) failed, hr=%x\n", name, hr);
if (hr == S_OK)
{
@@ -1752,6 +1789,12 @@ START_TEST(converter)
test_conversion(&testdata_32bppBGRA, &testdata_32bppBGR, "BGRA -> BGR", FALSE);
test_conversion(&testdata_32bppBGR, &testdata_32bppBGRA, "BGR -> BGRA", FALSE);
test_conversion(&testdata_32bppBGRA, &testdata_32bppBGRA, "BGRA -> BGRA", FALSE);
@ -97,5 +107,5 @@ index 5480584..77db7e8 100644
test_conversion(&testdata_24bppBGR, &testdata_24bppBGR, "24bppBGR -> 24bppBGR", FALSE);
test_conversion(&testdata_24bppBGR, &testdata_24bppRGB, "24bppBGR -> 24bppRGB", FALSE);
--
1.9.1
2.11.0

View File

@ -1,53 +0,0 @@
From 6d21d949439cb6e519029aee6bc55693f4cafc6c Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 20 Oct 2016 19:02:39 +0800
Subject: windowscodecs: Add registration for GUID_WICPixelFormat32bppGrayFloat
pixel format.
---
dlls/windowscodecs/regsvr.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index 74637f5..4516d3f 100644
--- a/dlls/windowscodecs/regsvr.c
+++ b/dlls/windowscodecs/regsvr.c
@@ -1748,6 +1748,8 @@ static BYTE const channel_mask_16bit2[] = { 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
static BYTE const channel_mask_16bit3[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
static BYTE const channel_mask_16bit4[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff };
+static BYTE const channel_mask_32bit[] = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 };
+
static BYTE const channel_mask_5bit[] = { 0x1f, 0x00 };
static BYTE const channel_mask_5bit2[] = { 0xe0, 0x03 };
static BYTE const channel_mask_5bit3[] = { 0x00, 0x7c };
@@ -1764,6 +1766,8 @@ static BYTE const * const channel_masks_8bit[] = { channel_mask_8bit,
static BYTE const * const channel_masks_16bit[] = { channel_mask_16bit,
channel_mask_16bit2, channel_mask_16bit3, channel_mask_16bit4};
+static BYTE const * const channel_masks_32bit[] = { channel_mask_32bit };
+
static BYTE const * const channel_masks_BGRA5551[] = { channel_mask_5bit,
channel_mask_5bit2, channel_mask_5bit3, channel_mask_5bit4 };
@@ -1958,6 +1962,17 @@ static struct regsvr_pixelformat const pixelformat_list[] = {
WICPixelFormatNumericRepresentationUnsignedInteger,
1
},
+ { &GUID_WICPixelFormat32bppGrayFloat,
+ "The Wine Project",
+ "32bpp GrayFloat",
+ NULL, /* no version */
+ &GUID_VendorMicrosoft,
+ 32, /* bitsperpixel */
+ 1, /* channel count */
+ channel_masks_32bit,
+ WICPixelFormatNumericRepresentationFloat,
+ 1
+ },
{ &GUID_WICPixelFormat48bppRGB,
"The Wine Project",
"48bpp RGB",
--
2.9.0

View File

@ -1,32 +0,0 @@
From 2297b261c195840bcff9a3db40b25fcaaa747a7b Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 20 Oct 2016 16:49:08 +0800
Subject: windowscodecs: Implement IWICBitmapDecoder::GetMetadataQueryReader in
the TIFF decoder.
---
dlls/windowscodecs/tiffformat.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c
index 037277b..19aa5d5 100644
--- a/dlls/windowscodecs/tiffformat.c
+++ b/dlls/windowscodecs/tiffformat.c
@@ -699,8 +699,12 @@ static HRESULT WINAPI TiffDecoder_CopyPalette(IWICBitmapDecoder *iface,
static HRESULT WINAPI TiffDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface,
IWICMetadataQueryReader **ppIMetadataQueryReader)
{
- FIXME("(%p,%p): stub\n", iface, ppIMetadataQueryReader);
- return E_NOTIMPL;
+ TRACE("(%p,%p)\n", iface, ppIMetadataQueryReader);
+
+ if (!ppIMetadataQueryReader) return E_INVALIDARG;
+
+ *ppIMetadataQueryReader = NULL;
+ return WINCODEC_ERR_UNSUPPORTEDOPERATION;
}
static HRESULT WINAPI TiffDecoder_GetPreview(IWICBitmapDecoder *iface,
--
2.9.0

View File

@ -1,35 +0,0 @@
From 3204ee4de19693fd9e451a62216b68fe51ea2ca5 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 21 Oct 2016 14:38:43 +0800
Subject: windowscodecs: Improve stub for
IWICBitmapDecoder::GetMetadataQueryReader in the PNG decoder.
---
dlls/windowscodecs/pngformat.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index 94253d3..41d9099 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -853,10 +853,14 @@ static HRESULT WINAPI PngDecoder_CopyPalette(IWICBitmapDecoder *iface,
}
static HRESULT WINAPI PngDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface,
- IWICMetadataQueryReader **ppIMetadataQueryReader)
+ IWICMetadataQueryReader **reader)
{
- FIXME("(%p,%p): stub\n", iface, ppIMetadataQueryReader);
- return E_NOTIMPL;
+ FIXME("(%p,%p): stub\n", iface, reader);
+
+ if (!reader) return E_INVALIDARG;
+
+ *reader = NULL;
+ return WINCODEC_ERR_UNSUPPORTEDOPERATION;
}
static HRESULT WINAPI PngDecoder_GetPreview(IWICBitmapDecoder *iface,
--
2.9.0

View File

@ -1,18 +1,18 @@
From d9cd3ba23fa27fcffbe3d5dff9754c0520b3f92e Mon Sep 17 00:00:00 2001
From 59176c773e3e710418c79641ca3c11d81ce98849 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 27 Oct 2016 15:17:19 +0800
Subject: [PATCH] windowscodecs/tests: Add the tests for GIF encoder and
decoder.
---
dlls/windowscodecs/tests/converter.c | 59 +++++++++++++++++++++++++++++++++---
dlls/windowscodecs/tests/converter.c | 59 +++++++++++++++++++++++++---
1 file changed, 54 insertions(+), 5 deletions(-)
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index 089926b..5480584 100644
index 7d956a69..09125603 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -956,6 +956,40 @@ static void check_png_format(IStream *stream, const WICPixelFormatGUID *format)
@@ -1071,6 +1071,40 @@ static void check_png_format(IStream *stream, const WICPixelFormatGUID *format)
ok(0, "unknown PNG pixel format %s\n", wine_dbgstr_guid(format));
}
@ -53,7 +53,7 @@ index 089926b..5480584 100644
static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WICPixelFormatGUID *format)
{
HRESULT hr;
@@ -971,6 +1005,8 @@ static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WIC
@@ -1086,6 +1120,8 @@ static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WIC
check_bmp_format(stream, format);
else if (IsEqualGUID(encoder, &CLSID_WICTiffEncoder))
check_tiff_format(stream, format);
@ -62,7 +62,7 @@ index 089926b..5480584 100644
else
ok(0, "unknown encoder %s\n", wine_dbgstr_guid(encoder));
@@ -1089,7 +1125,7 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
@@ -1204,7 +1240,7 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
hr = CoCreateInstance(clsid_encoder, NULL, CLSCTX_INPROC_SERVER,
&IID_IWICBitmapEncoder, (void**)&encoder);
@ -71,7 +71,7 @@ index 089926b..5480584 100644
if (SUCCEEDED(hr))
{
hglobal = GlobalAlloc(GMEM_MOVEABLE, 0);
@@ -1116,7 +1152,10 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
@@ -1231,7 +1267,10 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
if (palette)
{
hr = IWICBitmapEncoder_SetPalette(encoder, palette);
@ -83,7 +83,7 @@ index 089926b..5480584 100644
hr = S_OK;
}
@@ -1268,13 +1307,19 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
@@ -1384,13 +1423,19 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
ok(hr == S_OK, "CreatePalette error %#x\n", hr);
hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
@ -105,7 +105,7 @@ index 089926b..5480584 100644
hr = S_OK;
i=0;
@@ -1331,7 +1376,8 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
@@ -1449,7 +1494,8 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
}
}
else if (IsEqualGUID(clsid_decoder, &CLSID_WICBmpDecoder) ||
@ -113,9 +113,9 @@ index 089926b..5480584 100644
+ IsEqualGUID(clsid_decoder, &CLSID_WICTiffDecoder) ||
+ IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
{
if (IsEqualGUID(dsts[i]->format, &GUID_WICPixelFormatBlackWhite) ||
IsEqualGUID(dsts[i]->format, &GUID_WICPixelFormat8bppIndexed))
@@ -1661,6 +1707,9 @@ START_TEST(converter)
if (IsEqualGUID(&pixelformat, &GUID_WICPixelFormatBlackWhite) ||
IsEqualGUID(&pixelformat, &GUID_WICPixelFormat8bppIndexed))
@@ -1789,6 +1835,9 @@ START_TEST(converter)
test_default_converter();
test_converter_8bppIndexed();
@ -126,5 +126,5 @@ index 089926b..5480584 100644
&testdata_BlackWhite, &CLSID_WICPngDecoder, "PNG encoder BlackWhite");
test_encoder(&testdata_1bppIndexed, &CLSID_WICPngEncoder,
--
1.9.1
2.19.1

View File

@ -0,0 +1,25 @@
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

View File

@ -1,234 +0,0 @@
From 65360656ee18c1bdcc50d8a81b41a691958903ab Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 20 Jul 2016 11:43:19 +0800
Subject: windowscodecs/tests: Add some tests for
IWICPalette::InitializeFromBitmap. (v2)
---
dlls/windowscodecs/tests/palette.c | 158 +++++++++++++++++++++++++++++++++----
1 file changed, 143 insertions(+), 15 deletions(-)
diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c
index e3b9a31..193e621 100644
--- a/dlls/windowscodecs/tests/palette.c
+++ b/dlls/windowscodecs/tests/palette.c
@@ -1,6 +1,6 @@
/*
* Copyright 2009 Vincent Povirk for CodeWeavers
- * Copyright 2012 Dmitry Timoshkov
+ * Copyright 2012,2016 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -27,9 +27,10 @@
#include "wincodec.h"
#include "wine/test.h"
+static IWICImagingFactory *factory;
+
static void test_custom_palette(void)
{
- IWICImagingFactory *factory;
IWICPalette *palette, *palette2;
HRESULT hr;
WICBitmapPaletteType type=0xffffffff;
@@ -38,11 +39,6 @@ static void test_custom_palette(void)
WICColor colors[4];
BOOL boolresult;
- hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
- &IID_IWICImagingFactory, (void**)&factory);
- ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
- if (FAILED(hr)) return;
-
hr = IWICImagingFactory_CreatePalette(factory, &palette);
ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr);
if (SUCCEEDED(hr))
@@ -207,8 +203,6 @@ static void test_custom_palette(void)
IWICPalette_Release(palette2);
IWICPalette_Release(palette);
}
-
- IWICImagingFactory_Release(factory);
}
static void generate_gray16_palette(DWORD *entries, UINT count)
@@ -451,7 +445,6 @@ static void test_predefined_palette(void)
{ WICBitmapPaletteTypeFixedHalftone256, 0, 0, 256, { 0 } },
{ WICBitmapPaletteTypeFixedHalftone256, 0, 0, 256, { 0 }, 1 }
};
- IWICImagingFactory *factory;
IWICPalette *palette;
HRESULT hr;
WICBitmapPaletteType type;
@@ -459,10 +452,6 @@ static void test_predefined_palette(void)
BOOL bret;
WICColor color[256];
- hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
- &IID_IWICImagingFactory, (void **)&factory);
- ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
-
hr = IWICImagingFactory_CreatePalette(factory, &palette);
ok(hr == S_OK, "CreatePalette error %#x\n", hr);
hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeCustom, FALSE);
@@ -538,16 +527,155 @@ static void test_predefined_palette(void)
IWICPalette_Release(palette);
}
+}
- IWICImagingFactory_Release(factory);
+static BYTE *init_bitmap(UINT *width, UINT *height, UINT *stride)
+{
+ BYTE *src;
+ UINT i, j, scale;
+
+ *width = 256;
+ *height = 256;
+ *stride = (*width * 3 + 3) & ~3;
+ trace("width %d, height %d, stride %d\n", *width, *height, *stride);
+
+ src = HeapAlloc(GetProcessHeap(), 0, *stride * *height);
+
+ scale = 256 / *width;
+ if (!scale) scale = 1;
+
+ for (i = 0; i < *height; i++)
+ {
+ for (j = 0; j < *width; j++)
+ {
+ src[i * *stride + j*3 + 0] = scale * i;
+ src[i * *stride + j*3 + 1] = scale * (255 - (i+j)/2);
+ src[i * *stride + j*3 + 2] = scale * j;
+ }
+ }
+
+ return src;
+}
+
+static void test_palette_from_bitmap(void)
+{
+ HRESULT hr;
+ BYTE *data;
+ IWICBitmap *bitmap;
+ IWICPalette *palette;
+ WICBitmapPaletteType type;
+ UINT width, height, stride, count, ret;
+ WICColor color[257];
+
+ data = init_bitmap(&width, &height, &stride);
+
+ hr = IWICImagingFactory_CreateBitmapFromMemory(factory, width, height, &GUID_WICPixelFormat24bppRGB,
+ stride, stride * height, data, &bitmap);
+ ok(hr == S_OK, "CreateBitmapFromMemory error %#x\n", hr);
+
+ hr = IWICImagingFactory_CreatePalette(factory, &palette);
+ ok(hr == S_OK, "CreatePalette error %#x\n", hr);
+
+ hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 0, FALSE);
+todo_wine
+ ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+
+ hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 1, FALSE);
+todo_wine
+ ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+
+ hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 257, FALSE);
+todo_wine
+ ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+
+ hr = IWICPalette_InitializeFromBitmap(palette, NULL, 16, FALSE);
+todo_wine
+ ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
+
+ hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 2, FALSE);
+todo_wine
+ ok(hr == S_OK, "InitializeFromBitmap error %#x\n", hr);
+if (hr == S_OK)
+{
+ hr = IWICPalette_GetColorCount(palette, &count);
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+ ok(count == 2, "expected 2, got %u\n", count);
+}
+
+ hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 2, TRUE);
+todo_wine
+ ok(hr == S_OK, "InitializeFromBitmap error %#x\n", hr);
+if (hr == S_OK)
+{
+ count = 0;
+ hr = IWICPalette_GetColorCount(palette, &count);
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+ ok(count == 2, "expected 2, got %u\n", count);
+}
+
+ /* without trasparent color */
+ hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 16, FALSE);
+todo_wine
+ ok(hr == S_OK, "InitializeFromBitmap error %#x\n", hr);
+if (hr == S_OK)
+{
+ type = -1;
+ hr = IWICPalette_GetType(palette, &type);
+ ok(hr == S_OK, "GetType error %#x\n", hr);
+ ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
+ count = 0;
+ hr = IWICPalette_GetColorCount(palette, &count);
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+ ok(count == 16, "expected 16, got %u\n", count);
+ memset(color, 0, sizeof(color));
+ hr = IWICPalette_GetColors(palette, count, color, &ret);
+ ok(hr == S_OK, "GetColors error %#x\n", hr);
+ ok(ret == count, "expected %u, got %u\n", count, ret);
+ ok(color[count - 1] != 0, "expected !0, got %08x\n", color[count - 1]);
+}
+
+ /* with trasparent color */
+ hr = IWICPalette_InitializeFromBitmap(palette, (IWICBitmapSource *)bitmap, 16, TRUE);
+todo_wine
+ ok(hr == S_OK, "InitializeFromBitmap error %#x\n", hr);
+if (hr == S_OK)
+{
+ type = -1;
+ hr = IWICPalette_GetType(palette, &type);
+ ok(hr == S_OK, "GetType error %#x\n", hr);
+ ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
+ count = 0;
+ hr = IWICPalette_GetColorCount(palette, &count);
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
+ ok(count == 16, "expected 16, got %u\n", count);
+ memset(color, 0xff, sizeof(color));
+ hr = IWICPalette_GetColors(palette, count, color, &ret);
+ ok(hr == S_OK, "GetColors error %#x\n", hr);
+ ok(ret == count, "expected %u, got %u\n", count, ret);
+ ok(color[count - 1] == 0, "expected 0, got %08x\n", color[count - 1]);
+}
+
+ IWICPalette_Release(palette);
+ IWICBitmap_Release(bitmap);
+
+ HeapFree(GetProcessHeap(), 0, data);
}
START_TEST(palette)
{
+ HRESULT hr;
+
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+ hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IWICImagingFactory, (void **)&factory);
+ ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
+
test_custom_palette();
test_predefined_palette();
+ test_palette_from_bitmap();
+
+ IWICImagingFactory_Release(factory);
CoUninitialize();
}
--
2.9.0