Rebase against 5cc5b102c1b0a66aa63b66f43f2da9a1a9d15ab6

This commit is contained in:
Alistair Leslie-Hughes
2018-12-07 12:01:21 +11:00
parent c9b23fb803
commit 7a69c317fc
20 changed files with 66 additions and 1931 deletions

View File

@@ -1,15 +1,15 @@
From ff6282f297e67822ee0def394a677a4fdc0fa609 Mon Sep 17 00:00:00 2001
From 39d690bf0ea117214e76419876188c7277ae1749 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 26 Jan 2017 19:01:21 +0800
Subject: windowscodecs: Fix 32bppRGB to 32bppRGBA conversion.
Subject: [PATCH] windowscodecs: Fix 32bppRGB to 32bppRGBA conversion.
---
dlls/windowscodecs/converter.c | 2 ++
dlls/windowscodecs/tests/converter.c | 45 +++++++++++++++++++++++++++++++++++-
2 files changed, 46 insertions(+), 1 deletion(-)
dlls/windowscodecs/tests/converter.c | 43 ++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
index 519860d9065..1378c85bc2d 100644
index 47de603..d23c262 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 519860d9065..1378c85bc2d 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 1cafe90c734..17724d9ed01 100644
index 5480584..77db7e8 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -291,6 +291,21 @@ static BOOL compare_bits(const struct bitmap_data *expect, UINT buffersize, cons
@@ -258,6 +258,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,21 +48,20 @@ index 1cafe90c734..17724d9ed01 100644
return equal;
}
@@ -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};
@@ -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};
static const struct bitmap_data testdata_32bppBGR = {
&GUID_WICPixelFormat32bppBGR, 32, bits_32bppBGR, 32, 2, 96.0, 96.0};
&GUID_WICPixelFormat32bppBGR, 32, bits_32bppBGR, 4, 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, 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};
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};
static const struct bitmap_data testdata_32bppBGRA = {
&GUID_WICPixelFormat32bppBGRA, 32, bits_32bppBGRA, 32, 2, 96.0, 96.0};
&GUID_WICPixelFormat32bppBGRA, 32, bits_32bppBGRA, 4, 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 = {
@@ -84,16 +83,7 @@ index 1cafe90c734..17724d9ed01 100644
/* XP and 2003 use linear color conversion, later versions use sRGB gamma */
static const float bits_32bppGrayFloat_xp[] = {
@@ -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)
@@ -1684,6 +1721,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);
@@ -107,5 +97,5 @@ index 1cafe90c734..17724d9ed01 100644
test_conversion(&testdata_24bppBGR, &testdata_24bppBGR, "24bppBGR -> 24bppBGR", FALSE);
test_conversion(&testdata_24bppBGR, &testdata_24bppRGB, "24bppBGR -> 24bppRGB", FALSE);
--
2.11.0
1.9.1