0
0
mirror of https://gitlab.winehq.org/wine/wine-staging.git synced 2025-01-28 22:04:43 -08:00

Rebase against aaf9c833ee1b9dca8cffcb2a60c96093fdd36405

This commit is contained in:
Alistair Leslie-Hughes 2019-05-11 11:12:22 +10:00
parent 082a898ad4
commit 1308207a63
4 changed files with 10 additions and 85 deletions

@ -1,26 +1,26 @@
From c1554852648aa2a0f2629db4424604e9b6de5414 Mon Sep 17 00:00:00 2001
From 4f9c93a7a074b6adac59c53b20e52185ab04b121 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 23 Apr 2019 12:02:06 +1000
Subject: [PATCH 1/2] include: Add missing D3DKMT typedefs
Subject: [PATCH] include: Add missing D3DKMT typedefs
---
include/ddk/d3dkmthk.h | 437 +++++++++++++++++++++++++++++++++++++++++++++++++
include/ddk/d3dkmthk.h | 437 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 437 insertions(+)
diff --git a/include/ddk/d3dkmthk.h b/include/ddk/d3dkmthk.h
index 0000b2f..ab2af52 100644
index c87321058ca..fae18baed9a 100644
--- a/include/ddk/d3dkmthk.h
+++ b/include/ddk/d3dkmthk.h
@@ -21,6 +21,8 @@
#include <d3dukmdt.h>
@@ -136,6 +136,8 @@ typedef struct _D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP
D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
} D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP;
+#define D3DKMT_QUERYSTATISTICS_SEGMENT_PREFERENCE_MAX 5
+
typedef struct _D3DKMT_CLOSEADAPTER
{
D3DKMT_HANDLE hAdapter;
@@ -45,6 +47,441 @@ typedef struct _D3DKMT_DESTROYDCFROMMEMORY
@@ -160,6 +162,441 @@ typedef struct _D3DKMT_DESTROYDCFROMMEMORY
HANDLE hBitmap;
} D3DKMT_DESTROYDCFROMMEMORY;
@ -463,5 +463,5 @@ index 0000b2f..ab2af52 100644
extern "C"
{
--
1.9.1
2.20.1

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "9bcaf9769c5ae834f0f6e8fe2b28a85b286833b0"
echo "aaf9c833ee1b9dca8cffcb2a60c96093fdd36405"
}
# Show version information
@ -303,7 +303,6 @@ patch_enable_all ()
enable_windowscodecs_GIF_Encoder="$1"
enable_windowscodecs_IMILBitmapSource="$1"
enable_windowscodecs_TIFF_Support="$1"
enable_windowscodecs_png_network="$1"
enable_wine_inf_Directory_ContextMenuHandlers="$1"
enable_wine_inf_Dummy_CA_Certificate="$1"
enable_wine_inf_Performance="$1"
@ -1040,9 +1039,6 @@ patch_enable ()
windowscodecs-TIFF_Support)
enable_windowscodecs_TIFF_Support="$2"
;;
windowscodecs-png-network)
enable_windowscodecs_png_network="$2"
;;
wine.inf-Directory_ContextMenuHandlers)
enable_wine_inf_Directory_ContextMenuHandlers="$2"
;;
@ -6397,21 +6393,6 @@ if test "$enable_windowscodecs_TIFF_Support" -eq 1; then
) >> "$patchlist"
fi
# Patchset windowscodecs-png-network
# |
# | This patchset fixes the following Wine bugs:
# | * [#46558] windowscodecs: Byte swap png read/write for 16-bpp data.
# |
# | Modified files:
# | * dlls/windowscodecs/pngformat.c
# |
if test "$enable_windowscodecs_png_network" -eq 1; then
patch_apply windowscodecs-png-network/0001-windowscodecs-Byte-swap-png-read-write-for-16-bpp-da.patch
(
printf '%s\n' '+ { "Bryon Roche", "windowscodecs: Byte swap png read/write for 16-bpp data.", 1 },';
) >> "$patchlist"
fi
# Patchset wine.inf-Directory_ContextMenuHandlers
# |
# | This patchset fixes the following Wine bugs:

@ -1,55 +0,0 @@
From d52c018519697f040058ab1b58e9415baad477c5 Mon Sep 17 00:00:00 2001
From: Bryon Roche <kain@kain.org>
Date: Mon, 22 Apr 2019 19:30:13 +1000
Subject: [PATCH] windowscodecs: Byte swap png read/write for 16-bpp data.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46558
---
dlls/windowscodecs/pngformat.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index db0fa9ed50..a79e7e1cff 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -332,6 +332,7 @@ 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_set_swap);
MAKE_FUNCPTR(png_read_end);
MAKE_FUNCPTR(png_read_image);
MAKE_FUNCPTR(png_read_info);
@@ -398,6 +399,7 @@ static void *load_libpng(void)
LOAD_FUNCPTR(png_set_tRNS);
LOAD_FUNCPTR(png_set_tRNS_to_alpha);
LOAD_FUNCPTR(png_set_write_fn);
+ LOAD_FUNCPTR(png_set_swap);
LOAD_FUNCPTR(png_read_end);
LOAD_FUNCPTR(png_read_image);
LOAD_FUNCPTR(png_read_info);
@@ -642,6 +644,10 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
color_type = ppng_get_color_type(This->png_ptr, This->info_ptr);
bit_depth = ppng_get_bit_depth(This->png_ptr, This->info_ptr);
+ /* PNGs with bit-depth greater than 8 are network byte order. Windows does not expect this. */
+ if (bit_depth > 8)
+ ppng_set_swap(This->png_ptr);
+
/* check for color-keyed alpha */
transparency = ppng_get_tRNS(This->png_ptr, This->info_ptr, &trans, &num_trans, &trans_values);
@@ -1643,6 +1649,10 @@ static HRESULT WINAPI PngFrameEncode_WritePixels(IWICBitmapFrameEncode *iface,
}
}
+ /* Tell PNG we need to byte swap if writing a >8-bpp image */
+ if (This->format->bit_depth > 8)
+ ppng_set_swap(This->png_ptr);
+
ppng_set_IHDR(This->png_ptr, This->info_ptr, This->width, This->height,
This->format->bit_depth, This->format->color_type,
This->interlace ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE,
--
2.20.1

@ -1 +0,0 @@
Fixes: [46558] windowscodecs: Byte swap png read/write for 16-bpp data.