Added patch to avoid extra conversion step BGR->RGB when converting 32bpp BGRA to 24bpp RGB.

This commit is contained in:
Sebastian Lackner
2016-08-31 15:39:12 +02:00
parent 6b709dc505
commit 6b3228a788
4 changed files with 102 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
From 964980631537fea41619e05d09f1d14cf663755c Mon Sep 17 00:00:00 2001
From f81f47092ea27fc5dbe08e89a0daea1c7bcbc0c4 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Mon, 7 Mar 2016 15:38:19 +0800
Subject: windowscodecs: Add support for 32bppGrayFloat format.
@@ -12,10 +12,10 @@ For bug 36517.
4 files changed, 94 insertions(+)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
index 11f04d9..79b0a4b 100644
index efe78d8..21301cb 100644
--- a/dlls/windowscodecs/converter.c
+++ b/dlls/windowscodecs/converter.c
@@ -50,6 +50,7 @@ enum pixelformat {
@@ -49,6 +49,7 @@ enum pixelformat {
format_16bppBGRA5551,
format_24bppBGR,
format_24bppRGB,
@@ -23,7 +23,7 @@ index 11f04d9..79b0a4b 100644
format_32bppBGR,
format_32bppBGRA,
format_32bppPBGRA,
@@ -994,6 +995,49 @@ static HRESULT copypixels_to_24bppRGB(struct FormatConverter *This, const WICRec
@@ -996,6 +997,49 @@ static HRESULT copypixels_to_24bppRGB(struct FormatConverter *This, const WICRec
}
}
@@ -73,7 +73,7 @@ index 11f04d9..79b0a4b 100644
static const struct pixelformatinfo supported_formats[] = {
{format_1bppIndexed, &GUID_WICPixelFormat1bppIndexed, NULL},
{format_2bppIndexed, &GUID_WICPixelFormat2bppIndexed, NULL},
@@ -1009,6 +1053,7 @@ static const struct pixelformatinfo supported_formats[] = {
@@ -1011,6 +1055,7 @@ static const struct pixelformatinfo supported_formats[] = {
{format_16bppBGRA5551, &GUID_WICPixelFormat16bppBGRA5551, NULL},
{format_24bppBGR, &GUID_WICPixelFormat24bppBGR, copypixels_to_24bppBGR},
{format_24bppRGB, &GUID_WICPixelFormat24bppRGB, copypixels_to_24bppRGB},
@@ -82,10 +82,10 @@ index 11f04d9..79b0a4b 100644
{format_32bppBGRA, &GUID_WICPixelFormat32bppBGRA, copypixels_to_32bppBGRA},
{format_32bppPBGRA, &GUID_WICPixelFormat32bppPBGRA, copypixels_to_32bppPBGRA},
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index ccb78b8..08aeb06 100644
index ff499e5..10a6c03 100644
--- a/dlls/windowscodecs/regsvr.c
+++ b/dlls/windowscodecs/regsvr.c
@@ -1454,6 +1454,7 @@ static GUID const * const converter_formats[] = {
@@ -1452,6 +1452,7 @@ static GUID const * const converter_formats[] = {
&GUID_WICPixelFormat32bppBGR,
&GUID_WICPixelFormat32bppBGRA,
&GUID_WICPixelFormat32bppPBGRA,
@@ -94,7 +94,7 @@ index ccb78b8..08aeb06 100644
&GUID_WICPixelFormat64bppRGBA,
&GUID_WICPixelFormat32bppCMYK,
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index 00ea483..6a5fc4f 100644
index c1599c5..1386a32 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -43,6 +43,11 @@ typedef struct BitmapTestSrc {
@@ -176,9 +176,9 @@ index 00ea483..6a5fc4f 100644
static void test_conversion(const struct bitmap_data *src, const struct bitmap_data *dst, const char *name, BOOL todo)
{
BitmapTestSrc *src_obj;
@@ -734,6 +778,9 @@ START_TEST(converter)
test_conversion(&testdata_32bppBGR, &testdata_24bppRGB, "32bppBGR -> 24bppRGB", FALSE);
@@ -735,6 +779,9 @@ START_TEST(converter)
test_conversion(&testdata_24bppRGB, &testdata_32bppBGR, "24bppRGB -> 32bppBGR", FALSE);
test_conversion(&testdata_32bppBGRA, &testdata_24bppRGB, "32bppBGRA -> 24bppRGB", FALSE);
+ test_conversion(&testdata_24bppRGB, &testdata_32bppGrayFloat, "24bppRGB -> 32bppGrayFloat", FALSE);
+ test_conversion(&testdata_32bppBGR, &testdata_32bppGrayFloat, "32bppBGR -> 32bppGrayFloat", FALSE);
@@ -199,5 +199,5 @@ index 639d925..83daba8 100644
cpp_quote("DEFINE_GUID(GUID_WICPixelFormat48bppRGB, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x15);")
cpp_quote("DEFINE_GUID(GUID_WICPixelFormat64bppRGBA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x16);")
--
2.7.1
2.9.0

View File

@@ -1 +1,2 @@
Fixes: [36517] Implement support for WICPixelFormat32bppGrayFloat
Depends: windowscodecs-copypixels_to_24bppRGB