mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against 302153117e20b62c9170aed62aa33e83cacfaf59.
This commit is contained in:
parent
22cdd720aa
commit
8859da7cbd
@ -1,4 +1,4 @@
|
||||
From b75ee56387ae6b9f65041dc7583d4a59bed5e152 Mon Sep 17 00:00:00 2001
|
||||
From e2219e6b393f458d41f3b1d98ac7fb86d56aa235 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 31 May 2017 03:55:24 +0200
|
||||
Subject: msi/tests: Add custom action test framework and check
|
||||
@ -17,10 +17,10 @@ Subject: msi/tests: Add custom action test framework and check
|
||||
create mode 100644 dlls/msi/tests/custom.dll/main.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 5aaa20c22b6..f44d20c2e69 100644
|
||||
index f5a617c1c33..21de7fc3103 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3326,6 +3326,7 @@ WINE_CONFIG_DLL(mshtml,,[clean,implib])
|
||||
@@ -3276,6 +3276,7 @@ WINE_CONFIG_DLL(mshtml,,[clean,implib])
|
||||
WINE_CONFIG_TEST(dlls/mshtml/tests,[clean])
|
||||
WINE_CONFIG_DLL(msi,,[clean,implib])
|
||||
WINE_CONFIG_TEST(dlls/msi/tests)
|
||||
@ -164,7 +164,7 @@ index 00000000000..91ee2d77b5b
|
||||
+ return TRUE;
|
||||
+}
|
||||
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
|
||||
index 9d4fecc3eeb..23c1ce6d28c 100644
|
||||
index e4290397fe7..f1c1af9f2b6 100644
|
||||
--- a/dlls/msi/tests/install.c
|
||||
+++ b/dlls/msi/tests/install.c
|
||||
@@ -1031,6 +1031,26 @@ static const CHAR uc_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
|
||||
@ -194,8 +194,8 @@ index 9d4fecc3eeb..23c1ce6d28c 100644
|
||||
static const char mixed_feature_dat[] =
|
||||
"Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
|
||||
"s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
|
||||
@@ -1939,6 +1959,19 @@ static const msi_table ft_tables[] =
|
||||
ADD_TABLE(property)
|
||||
@@ -1973,6 +1993,19 @@ static const msi_table da_tables[] =
|
||||
ADD_TABLE(da_custom_action),
|
||||
};
|
||||
|
||||
+static const msi_table ca_tables[] =
|
||||
@ -214,8 +214,8 @@ index 9d4fecc3eeb..23c1ce6d28c 100644
|
||||
/* cabinet definitions */
|
||||
|
||||
/* make the max size large so there is only one cab file */
|
||||
@@ -6045,6 +6078,186 @@ static void test_feature_tree(void)
|
||||
DeleteFileA( msifile );
|
||||
@@ -6100,6 +6133,186 @@ error:
|
||||
DeleteFileA(msifile);
|
||||
}
|
||||
|
||||
+/* extracts a file from a resource to the specified filename */
|
||||
@ -401,14 +401,14 @@ index 9d4fecc3eeb..23c1ce6d28c 100644
|
||||
START_TEST(install)
|
||||
{
|
||||
DWORD len;
|
||||
@@ -6133,6 +6346,7 @@ START_TEST(install)
|
||||
test_shared_component();
|
||||
@@ -6189,6 +6402,7 @@ START_TEST(install)
|
||||
test_remove_upgrade_code();
|
||||
test_feature_tree();
|
||||
test_deferred_action();
|
||||
+ test_custom_action();
|
||||
|
||||
DeleteFileA(log_file);
|
||||
|
||||
--
|
||||
2.13.1
|
||||
2.14.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From eed82dcb03b097fe5e35ad02299977c7298c08aa Mon Sep 17 00:00:00 2001
|
||||
From 2712050d88f9b75e0b10e845d1ad21809a9d6dae Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Fri, 10 Apr 2015 07:51:16 +0200
|
||||
Subject: msvcrt: Calculate sinh/cosh/exp/pow with higher precision. (v2)
|
||||
@ -9,7 +9,7 @@ Based on a patch by Zheng Chen.
|
||||
1 file changed, 59 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
|
||||
index a94c34ac80e..6736f03ec4c 100644
|
||||
index 60ce4e659f5..140bf08828b 100644
|
||||
--- a/dlls/msvcrt/math.c
|
||||
+++ b/dlls/msvcrt/math.c
|
||||
@@ -64,6 +64,61 @@ static MSVCRT_matherr_func MSVCRT_default_matherr_func = NULL;
|
||||
@ -74,7 +74,7 @@ index a94c34ac80e..6736f03ec4c 100644
|
||||
void msvcrt_init_math(void)
|
||||
{
|
||||
sse2_supported = sse2_enabled = IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE );
|
||||
@@ -476,7 +531,7 @@ double CDECL MSVCRT_cos( double x )
|
||||
@@ -478,7 +533,7 @@ double CDECL MSVCRT_cos( double x )
|
||||
*/
|
||||
double CDECL MSVCRT_cosh( double x )
|
||||
{
|
||||
@ -83,7 +83,7 @@ index a94c34ac80e..6736f03ec4c 100644
|
||||
if (isnan(x)) math_error(_DOMAIN, "cosh", x, 0, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -486,7 +541,7 @@ double CDECL MSVCRT_cosh( double x )
|
||||
@@ -488,7 +543,7 @@ double CDECL MSVCRT_cosh( double x )
|
||||
*/
|
||||
double CDECL MSVCRT_exp( double x )
|
||||
{
|
||||
@ -92,16 +92,16 @@ index a94c34ac80e..6736f03ec4c 100644
|
||||
if (isnan(x)) math_error(_DOMAIN, "exp", x, 0, ret);
|
||||
else if (isfinite(x) && !ret) math_error(_UNDERFLOW, "exp", x, 0, ret);
|
||||
else if (isfinite(x) && !isfinite(ret)) math_error(_OVERFLOW, "exp", x, 0, ret);
|
||||
@@ -531,7 +586,7 @@ double CDECL MSVCRT_log10( double x )
|
||||
@@ -532,7 +587,7 @@ double CDECL MSVCRT_log10( double x )
|
||||
*/
|
||||
double CDECL MSVCRT_pow( double x, double y )
|
||||
{
|
||||
/* FIXME: If x < 0 and y is not integral, set EDOM */
|
||||
- double z = pow(x,y);
|
||||
+ double z = precise_pow(x, y);
|
||||
if (!isfinite(z)) math_error(_DOMAIN, "pow", x, y, z);
|
||||
return z;
|
||||
}
|
||||
@@ -551,7 +606,7 @@ double CDECL MSVCRT_sin( double x )
|
||||
+ double z = precise_pow(x,y);
|
||||
if (x < 0 && y != floor(y)) math_error(_DOMAIN, "pow", x, y, z);
|
||||
else if (!x && isfinite(y) && y < 0) math_error(_SING, "pow", x, y, z);
|
||||
else if (isfinite(x) && isfinite(y) && !isfinite(z)) math_error(_OVERFLOW, "pow", x, y, z);
|
||||
@@ -555,7 +610,7 @@ double CDECL MSVCRT_sin( double x )
|
||||
*/
|
||||
double CDECL MSVCRT_sinh( double x )
|
||||
{
|
||||
@ -111,5 +111,5 @@ index a94c34ac80e..6736f03ec4c 100644
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
2.13.1
|
||||
2.14.1
|
||||
|
||||
|
@ -52,13 +52,13 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "bb16263fe1974851f495435fef9a3d57fa2d4aa9"
|
||||
echo "302153117e20b62c9170aed62aa33e83cacfaf59"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
version()
|
||||
{
|
||||
echo "Wine Staging 2.17"
|
||||
echo "Wine Staging 2.18 (unreleased)"
|
||||
echo "Copyright (C) 2014-2017 the Wine Staging project authors."
|
||||
echo ""
|
||||
echo "Patchset to be applied on upstream Wine:"
|
||||
@ -465,7 +465,6 @@ patch_enable_all ()
|
||||
enable_wined3d_WINED3DFMT_R32G32_UINT="$1"
|
||||
enable_wined3d_WINED3D_RS_COLORWRITEENABLE="$1"
|
||||
enable_wined3d_buffer_create="$1"
|
||||
enable_wined3d_cpu_blitter_blit="$1"
|
||||
enable_wined3d_draw_primitive_arrays="$1"
|
||||
enable_wined3d_sample_c_lz="$1"
|
||||
enable_wined3d_wined3d_guess_gl_vendor="$1"
|
||||
@ -1674,9 +1673,6 @@ patch_enable ()
|
||||
wined3d-buffer_create)
|
||||
enable_wined3d_buffer_create="$2"
|
||||
;;
|
||||
wined3d-cpu_blitter_blit)
|
||||
enable_wined3d_cpu_blitter_blit="$2"
|
||||
;;
|
||||
wined3d-draw_primitive_arrays)
|
||||
enable_wined3d_draw_primitive_arrays="$2"
|
||||
;;
|
||||
@ -9106,8 +9102,6 @@ fi
|
||||
# | dlls/windowscodecs/tests/converter.c, dlls/windowscodecs/tests/pngformat.c, dlls/windowscodecs/tiffformat.c
|
||||
# |
|
||||
if test "$enable_windowscodecs_Palette_Images" -eq 1; then
|
||||
patch_apply windowscodecs-Palette_Images/0005-windowscodecs-Add-support-for-palette-image-formats-.patch
|
||||
patch_apply windowscodecs-Palette_Images/0011-windowscodecs-tests-Add-some-tests-for-encoding-1bpp.patch
|
||||
patch_apply windowscodecs-Palette_Images/0012-windowscodecs-tests-Add-tests-for-encoding-2bpp-4bpp.patch
|
||||
patch_apply windowscodecs-Palette_Images/0013-windowscodecs-Use-V_UI1-instead-of-V_UNION-to-assign.patch
|
||||
patch_apply windowscodecs-Palette_Images/0014-windowscodecs-Add-support-for-palette-image-formats-.patch
|
||||
@ -9117,8 +9111,6 @@ if test "$enable_windowscodecs_Palette_Images" -eq 1; then
|
||||
patch_apply windowscodecs-Palette_Images/0020-windowscodecs-find_decoder-should-return-an-error-it.patch
|
||||
patch_apply windowscodecs-Palette_Images/0021-windowscodecs-PNG-decoder-should-return-WINCODEC_ERR.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add support for palette image formats to PNG encoder.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs/tests: Add some tests for encoding 1bpp/8bpp images with a palette.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs/tests: Add tests for encoding 2bpp/4bpp images with a palette.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Use V_UI1() instead of V_UNION() to assign a VT_UI1 variant member.", 1 },';
|
||||
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add support for palette image formats to TIFF encoder.", 1 },';
|
||||
@ -9929,21 +9921,6 @@ if test "$enable_wined3d_buffer_create" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-cpu_blitter_blit
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#43701] Don't claim SYSMEM location to be current if memory was evicted
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/wined3d/surface.c
|
||||
# |
|
||||
if test "$enable_wined3d_cpu_blitter_blit" -eq 1; then
|
||||
patch_apply wined3d-cpu_blitter_blit/0001-wined3d-Don-t-claim-SYSMEM-location-to-be-current-if.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Matteo Bruni", "wined3d: Don'\''t claim SYSMEM location to be current if memory was evicted.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-sample_c_lz
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 365725a03e12ff7df73851d787398b62f3e10ddf Mon Sep 17 00:00:00 2001
|
||||
From 366f728c4ddfe2f4c23f049f572ff6858b3ceca5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 8 May 2016 21:52:06 +0200
|
||||
Subject: secur32: Set output buffer size to zero during handshake when no data
|
||||
@ -10,14 +10,14 @@ Subject: secur32: Set output buffer size to zero during handshake when no data
|
||||
2 files changed, 20 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c
|
||||
index 71f219c7a3c..007f7183928 100644
|
||||
index 88b6521a7d8..cbfbc32ba1e 100644
|
||||
--- a/dlls/secur32/schannel.c
|
||||
+++ b/dlls/secur32/schannel.c
|
||||
@@ -899,6 +899,18 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
|
||||
@@ -901,6 +901,18 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
|
||||
/* Perform the TLS handshake */
|
||||
ret = schan_imp_handshake(ctx->session);
|
||||
|
||||
+ out_buffers = &transport.out;
|
||||
+ out_buffers = &ctx->transport.out;
|
||||
+ if (out_buffers->current_buffer_idx != -1)
|
||||
+ {
|
||||
+ SecBuffer *buffer = &out_buffers->desc->pBuffers[out_buffers->current_buffer_idx];
|
||||
@ -29,14 +29,14 @@ index 71f219c7a3c..007f7183928 100644
|
||||
+ buffer->cbBuffer = 0;
|
||||
+ }
|
||||
+
|
||||
if(transport.in.offset && transport.in.offset != pInput->pBuffers[0].cbBuffer) {
|
||||
if(ctx->transport.in.offset && ctx->transport.in.offset != pInput->pBuffers[0].cbBuffer) {
|
||||
if(pInput->cBuffers<2 || pInput->pBuffers[1].BufferType!=SECBUFFER_EMPTY)
|
||||
return SEC_E_INVALID_TOKEN;
|
||||
@@ -907,13 +919,6 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
|
||||
pInput->pBuffers[1].cbBuffer = pInput->pBuffers[0].cbBuffer-transport.in.offset;
|
||||
@@ -909,13 +921,6 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
|
||||
pInput->pBuffers[1].cbBuffer = pInput->pBuffers[0].cbBuffer-ctx->transport.in.offset;
|
||||
}
|
||||
|
||||
- out_buffers = &transport.out;
|
||||
- out_buffers = &ctx->transport.out;
|
||||
- if (out_buffers->current_buffer_idx != -1)
|
||||
- {
|
||||
- SecBuffer *buffer = &out_buffers->desc->pBuffers[out_buffers->current_buffer_idx];
|
||||
@ -47,10 +47,10 @@ index 71f219c7a3c..007f7183928 100644
|
||||
if (ctx->req_ctx_attr & ISC_REQ_REPLAY_DETECT)
|
||||
*pfContextAttr |= ISC_RET_REPLAY_DETECT;
|
||||
diff --git a/dlls/secur32/tests/schannel.c b/dlls/secur32/tests/schannel.c
|
||||
index ead0e8c8b5b..f7c0e2d5c45 100644
|
||||
index b5ed169a978..110d4d8c397 100644
|
||||
--- a/dlls/secur32/tests/schannel.c
|
||||
+++ b/dlls/secur32/tests/schannel.c
|
||||
@@ -770,7 +770,6 @@ todo_wine
|
||||
@@ -771,7 +771,6 @@ todo_wine
|
||||
ISC_REQ_CONFIDENTIALITY|ISC_REQ_STREAM,
|
||||
0, 0, &buffers[1], 0, NULL, &buffers[0], &attrs, NULL);
|
||||
ok(status == SEC_E_INVALID_TOKEN, "Expected SEC_E_INVALID_TOKEN, got %08x\n", status);
|
||||
@ -58,7 +58,7 @@ index ead0e8c8b5b..f7c0e2d5c45 100644
|
||||
ok(buffers[0].pBuffers[0].cbBuffer == 0, "Output buffer size was not set to 0.\n");
|
||||
|
||||
buffers[0].pBuffers[0].cbBuffer = 0;
|
||||
@@ -780,9 +779,15 @@ todo_wine
|
||||
@@ -781,9 +780,15 @@ todo_wine
|
||||
todo_wine
|
||||
ok(status == SEC_E_INSUFFICIENT_MEMORY || status == SEC_E_INVALID_TOKEN,
|
||||
"Expected SEC_E_INSUFFICIENT_MEMORY or SEC_E_INVALID_TOKEN, got %08x\n", status);
|
||||
@ -75,7 +75,7 @@ index ead0e8c8b5b..f7c0e2d5c45 100644
|
||||
status = InitializeSecurityContextA(&cred_handle, NULL, (SEC_CHAR *)"localhost",
|
||||
ISC_REQ_CONFIDENTIALITY|ISC_REQ_STREAM,
|
||||
0, 0, NULL, 0, &context, &buffers[0], &attrs, NULL);
|
||||
@@ -855,6 +860,7 @@ todo_wine
|
||||
@@ -858,6 +863,7 @@ todo_wine
|
||||
buffers[1].pBuffers[0].cbBuffer = buf_size;
|
||||
}
|
||||
|
||||
@ -84,5 +84,5 @@ index ead0e8c8b5b..f7c0e2d5c45 100644
|
||||
"InitializeSecurityContext failed: %08x\n", status);
|
||||
if(status != SEC_E_OK) {
|
||||
--
|
||||
2.11.0
|
||||
2.14.1
|
||||
|
||||
|
@ -1,115 +0,0 @@
|
||||
From ed7888a251aef87d82b931a02edc26c9899a236c Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Tue, 20 Sep 2016 14:28:49 +0800
|
||||
Subject: windowscodecs: Add support for palette image formats to PNG encoder.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/pngformat.c | 45 ++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/windowscodecs/regsvr.c | 4 ++++
|
||||
2 files changed, 49 insertions(+)
|
||||
|
||||
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
|
||||
index 10c96038630..3df2c426a46 100644
|
||||
--- a/dlls/windowscodecs/pngformat.c
|
||||
+++ b/dlls/windowscodecs/pngformat.c
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009 Vincent Povirk for CodeWeavers
|
||||
+ * Copyright 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
|
||||
@@ -325,8 +326,10 @@ MAKE_FUNCPTR(png_set_gray_to_rgb);
|
||||
MAKE_FUNCPTR(png_set_interlace_handling);
|
||||
MAKE_FUNCPTR(png_set_IHDR);
|
||||
MAKE_FUNCPTR(png_set_pHYs);
|
||||
+MAKE_FUNCPTR(png_set_PLTE);
|
||||
MAKE_FUNCPTR(png_set_read_fn);
|
||||
MAKE_FUNCPTR(png_set_strip_16);
|
||||
+MAKE_FUNCPTR(png_set_tRNS);
|
||||
MAKE_FUNCPTR(png_set_tRNS_to_alpha);
|
||||
MAKE_FUNCPTR(png_set_write_fn);
|
||||
MAKE_FUNCPTR(png_read_end);
|
||||
@@ -389,8 +392,10 @@ static void *load_libpng(void)
|
||||
LOAD_FUNCPTR(png_set_interlace_handling);
|
||||
LOAD_FUNCPTR(png_set_IHDR);
|
||||
LOAD_FUNCPTR(png_set_pHYs);
|
||||
+ LOAD_FUNCPTR(png_set_PLTE);
|
||||
LOAD_FUNCPTR(png_set_read_fn);
|
||||
LOAD_FUNCPTR(png_set_strip_16);
|
||||
+ LOAD_FUNCPTR(png_set_tRNS);
|
||||
LOAD_FUNCPTR(png_set_tRNS_to_alpha);
|
||||
LOAD_FUNCPTR(png_set_write_fn);
|
||||
LOAD_FUNCPTR(png_read_end);
|
||||
@@ -1315,6 +1320,10 @@ static const struct png_pixelformat formats[] = {
|
||||
{&GUID_WICPixelFormat32bppBGR, 32, 8, PNG_COLOR_TYPE_RGB, 1, 1},
|
||||
{&GUID_WICPixelFormat48bppRGB, 48, 16, PNG_COLOR_TYPE_RGB, 0, 0},
|
||||
{&GUID_WICPixelFormat64bppRGBA, 64, 16, PNG_COLOR_TYPE_RGB_ALPHA, 0, 0},
|
||||
+ {&GUID_WICPixelFormat1bppIndexed, 1, 1, PNG_COLOR_TYPE_PALETTE, 0, 0},
|
||||
+ {&GUID_WICPixelFormat2bppIndexed, 2, 2, PNG_COLOR_TYPE_PALETTE, 0, 0},
|
||||
+ {&GUID_WICPixelFormat4bppIndexed, 4, 4, PNG_COLOR_TYPE_PALETTE, 0, 0},
|
||||
+ {&GUID_WICPixelFormat8bppIndexed, 8, 8, PNG_COLOR_TYPE_PALETTE, 0, 0},
|
||||
{NULL},
|
||||
};
|
||||
|
||||
@@ -1617,6 +1626,42 @@ static HRESULT WINAPI PngFrameEncode_WritePixels(IWICBitmapFrameEncode *iface,
|
||||
(This->yres+0.0127) / 0.0254, PNG_RESOLUTION_METER);
|
||||
}
|
||||
|
||||
+ if (This->format->color_type == PNG_COLOR_TYPE_PALETTE && This->colors)
|
||||
+ {
|
||||
+ png_color png_palette[256];
|
||||
+ png_byte trans[256];
|
||||
+ UINT i, num_trans = 0, colors;
|
||||
+
|
||||
+ /* Newer libpng versions don't accept larger palettes than the declared
|
||||
+ * bit depth, so we need to generate the palette of the correct length.
|
||||
+ */
|
||||
+ colors = 1 << This->format->bit_depth;
|
||||
+
|
||||
+ for (i = 0; i < colors; i++)
|
||||
+ {
|
||||
+ if (i < This->colors)
|
||||
+ {
|
||||
+ png_palette[i].red = (This->palette[i] >> 16) & 0xff;
|
||||
+ png_palette[i].green = (This->palette[i] >> 8) & 0xff;
|
||||
+ png_palette[i].blue = This->palette[i] & 0xff;
|
||||
+ trans[i] = (This->palette[i] >> 24) & 0xff;
|
||||
+ if (trans[i] != 0xff)
|
||||
+ num_trans++;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ png_palette[i].red = 0;
|
||||
+ png_palette[i].green = 0;
|
||||
+ png_palette[i].blue = 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ppng_set_PLTE(This->png_ptr, This->info_ptr, png_palette, colors);
|
||||
+
|
||||
+ if (num_trans)
|
||||
+ ppng_set_tRNS(This->png_ptr, This->info_ptr, trans, colors, NULL);
|
||||
+ }
|
||||
+
|
||||
ppng_write_info(This->png_ptr, This->info_ptr);
|
||||
|
||||
if (This->format->remove_filler)
|
||||
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
|
||||
index 10a6c03d9b6..b011d716451 100644
|
||||
--- a/dlls/windowscodecs/regsvr.c
|
||||
+++ b/dlls/windowscodecs/regsvr.c
|
||||
@@ -1359,6 +1359,10 @@ static GUID const * const png_encode_formats[] = {
|
||||
&GUID_WICPixelFormat32bppBGRA,
|
||||
&GUID_WICPixelFormat48bppRGB,
|
||||
&GUID_WICPixelFormat64bppRGBA,
|
||||
+ &GUID_WICPixelFormat1bppIndexed,
|
||||
+ &GUID_WICPixelFormat2bppIndexed,
|
||||
+ &GUID_WICPixelFormat4bppIndexed,
|
||||
+ &GUID_WICPixelFormat8bppIndexed,
|
||||
NULL
|
||||
};
|
||||
|
||||
--
|
||||
2.14.1
|
||||
|
@ -1,559 +0,0 @@
|
||||
From 0644c971ba8d69eadc161ce50241eea78fc4ec57 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Tue, 20 Sep 2016 14:47:48 +0800
|
||||
Subject: windowscodecs/tests: Add some tests for encoding 1bpp/8bpp images
|
||||
with a palette.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/tests/converter.c | 359 +++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 340 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
|
||||
index 13aa3c11ca8..704ae5d0ddc 100644
|
||||
--- a/dlls/windowscodecs/tests/converter.c
|
||||
+++ b/dlls/windowscodecs/tests/converter.c
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009 Vincent Povirk
|
||||
+ * Copyright 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
|
||||
@@ -17,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
+#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
#define COBJMACROS
|
||||
@@ -28,6 +30,8 @@
|
||||
#include "wincodecsdk.h"
|
||||
#include "wine/test.h"
|
||||
|
||||
+static IWICImagingFactory *factory;
|
||||
+
|
||||
typedef struct bitmap_data {
|
||||
const WICPixelFormatGUID *format;
|
||||
UINT bpp;
|
||||
@@ -235,6 +239,19 @@ static BOOL compare_bits(const struct bitmap_data *expect, UINT buffersize, cons
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ else if (IsEqualGUID(expect->format, &GUID_WICPixelFormatBlackWhite) ||
|
||||
+ IsEqualGUID(expect->format, &GUID_WICPixelFormat1bppIndexed))
|
||||
+ {
|
||||
+ UINT i;
|
||||
+ const BYTE *a=(const BYTE*)expect->bits, *b=(const BYTE*)converted_bits;
|
||||
+ equal=TRUE;
|
||||
+ for (i=0; i<buffersize; i++)
|
||||
+ if (a[i] != b[i] && b[i] != 0xff /* BMP encoder B&W */)
|
||||
+ {
|
||||
+ equal = FALSE;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
else
|
||||
equal = (memcmp(expect->bits, converted_bits, buffersize) == 0);
|
||||
|
||||
@@ -266,7 +283,7 @@ static void compare_bitmap_data(const struct bitmap_data *expect, IWICBitmapSour
|
||||
|
||||
hr = IWICBitmapSource_GetPixelFormat(source, &dst_pixelformat);
|
||||
ok(SUCCEEDED(hr), "GetPixelFormat(%s) failed, hr=%x\n", name, hr);
|
||||
- ok(IsEqualGUID(&dst_pixelformat, expect->format), "got unexpected pixel format (%s)\n", name);
|
||||
+ ok(IsEqualGUID(&dst_pixelformat, expect->format), "got unexpected pixel format %s (%s)\n", wine_dbgstr_guid(&dst_pixelformat), name);
|
||||
|
||||
prc.X = 0;
|
||||
prc.Y = 0;
|
||||
@@ -290,6 +307,21 @@ static void compare_bitmap_data(const struct bitmap_data *expect, IWICBitmapSour
|
||||
HeapFree(GetProcessHeap(), 0, converted_bits);
|
||||
}
|
||||
|
||||
+/* some encoders (like BMP) require data to be 4-bytes aligned */
|
||||
+static const BYTE bits_1bpp[] = {
|
||||
+ 0x55,0x55,0x55,0x55, /*01010101*/
|
||||
+ 0xaa,0xaa,0xaa,0xaa}; /*10101010*/
|
||||
+static const struct bitmap_data testdata_BlackWhite = {
|
||||
+ &GUID_WICPixelFormatBlackWhite, 1, bits_1bpp, 32, 2, 96.0, 96.0};
|
||||
+static const struct bitmap_data testdata_1bppIndexed = {
|
||||
+ &GUID_WICPixelFormat1bppIndexed, 1, bits_1bpp, 32, 2, 96.0, 96.0};
|
||||
+
|
||||
+static const BYTE bits_8bpp[] = {
|
||||
+ 0,1,2,3,
|
||||
+ 4,5,6,7};
|
||||
+static const struct bitmap_data testdata_8bppIndexed = {
|
||||
+ &GUID_WICPixelFormat8bppIndexed, 8, bits_8bpp, 4, 2, 96.0, 96.0};
|
||||
+
|
||||
static const BYTE bits_24bppBGR[] = {
|
||||
255,0,0, 0,255,0, 0,0,255, 0,0,0,
|
||||
0,255,255, 255,0,255, 255,255,0, 255,255,255};
|
||||
@@ -592,6 +624,118 @@ static void test_encoder_properties(const CLSID* clsid_encoder, IPropertyBag2 *o
|
||||
}
|
||||
}
|
||||
|
||||
+static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
|
||||
+{
|
||||
+ /* FIXME */
|
||||
+}
|
||||
+
|
||||
+static void check_tiff_format(IStream *stream, const WICPixelFormatGUID *format)
|
||||
+{
|
||||
+ /* FIXME */
|
||||
+}
|
||||
+
|
||||
+static unsigned be_uint(unsigned val)
|
||||
+{
|
||||
+ union
|
||||
+ {
|
||||
+ unsigned val;
|
||||
+ char c[4];
|
||||
+ } u;
|
||||
+
|
||||
+ u.val = val;
|
||||
+ return (u.c[0] << 24) | (u.c[1] << 16) | (u.c[2] << 8) | u.c[3];
|
||||
+}
|
||||
+
|
||||
+static void check_png_format(IStream *stream, const WICPixelFormatGUID *format)
|
||||
+{
|
||||
+ static const char png_sig[8] = {0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a};
|
||||
+ static const char png_IHDR[8] = {0,0,0,0x0d,'I','H','D','R'};
|
||||
+ HRESULT hr;
|
||||
+ struct
|
||||
+ {
|
||||
+ char png_sig[8];
|
||||
+ char ihdr_sig[8];
|
||||
+ unsigned width, height;
|
||||
+ char bit_depth, color_type, compression, filter, interlace;
|
||||
+ } png;
|
||||
+
|
||||
+ memset(&png, 0, sizeof(png));
|
||||
+ hr = IStream_Read(stream, &png, sizeof(png), NULL);
|
||||
+ ok(hr == S_OK, "IStream_Read error %#x\n", hr);
|
||||
+
|
||||
+ ok(!memcmp(png.png_sig, png_sig, sizeof(png_sig)), "expected PNG signature\n");
|
||||
+ ok(!memcmp(png.ihdr_sig, png_IHDR, sizeof(png_IHDR)), "expected PNG IHDR\n");
|
||||
+
|
||||
+ if (IsEqualGUID(format, &GUID_WICPixelFormatBlackWhite))
|
||||
+ {
|
||||
+ ok(be_uint(png.width) == 32, "wrong width %u\n", be_uint(png.width));
|
||||
+ ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
|
||||
+
|
||||
+ ok(png.bit_depth == 1, "wrong bit_depth %d\n", png.bit_depth);
|
||||
+ ok(png.color_type == 0, "wrong color_type %d\n", png.color_type);
|
||||
+ ok(png.compression == 0, "wrong compression %d\n", png.compression);
|
||||
+ ok(png.filter == 0, "wrong filter %d\n", png.filter);
|
||||
+ ok(png.interlace == 0, "wrong interlace %d\n", png.interlace);
|
||||
+ }
|
||||
+ else if (IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed))
|
||||
+ {
|
||||
+ ok(be_uint(png.width) == 32, "wrong width %u\n", be_uint(png.width));
|
||||
+ ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
|
||||
+
|
||||
+ ok(png.bit_depth == 1, "wrong bit_depth %d\n", png.bit_depth);
|
||||
+ ok(png.color_type == 3, "wrong color_type %d\n", png.color_type);
|
||||
+ ok(png.compression == 0, "wrong compression %d\n", png.compression);
|
||||
+ ok(png.filter == 0, "wrong filter %d\n", png.filter);
|
||||
+ ok(png.interlace == 0, "wrong interlace %d\n", png.interlace);
|
||||
+ }
|
||||
+ else if (IsEqualGUID(format, &GUID_WICPixelFormat8bppIndexed))
|
||||
+ {
|
||||
+ ok(be_uint(png.width) == 4, "wrong width %u\n", be_uint(png.width));
|
||||
+ ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
|
||||
+
|
||||
+ ok(png.bit_depth == 8, "wrong bit_depth %d\n", png.bit_depth);
|
||||
+ ok(png.color_type == 3, "wrong color_type %d\n", png.color_type);
|
||||
+ ok(png.compression == 0, "wrong compression %d\n", png.compression);
|
||||
+ ok(png.filter == 0, "wrong filter %d\n", png.filter);
|
||||
+ ok(png.interlace == 0, "wrong interlace %d\n", png.interlace);
|
||||
+ }
|
||||
+ else if (IsEqualGUID(format, &GUID_WICPixelFormat24bppBGR))
|
||||
+ {
|
||||
+ ok(be_uint(png.width) == 4, "wrong width %u\n", be_uint(png.width));
|
||||
+ ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
|
||||
+
|
||||
+ ok(png.bit_depth == 8, "wrong bit_depth %d\n", png.bit_depth);
|
||||
+ ok(png.color_type == 2, "wrong color_type %d\n", png.color_type);
|
||||
+ ok(png.compression == 0, "wrong compression %d\n", png.compression);
|
||||
+ ok(png.filter == 0, "wrong filter %d\n", png.filter);
|
||||
+ ok(png.interlace == 0 || png.interlace == 1, "wrong interlace %d\n", png.interlace);
|
||||
+ }
|
||||
+ else
|
||||
+ ok(0, "unknown PNG pixel format %s\n", wine_dbgstr_guid(format));
|
||||
+}
|
||||
+
|
||||
+static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WICPixelFormatGUID *format)
|
||||
+{
|
||||
+ HRESULT hr;
|
||||
+ LARGE_INTEGER pos;
|
||||
+
|
||||
+ pos.QuadPart = 0;
|
||||
+ hr = IStream_Seek(stream, pos, SEEK_SET, (ULARGE_INTEGER *)&pos);
|
||||
+ ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
|
||||
+
|
||||
+ if (IsEqualGUID(encoder, &CLSID_WICPngEncoder))
|
||||
+ check_png_format(stream, format);
|
||||
+ else if (IsEqualGUID(encoder, &CLSID_WICBmpEncoder))
|
||||
+ check_bmp_format(stream, format);
|
||||
+ else if (IsEqualGUID(encoder, &CLSID_WICTiffEncoder))
|
||||
+ check_tiff_format(stream, format);
|
||||
+ else
|
||||
+ ok(0, "unknown encoder %s\n", wine_dbgstr_guid(encoder));
|
||||
+
|
||||
+ hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
|
||||
+ ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
|
||||
+}
|
||||
+
|
||||
struct setting {
|
||||
const WCHAR *name;
|
||||
PROPBAG2_TYPE type;
|
||||
@@ -645,7 +789,7 @@ todo_wine
|
||||
|
||||
static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* clsid_encoder,
|
||||
const struct bitmap_data **dsts, const CLSID *clsid_decoder, WICRect *rc,
|
||||
- const struct setting *settings, const char *name)
|
||||
+ const struct setting *settings, const char *name, IWICPalette *palette)
|
||||
{
|
||||
HRESULT hr;
|
||||
IWICBitmapEncoder *encoder;
|
||||
@@ -674,9 +818,22 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
|
||||
if (hglobal && SUCCEEDED(hr))
|
||||
{
|
||||
+ if (palette)
|
||||
+ {
|
||||
+ hr = IWICBitmapEncoder_SetPalette(encoder, palette);
|
||||
+ ok(hr == WINCODEC_ERR_NOTINITIALIZED, "wrong error %#x (%s)\n", hr, name);
|
||||
+ }
|
||||
+
|
||||
hr = IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache);
|
||||
ok(SUCCEEDED(hr), "Initialize failed, hr=%x\n", hr);
|
||||
|
||||
+ if (palette)
|
||||
+ {
|
||||
+ hr = IWICBitmapEncoder_SetPalette(encoder, palette);
|
||||
+ ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "wrong error %#x\n", hr);
|
||||
+ hr = S_OK;
|
||||
+ }
|
||||
+
|
||||
i=0;
|
||||
while (SUCCEEDED(hr) && srcs[i])
|
||||
{
|
||||
@@ -710,13 +867,20 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
}
|
||||
}
|
||||
|
||||
+ if (palette)
|
||||
+ {
|
||||
+ hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
|
||||
+ ok(hr == WINCODEC_ERR_NOTINITIALIZED, "wrong error %#x\n", hr);
|
||||
+ }
|
||||
+
|
||||
hr = IWICBitmapFrameEncode_Initialize(frameencode, options);
|
||||
ok(SUCCEEDED(hr), "Initialize failed, hr=%x\n", hr);
|
||||
|
||||
memcpy(&pixelformat, srcs[i]->format, sizeof(GUID));
|
||||
hr = IWICBitmapFrameEncode_SetPixelFormat(frameencode, &pixelformat);
|
||||
ok(SUCCEEDED(hr), "SetPixelFormat failed, hr=%x\n", hr);
|
||||
- ok(IsEqualGUID(&pixelformat, srcs[i]->format), "SetPixelFormat changed the format\n");
|
||||
+ ok(IsEqualGUID(&pixelformat, dsts[i]->format), "SetPixelFormat changed the format to %s (%s)\n",
|
||||
+ wine_dbgstr_guid(&pixelformat), name);
|
||||
|
||||
hr = IWICBitmapFrameEncode_SetSize(frameencode, srcs[i]->width, srcs[i]->height);
|
||||
ok(SUCCEEDED(hr), "SetSize failed, hr=%x\n", hr);
|
||||
@@ -724,17 +888,42 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
if (IsEqualGUID(clsid_encoder, &CLSID_WICPngEncoder))
|
||||
test_set_frame_palette(frameencode);
|
||||
|
||||
+ if (palette)
|
||||
+ {
|
||||
+ WICColor colors[256];
|
||||
+
|
||||
+ hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
|
||||
+ ok(SUCCEEDED(hr), "SetPalette failed, hr=%x (%s)\n", hr, name);
|
||||
+
|
||||
+ /* trash the assigned palette */
|
||||
+ memset(colors, 0, sizeof(colors));
|
||||
+ hr = IWICPalette_InitializeCustom(palette, colors, 256);
|
||||
+ ok(hr == S_OK, "InitializeCustom error %#x\n", hr);
|
||||
+ }
|
||||
+
|
||||
hr = IWICBitmapFrameEncode_WriteSource(frameencode, &src_obj->IWICBitmapSource_iface, rc);
|
||||
if (rc && (rc->Width <= 0 || rc->Height <= 0))
|
||||
{
|
||||
/* WriteSource fails but WriteSource_Proxy succeeds. */
|
||||
- ok(hr == E_INVALIDARG, "WriteSource failed, hr=%x (%s)\n", hr, name);
|
||||
+ ok(hr == E_INVALIDARG, "WriteSource should fail, hr=%x (%s)\n", hr, name);
|
||||
hr = IWICBitmapFrameEncode_WriteSource_Proxy(frameencode, &src_obj->IWICBitmapSource_iface, rc);
|
||||
+ ok(SUCCEEDED(hr), "WriteSource_Proxy failed, %dx%d, hr=%x (%s)\n", rc->Width, rc->Height, hr, name);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (rc)
|
||||
+ ok(SUCCEEDED(hr), "WriteSource(%dx%d) failed, hr=%x (%s)\n", rc->Width, rc->Height, hr, name);
|
||||
+ else
|
||||
+ ok(hr == S_OK ||
|
||||
+ broken(hr == E_INVALIDARG && IsEqualGUID(clsid_encoder, &CLSID_WICBmpEncoder) && IsEqualGUID(srcs[i]->format, &GUID_WICPixelFormatBlackWhite)) /* XP */,
|
||||
+ "WriteSource(NULL) failed, hr=%x (%s)\n", hr, name);
|
||||
}
|
||||
- ok(SUCCEEDED(hr), "WriteSource failed, hr=%x (%s)\n", hr, name);
|
||||
|
||||
- hr = IWICBitmapFrameEncode_Commit(frameencode);
|
||||
- ok(SUCCEEDED(hr), "Commit failed, hr=%x\n", hr);
|
||||
+ if (SUCCEEDED(hr))
|
||||
+ {
|
||||
+ hr = IWICBitmapFrameEncode_Commit(frameencode);
|
||||
+ ok(SUCCEEDED(hr), "Commit failed, hr=%x (%s)\n", hr, name);
|
||||
+ }
|
||||
|
||||
IWICBitmapFrameEncode_Release(frameencode);
|
||||
IPropertyBag2_Release(options);
|
||||
@@ -756,6 +945,8 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
{
|
||||
hr = IWICBitmapEncoder_Commit(encoder);
|
||||
ok(SUCCEEDED(hr), "Commit failed, hr=%x\n", hr);
|
||||
+
|
||||
+ check_bitmap_format(stream, clsid_encoder, dsts[0]->format);
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
@@ -767,25 +958,105 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
+ IWICPalette *frame_palette;
|
||||
+
|
||||
+ hr = IWICImagingFactory_CreatePalette(factory, &frame_palette);
|
||||
+ ok(hr == S_OK, "CreatePalette error %#x\n", hr);
|
||||
+
|
||||
+ hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
|
||||
+ ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
|
||||
+
|
||||
hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnDemand);
|
||||
ok(SUCCEEDED(hr), "Initialize failed, hr=%x\n", hr);
|
||||
|
||||
+ hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
|
||||
+ ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
|
||||
+
|
||||
+ hr = S_OK;
|
||||
i=0;
|
||||
while (SUCCEEDED(hr) && dsts[i])
|
||||
{
|
||||
hr = IWICBitmapDecoder_GetFrame(decoder, i, &framedecode);
|
||||
- ok(SUCCEEDED(hr), "GetFrame failed, hr=%x\n", hr);
|
||||
+ ok(SUCCEEDED(hr), "GetFrame failed, hr=%x (%s)\n", hr, name);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
compare_bitmap_data(dsts[i], (IWICBitmapSource*)framedecode, name);
|
||||
|
||||
+ hr = IWICBitmapFrameDecode_CopyPalette(framedecode, frame_palette);
|
||||
+ if (winetest_debug > 1)
|
||||
+ trace("%s, bpp %d, %s, hr %#x\n", name, dsts[i]->bpp, wine_dbgstr_guid(dsts[i]->format), hr);
|
||||
+ if (dsts[i]->bpp > 8 || IsEqualGUID(dsts[i]->format, &GUID_WICPixelFormatBlackWhite))
|
||||
+ ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
|
||||
+ else
|
||||
+ {
|
||||
+ UINT count, ret;
|
||||
+ WICColor colors[256];
|
||||
+
|
||||
+ ok(hr == S_OK, "CopyPalette error %#x (%s)\n", hr, name);
|
||||
+
|
||||
+ count = 0;
|
||||
+ hr = IWICPalette_GetColorCount(frame_palette, &count);
|
||||
+ ok(hr == S_OK, "GetColorCount error %#x\n", hr);
|
||||
+
|
||||
+ memset(colors, 0, sizeof(colors));
|
||||
+ ret = 0;
|
||||
+ hr = IWICPalette_GetColors(frame_palette, count, colors, &ret);
|
||||
+ ok(hr == S_OK, "GetColors error %#x\n", hr);
|
||||
+ ok(ret == count, "expected %u, got %u\n", count, ret);
|
||||
+ if (IsEqualGUID(clsid_decoder, &CLSID_WICPngDecoder))
|
||||
+ {
|
||||
+ ok(count == 256 || count == 2 /* newer libpng versions */, "expected 256, got %u (%s)\n", count, name);
|
||||
+
|
||||
+ ok(colors[0] == 0x11111111, "got %08x (%s)\n", colors[0], name);
|
||||
+ ok(colors[1] == 0x22222222, "got %08x (%s)\n", colors[1], name);
|
||||
+ if (count > 2)
|
||||
+ {
|
||||
+ ok(colors[2] == 0x33333333, "got %08x (%s)\n", colors[2], name);
|
||||
+ ok(colors[3] == 0x44444444, "got %08x (%s)\n", colors[3], name);
|
||||
+ ok(colors[4] == 0x55555555, "got %08x (%s)\n", colors[4], name);
|
||||
+ ok(colors[5] == 0, "got %08x (%s)\n", colors[5], name);
|
||||
+ }
|
||||
+ }
|
||||
+ else if (IsEqualGUID(clsid_decoder, &CLSID_WICBmpDecoder) ||
|
||||
+ IsEqualGUID(clsid_decoder, &CLSID_WICTiffDecoder))
|
||||
+ {
|
||||
+ if (IsEqualGUID(dsts[i]->format, &GUID_WICPixelFormatBlackWhite) ||
|
||||
+ IsEqualGUID(dsts[i]->format, &GUID_WICPixelFormat8bppIndexed))
|
||||
+ {
|
||||
+ ok(count == 256, "expected 256, got %u (%s)\n", count, name);
|
||||
+
|
||||
+ ok(colors[0] == 0xff111111, "got %08x (%s)\n", colors[0], name);
|
||||
+ ok(colors[1] == 0xff222222, "got %08x (%s)\n", colors[1], name);
|
||||
+ ok(colors[2] == 0xff333333, "got %08x (%s)\n", colors[2], name);
|
||||
+ ok(colors[3] == 0xff444444, "got %08x (%s)\n", colors[3], name);
|
||||
+ ok(colors[4] == 0xff555555, "got %08x (%s)\n", colors[4], name);
|
||||
+ ok(colors[5] == 0xff000000, "got %08x (%s)\n", colors[5], name);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ ok(count == 2, "expected 2, got %u (%s)\n", count, name);
|
||||
+
|
||||
+ ok(colors[0] == 0xff111111, "got %08x (%s)\n", colors[0], name);
|
||||
+ ok(colors[1] == 0xff222222, "got %08x (%s)\n", colors[1], name);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ ok(count == 2, "expected 2, got %u (%s)\n", count, name);
|
||||
+
|
||||
+ ok(colors[0] == 0xff111111, "got %08x\n", colors[0]);
|
||||
+ ok(colors[1] == 0xff222222, "got %08x\n", colors[1]);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
IWICBitmapFrameDecode_Release(framedecode);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
+ IWICPalette_Release(frame_palette);
|
||||
IWICBitmapDecoder_Release(decoder);
|
||||
}
|
||||
|
||||
@@ -801,13 +1072,31 @@ static void test_encoder(const struct bitmap_data *src, const CLSID* clsid_encod
|
||||
{
|
||||
const struct bitmap_data *srcs[2];
|
||||
const struct bitmap_data *dsts[2];
|
||||
+ WICColor colors[256];
|
||||
+ IWICPalette *palette;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ hr = IWICImagingFactory_CreatePalette(factory, &palette);
|
||||
+ ok(hr == S_OK, "CreatePalette error %#x\n", hr);
|
||||
+
|
||||
+ memset(colors, 0, sizeof(colors));
|
||||
+ colors[0] = 0x11111111;
|
||||
+ colors[1] = 0x22222222;
|
||||
+ colors[2] = 0x33333333;
|
||||
+ colors[3] = 0x44444444;
|
||||
+ colors[4] = 0x55555555;
|
||||
+ /* TIFF decoder fails to decode a 8bpp frame if palette has less than 256 colors */
|
||||
+ hr = IWICPalette_InitializeCustom(palette, colors, 256);
|
||||
+ ok(hr == S_OK, "InitializeCustom error %#x\n", hr);
|
||||
|
||||
srcs[0] = src;
|
||||
srcs[1] = NULL;
|
||||
dsts[0] = dst;
|
||||
dsts[1] = NULL;
|
||||
|
||||
- test_multi_encoder(srcs, clsid_encoder, dsts, clsid_decoder, NULL, NULL, name);
|
||||
+ test_multi_encoder(srcs, clsid_encoder, dsts, clsid_decoder, NULL, NULL, name, palette);
|
||||
+
|
||||
+ IWICPalette_Release(palette);
|
||||
}
|
||||
|
||||
static void test_encoder_rects(void)
|
||||
@@ -826,20 +1115,20 @@ static void test_encoder_rects(void)
|
||||
rc.Width = 4;
|
||||
rc.Height = 2;
|
||||
|
||||
- test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects full");
|
||||
+ test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects full", NULL);
|
||||
|
||||
rc.Width = 0;
|
||||
- test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects width=0");
|
||||
+ test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects width=0", NULL);
|
||||
|
||||
rc.Width = -1;
|
||||
- test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects width=-1");
|
||||
+ test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects width=-1", NULL);
|
||||
|
||||
rc.Width = 4;
|
||||
rc.Height = 0;
|
||||
- test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects height=0");
|
||||
+ test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects height=0", NULL);
|
||||
|
||||
rc.Height = -1;
|
||||
- test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects height=-1");
|
||||
+ test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects height=-1", NULL);
|
||||
}
|
||||
|
||||
static const struct bitmap_data *multiple_frames[3] = {
|
||||
@@ -858,8 +1147,14 @@ static const struct setting png_interlace_settings[] = {
|
||||
|
||||
START_TEST(converter)
|
||||
{
|
||||
+ HRESULT hr;
|
||||
+
|
||||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
|
||||
+ hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
|
||||
+ &IID_IWICImagingFactory, (void **)&factory);
|
||||
+ ok(hr == S_OK, "failed to create factory: %#x\n", hr);
|
||||
+
|
||||
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);
|
||||
@@ -885,12 +1180,36 @@ START_TEST(converter)
|
||||
test_invalid_conversion();
|
||||
test_default_converter();
|
||||
|
||||
- test_encoder(&testdata_32bppBGR, &CLSID_WICBmpEncoder,
|
||||
- &testdata_32bppBGR, &CLSID_WICBmpDecoder, "BMP encoder 32bppBGR");
|
||||
-
|
||||
+ test_encoder(&testdata_BlackWhite, &CLSID_WICPngEncoder,
|
||||
+ &testdata_BlackWhite, &CLSID_WICPngDecoder, "PNG encoder BlackWhite");
|
||||
+ test_encoder(&testdata_1bppIndexed, &CLSID_WICPngEncoder,
|
||||
+ &testdata_1bppIndexed, &CLSID_WICPngDecoder, "PNG encoder 1bppIndexed");
|
||||
+ test_encoder(&testdata_8bppIndexed, &CLSID_WICPngEncoder,
|
||||
+ &testdata_8bppIndexed, &CLSID_WICPngDecoder, "PNG encoder 8bppIndexed");
|
||||
test_encoder(&testdata_24bppBGR, &CLSID_WICPngEncoder,
|
||||
&testdata_24bppBGR, &CLSID_WICPngDecoder, "PNG encoder 24bppBGR");
|
||||
|
||||
+if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in Wine */
|
||||
+{
|
||||
+ test_encoder(&testdata_BlackWhite, &CLSID_WICBmpEncoder,
|
||||
+ &testdata_1bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder BlackWhite");
|
||||
+ test_encoder(&testdata_1bppIndexed, &CLSID_WICBmpEncoder,
|
||||
+ &testdata_1bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder 1bppIndexed");
|
||||
+ test_encoder(&testdata_8bppIndexed, &CLSID_WICBmpEncoder,
|
||||
+ &testdata_8bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder 8bppIndexed");
|
||||
+}
|
||||
+ test_encoder(&testdata_32bppBGR, &CLSID_WICBmpEncoder,
|
||||
+ &testdata_32bppBGR, &CLSID_WICBmpDecoder, "BMP encoder 32bppBGR");
|
||||
+
|
||||
+ test_encoder(&testdata_BlackWhite, &CLSID_WICTiffEncoder,
|
||||
+ &testdata_BlackWhite, &CLSID_WICTiffDecoder, "TIFF encoder BlackWhite");
|
||||
+if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in Wine */
|
||||
+{
|
||||
+ test_encoder(&testdata_1bppIndexed, &CLSID_WICTiffEncoder,
|
||||
+ &testdata_1bppIndexed, &CLSID_WICTiffDecoder, "TIFF encoder 1bppIndexed");
|
||||
+ test_encoder(&testdata_8bppIndexed, &CLSID_WICTiffEncoder,
|
||||
+ &testdata_8bppIndexed, &CLSID_WICTiffDecoder, "TIFF encoder 8bppIndexed");
|
||||
+}
|
||||
test_encoder(&testdata_24bppBGR, &CLSID_WICTiffEncoder,
|
||||
&testdata_24bppBGR, &CLSID_WICTiffDecoder, "TIFF encoder 24bppBGR");
|
||||
|
||||
@@ -898,12 +1217,14 @@ START_TEST(converter)
|
||||
&testdata_24bppBGR, NULL, "JPEG encoder 24bppBGR");
|
||||
|
||||
test_multi_encoder(multiple_frames, &CLSID_WICTiffEncoder,
|
||||
- multiple_frames, &CLSID_WICTiffDecoder, NULL, NULL, "TIFF encoder multi-frame");
|
||||
+ multiple_frames, &CLSID_WICTiffDecoder, NULL, NULL, "TIFF encoder multi-frame", NULL);
|
||||
|
||||
test_encoder_rects();
|
||||
|
||||
test_multi_encoder(single_frame, &CLSID_WICPngEncoder,
|
||||
- single_frame, &CLSID_WICPngDecoder, NULL, png_interlace_settings, "PNG encoder interlaced");
|
||||
+ single_frame, &CLSID_WICPngDecoder, NULL, png_interlace_settings, "PNG encoder interlaced", NULL);
|
||||
+
|
||||
+ IWICImagingFactory_Release(factory);
|
||||
|
||||
CoUninitialize();
|
||||
}
|
||||
--
|
||||
2.13.1
|
||||
|
@ -47,7 +47,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
};
|
||||
|
||||
struct wined3d_cs_add_dirty_texture_region
|
||||
@@ -2252,6 +2255,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2254,6 +2257,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
unsigned int slice_pitch)
|
||||
{
|
||||
struct wined3d_cs_update_sub_resource *op;
|
||||
@ -101,7 +101,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP);
|
||||
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
|
||||
@@ -2265,8 +2315,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2267,8 +2317,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
wined3d_resource_acquire(resource);
|
||||
|
||||
cs->ops->submit(cs, WINED3D_CS_QUEUE_MAP);
|
||||
@ -112,7 +112,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP);
|
||||
}
|
||||
|
||||
@@ -2645,6 +2697,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2647,6 +2699,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_GENERATE_MIPS */ wined3d_cs_exec_generate_mips,
|
||||
};
|
||||
|
||||
@ -126,7 +126,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id)
|
||||
{
|
||||
if (size > (cs->data_size - cs->end))
|
||||
@@ -2698,6 +2757,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2700,6 +2759,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
|
||||
static const struct wined3d_cs_ops wined3d_cs_st_ops =
|
||||
{
|
||||
@ -136,7 +136,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
wined3d_cs_st_require_space,
|
||||
wined3d_cs_st_submit,
|
||||
wined3d_cs_st_finish,
|
||||
@@ -2731,6 +2793,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2733,6 +2795,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
wined3d_cs_queue_submit(&cs->queue[queue_id], cs);
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size_t size, struct wined3d_cs *cs)
|
||||
{
|
||||
size_t queue_size = ARRAY_SIZE(queue->data);
|
||||
@@ -2792,6 +2869,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
@@ -2794,6 +2871,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
return packet->data;
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id)
|
||||
{
|
||||
if (cs->thread_id == GetCurrentThreadId())
|
||||
@@ -2811,6 +2898,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2813,6 +2900,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
|
||||
static const struct wined3d_cs_ops wined3d_cs_mt_ops =
|
||||
{
|
||||
|
@ -1,28 +0,0 @@
|
||||
From de71bb993001835fd384ac3bbff386e03b240f89 Mon Sep 17 00:00:00 2001
|
||||
From: Matteo Bruni <mbruni@codeweavers.com>
|
||||
Date: Fri, 15 Sep 2017 15:12:22 +0200
|
||||
Subject: wined3d: Don't claim SYSMEM location to be current if memory was
|
||||
evicted.
|
||||
|
||||
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
|
||||
---
|
||||
dlls/wined3d/surface.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 608447f2cc1..f35d5df775d 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -3539,7 +3539,8 @@ static DWORD cpu_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
|
||||
ERR("Failed to blit.\n");
|
||||
wined3d_texture_load_location(dst_texture, dst_sub_resource_idx, context, dst_location);
|
||||
|
||||
- return dst_texture->resource.map_binding | dst_location;
|
||||
+ return dst_location | (dst_texture->sub_resources[dst_sub_resource_idx].locations
|
||||
+ & dst_texture->resource.map_binding);
|
||||
}
|
||||
|
||||
static const struct wined3d_blitter_ops cpu_blitter_ops =
|
||||
--
|
||||
2.14.1
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [43701] Don't claim SYSMEM location to be current if memory was evicted
|
@ -1 +1 @@
|
||||
Wine Staging 2.17
|
||||
Wine Staging 2.18 (unreleased)
|
||||
|
Loading…
Reference in New Issue
Block a user