Rebase against 4c7f3f8af856888f5ab020b2a32d0b01db0c82f7.

This commit is contained in:
Sebastian Lackner
2016-12-12 04:28:52 +01:00
parent 0d616d719e
commit 6f120f6a56
28 changed files with 280 additions and 990 deletions

View File

@@ -1,4 +1,4 @@
From c047c038ead7bf00fba1ad1ba19ec6f1e67ace6a Mon Sep 17 00:00:00 2001
From c599c18b043d130c67aa0ccab02de57d0ea9fd9d Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 20 Sep 2016 14:22:44 +0800
Subject: windowscodecs: Decode PNG images with a tRNS chunk in their native
@@ -10,10 +10,10 @@ Subject: windowscodecs: Decode PNG images with a tRNS chunk in their native
1 file changed, 7 insertions(+), 29 deletions(-)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index fa54a23..4473b98 100644
index 410b34f..c131fed 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -321,11 +321,6 @@ MAKE_FUNCPTR(png_get_tRNS);
@@ -319,11 +319,6 @@ MAKE_FUNCPTR(png_get_tRNS);
MAKE_FUNCPTR(png_set_bgr);
MAKE_FUNCPTR(png_set_crc_action);
MAKE_FUNCPTR(png_set_error_fn);
@@ -23,9 +23,9 @@ index fa54a23..4473b98 100644
-MAKE_FUNCPTR(png_set_gray_1_2_4_to_8);
-#endif
MAKE_FUNCPTR(png_set_filler);
MAKE_FUNCPTR(png_set_filter);
MAKE_FUNCPTR(png_set_gray_to_rgb);
MAKE_FUNCPTR(png_set_interlace_handling);
@@ -386,11 +381,6 @@ static void *load_libpng(void)
@@ -388,11 +383,6 @@ static void *load_libpng(void)
LOAD_FUNCPTR(png_set_bgr);
LOAD_FUNCPTR(png_set_crc_action);
LOAD_FUNCPTR(png_set_error_fn);
@@ -35,9 +35,9 @@ index fa54a23..4473b98 100644
- LOAD_FUNCPTR(png_set_gray_1_2_4_to_8);
-#endif
LOAD_FUNCPTR(png_set_filler);
LOAD_FUNCPTR(png_set_filter);
LOAD_FUNCPTR(png_set_gray_to_rgb);
LOAD_FUNCPTR(png_set_interlace_handling);
@@ -582,6 +572,8 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
@@ -585,6 +575,8 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
int num_trans;
png_uint_32 transparency;
png_color_16p trans_values;
@@ -46,7 +46,7 @@ index fa54a23..4473b98 100644
jmp_buf jmpbuf;
BYTE chunk_type[4];
ULONG chunk_size;
@@ -648,25 +640,11 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
@@ -651,25 +643,11 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
/* check for color-keyed alpha */
transparency = ppng_get_tRNS(This->png_ptr, This->info_ptr, &trans, &num_trans, &trans_values);

View File

@@ -1,30 +1,14 @@
From 30634fd0942862f1ac76fe43bb64246232c9cf4b Mon Sep 17 00:00:00 2001
From 0cf91e33967d5829bfe70d6d9848f08db04d84ca Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 23 Sep 2016 16:36:50 +0800
Subject: windowscodecs: Add support for palette image formats to TIFF encoder.
---
dlls/windowscodecs/main.c | 4 ++--
dlls/windowscodecs/regsvr.c | 6 ++++++
dlls/windowscodecs/tests/converter.c | 25 ++++++++++++++++---------
dlls/windowscodecs/tiffformat.c | 26 ++++++++++++++++++++++++++
4 files changed, 50 insertions(+), 11 deletions(-)
3 files changed, 48 insertions(+), 9 deletions(-)
diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c
index 442976f..fdd26dd 100644
--- a/dlls/windowscodecs/main.c
+++ b/dlls/windowscodecs/main.c
@@ -144,8 +144,8 @@ HRESULT configure_write_source(IWICBitmapFrameEncode *iface,
if (!IsEqualGUID(&src_format, format))
{
/* FIXME: should use WICConvertBitmapSource to convert */
- ERR("format %s unsupported\n", debugstr_guid(&src_format));
- return E_FAIL;
+ FIXME("format %s unsupported\n", debugstr_guid(&src_format));
+ return E_NOTIMPL;
}
if (xres == 0.0 || yres == 0.0)
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index b011d71..b32b294 100644
--- a/dlls/windowscodecs/regsvr.c
@@ -50,10 +34,10 @@ index b011d71..b32b294 100644
&GUID_WICPixelFormat32bppBGRA,
&GUID_WICPixelFormat32bppPBGRA,
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index 13a8884..ca74e35 100644
index 660dc79..b99f0f8 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -706,13 +706,13 @@ static void check_tiff_format(IStream *stream, const WICPixelFormatGUID *format)
@@ -723,13 +723,13 @@ static void check_tiff_format(IStream *stream, const WICPixelFormatGUID *format)
}
else if (IsEqualGUID(format, &GUID_WICPixelFormat2bppIndexed))
{
@@ -70,7 +54,7 @@ index 13a8884..ca74e35 100644
}
else if (IsEqualGUID(format, &GUID_WICPixelFormat4bppIndexed))
{
@@ -1043,8 +1043,9 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
@@ -1060,8 +1060,9 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
memcpy(&pixelformat, srcs[i]->format, sizeof(GUID));
hr = IWICBitmapFrameEncode_SetPixelFormat(frameencode, &pixelformat);
ok(SUCCEEDED(hr), "SetPixelFormat failed, hr=%x\n", hr);
@@ -82,7 +66,7 @@ index 13a8884..ca74e35 100644
hr = IWICBitmapFrameEncode_SetSize(frameencode, srcs[i]->width, srcs[i]->height);
ok(SUCCEEDED(hr), "SetSize failed, hr=%x\n", hr);
@@ -1197,6 +1198,15 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
@@ -1214,6 +1215,15 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
ok(colors[4] == 0xff555555, "got %08x (%s)\n", colors[4], name);
ok(colors[5] == 0xff000000, "got %08x (%s)\n", colors[5], name);
}
@@ -98,7 +82,7 @@ index 13a8884..ca74e35 100644
else if (IsEqualGUID(dsts[i]->format, &GUID_WICPixelFormat4bppIndexed))
{
ok(count == 16, "expected 16, got %u (%s)\n", count, name);
@@ -1386,17 +1396,14 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in
@@ -1403,17 +1413,14 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in
test_encoder(&testdata_BlackWhite, &CLSID_WICTiffEncoder,
&testdata_BlackWhite, &CLSID_WICTiffDecoder, "TIFF encoder BlackWhite");
@@ -118,7 +102,7 @@ index 13a8884..ca74e35 100644
&testdata_24bppBGR, &CLSID_WICTiffDecoder, "TIFF encoder 24bppBGR");
diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c
index 1f757d8..350590d 100644
index b4b7e22..946eccd 100644
--- a/dlls/windowscodecs/tiffformat.c
+++ b/dlls/windowscodecs/tiffformat.c
@@ -1,5 +1,6 @@

View File

@@ -1,11 +1,11 @@
From b57a1d4183ec5241664c63fb3855d8863c8d9a98 Mon Sep 17 00:00:00 2001
From 417a574db2c401f6b5150683e284418f88a03e67 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 23 Sep 2016 20:17:47 +0800
Subject: windowscodecs: Add support for palette image formats to BMP encoder.
---
dlls/windowscodecs/bmpencode.c | 44 ++++++++++++++++++++++++++++--------
dlls/windowscodecs/main.c | 8 ++++++-
dlls/windowscodecs/info.c | 8 ++++++-
dlls/windowscodecs/regsvr.c | 5 ++++
dlls/windowscodecs/tests/converter.c | 18 +++++++++++----
4 files changed, 60 insertions(+), 15 deletions(-)
@@ -126,12 +126,12 @@ index af082ae..d4ec651 100644
/* write the image bits as a bottom-top array */
bits = This->bits + bih.bV5SizeImage;
for (i = 0; i < This->height; i++)
diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c
index fdd26dd..7931b3d 100644
--- a/dlls/windowscodecs/main.c
+++ b/dlls/windowscodecs/main.c
@@ -117,6 +117,12 @@ HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer,
}
diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c
index 84b80bc..bce2c47 100644
--- a/dlls/windowscodecs/info.c
+++ b/dlls/windowscodecs/info.c
@@ -2280,6 +2280,12 @@ HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnkn
return hr;
}
+static BOOL is_1bpp_format(const WICPixelFormatGUID *format)
@@ -140,18 +140,18 @@ index fdd26dd..7931b3d 100644
+ IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed);
+}
+
HRESULT configure_write_source(IWICBitmapFrameEncode *iface,
IWICBitmapSource *source, const WICRect *prc,
const WICPixelFormatGUID *format,
@@ -141,7 +147,7 @@ HRESULT configure_write_source(IWICBitmapFrameEncode *iface,
format = &dst_format;
}
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
{
HRESULT res;
@@ -2295,7 +2301,7 @@ HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitma
res = IWICBitmapSource_GetPixelFormat(pISrc, &srcFormat);
if (FAILED(res)) return res;
- if (!IsEqualGUID(&src_format, format))
+ if (!IsEqualGUID(&src_format, format) && !(is_1bpp_format(&src_format) && is_1bpp_format(format)))
- if (IsEqualGUID(&srcFormat, dstFormat))
+ if (IsEqualGUID(&srcFormat, dstFormat) || (is_1bpp_format(&srcFormat) && is_1bpp_format(dstFormat)))
{
/* FIXME: should use WICConvertBitmapSource to convert */
FIXME("format %s unsupported\n", debugstr_guid(&src_format));
IWICBitmapSource_AddRef(pISrc);
*ppIDst = pISrc;
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index b32b294..c72fbf1 100644
--- a/dlls/windowscodecs/regsvr.c
@@ -169,10 +169,10 @@ index b32b294..c72fbf1 100644
};
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index fa0a8f4..feeca5b 100644
index dec2ae7..6ee5652 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -768,6 +768,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
@@ -785,6 +785,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
if (IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed))
{
@@ -181,7 +181,7 @@ index fa0a8f4..feeca5b 100644
ok(bih.bV5Width == 32, "wrong width %u\n", bih.bV5Width);
ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height);
@@ -778,6 +780,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
@@ -795,6 +797,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
}
else if (IsEqualGUID(format, &GUID_WICPixelFormat2bppIndexed))
{
@@ -190,7 +190,7 @@ index fa0a8f4..feeca5b 100644
ok(bih.bV5Width == 16, "wrong width %u\n", bih.bV5Width);
ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height);
@@ -788,6 +792,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
@@ -805,6 +809,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
}
else if (IsEqualGUID(format, &GUID_WICPixelFormat4bppIndexed))
{
@@ -199,7 +199,7 @@ index fa0a8f4..feeca5b 100644
ok(bih.bV5Width == 8, "wrong width %u\n", bih.bV5Width);
ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height);
@@ -798,6 +804,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
@@ -815,6 +821,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
}
else if (IsEqualGUID(format, &GUID_WICPixelFormat8bppIndexed))
{
@@ -208,7 +208,7 @@ index fa0a8f4..feeca5b 100644
ok(bih.bV5Width == 4, "wrong width %u\n", bih.bV5Width);
ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height);
@@ -808,6 +816,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
@@ -825,6 +833,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
}
else if (IsEqualGUID(format, &GUID_WICPixelFormat32bppBGR))
{
@@ -217,7 +217,7 @@ index fa0a8f4..feeca5b 100644
ok(bih.bV5Width == 4, "wrong width %u\n", bih.bV5Width);
ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height);
@@ -1044,7 +1054,8 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
@@ -1061,7 +1071,8 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
hr = IWICBitmapFrameEncode_SetPixelFormat(frameencode, &pixelformat);
ok(SUCCEEDED(hr), "SetPixelFormat failed, hr=%x\n", hr);
ok(IsEqualGUID(&pixelformat, dsts[i]->format) ||
@@ -227,7 +227,7 @@ index fa0a8f4..feeca5b 100644
"SetPixelFormat changed the format to %s (%s)\n", wine_dbgstr_guid(&pixelformat), name);
hr = IWICBitmapFrameEncode_SetSize(frameencode, srcs[i]->width, srcs[i]->height);
@@ -1378,19 +1389,16 @@ START_TEST(converter)
@@ -1395,19 +1406,16 @@ START_TEST(converter)
test_encoder(&testdata_24bppBGR, &CLSID_WICPngEncoder,
&testdata_24bppBGR, &CLSID_WICPngDecoder, "PNG encoder 24bppBGR");