Dmitry Timoshkov : gdiplus: Round up when converting from 32-bit ARGB to PARGB.
Alexandre Julliard
julliard at winehq.org
Mon Feb 25 14:33:46 CST 2013
Module: wine
Branch: master
Commit: d23bfd8dfc74a1955a0270feaf07ccd7a23a723a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d23bfd8dfc74a1955a0270feaf07ccd7a23a723a
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Mon Feb 25 13:30:32 2013 +0800
gdiplus: Round up when converting from 32-bit ARGB to PARGB.
---
dlls/gdiplus/gdiplus.c | 6 +++---
dlls/gdiplus/tests/image.c | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c
index 1c016be..f199055 100644
--- a/dlls/gdiplus/gdiplus.c
+++ b/dlls/gdiplus/gdiplus.c
@@ -442,9 +442,9 @@ void convert_32bppARGB_to_32bppPARGB(UINT width, UINT height,
for (x=0; x<width; x++)
{
BYTE alpha=src[3];
- *dst++ = *src++ * alpha / 255;
- *dst++ = *src++ * alpha / 255;
- *dst++ = *src++ * alpha / 255;
+ *dst++ = (*src++ * alpha + 127) / 255;
+ *dst++ = (*src++ * alpha + 127) / 255;
+ *dst++ = (*src++ * alpha + 127) / 255;
*dst++ = *src++;
}
}
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index a075b42..feab70b 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -4129,7 +4129,6 @@ static void test_ARGB_conversion(void)
ok(data.Stride == 8, "expected 8, got %d\n", data.Stride);
ok(data.PixelFormat == PixelFormat32bppPARGB, "expected PixelFormat32bppPARGB, got %d\n", data.PixelFormat);
match = !memcmp(data.Scan0, pargb, sizeof(pargb));
-todo_wine
ok(match, "bits don't match\n");
if (!match)
{
More information about the wine-cvs
mailing list