Dmitry Timoshkov : windowscodecs: Use predefined WICBitmapPaletteTypeFixedBW palette instead of a hand-made one .

Alexandre Julliard julliard at winehq.org
Mon Jul 16 14:14:29 CDT 2012


Module: wine
Branch: master
Commit: a0f9a251f94ef21b5af63d01f9120f30a71e8c22
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a0f9a251f94ef21b5af63d01f9120f30a71e8c22

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Mon Jul 16 14:54:32 2012 +0900

windowscodecs: Use predefined WICBitmapPaletteTypeFixedBW palette instead of a hand-made one.

---

 dlls/windowscodecs/converter.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
index 98e727e..6ee3a16 100644
--- a/dlls/windowscodecs/converter.c
+++ b/dlls/windowscodecs/converter.c
@@ -103,24 +103,19 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
             IWICPalette *palette;
             UINT actualcolors;
 
-            if (source_format == format_1bppIndexed)
-            {
-                res = PaletteImpl_Create(&palette);
-                if (FAILED(res)) return res;
+            res = PaletteImpl_Create(&palette);
+            if (FAILED(res)) return res;
 
+            if (source_format == format_1bppIndexed)
                 res = IWICBitmapSource_CopyPalette(This->source, palette);
-                if (SUCCEEDED(res))
-                    res = IWICPalette_GetColors(palette, 2, colors, &actualcolors);
+            else
+                res = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedBW, FALSE);
 
-                IWICPalette_Release(palette);
+            if (SUCCEEDED(res))
+                res = IWICPalette_GetColors(palette, 2, colors, &actualcolors);
 
-                if (FAILED(res)) return res;
-            }
-            else
-            {
-                colors[0] = 0xff000000;
-                colors[1] = 0xffffffff;
-            }
+            IWICPalette_Release(palette);
+            if (FAILED(res)) return res;
 
             srcstride = (prc->Width+7)/8;
             srcdatasize = srcstride * prc->Height;




More information about the wine-cvs mailing list