Commit 87f8e560 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: Pass complete palette info to convert_pixels().

parent a46c1f78
......@@ -120,7 +120,7 @@ extern void convert_32bppARGB_to_32bppPARGB(UINT width, UINT height,
extern GpStatus convert_pixels(INT width, INT height,
INT dst_stride, BYTE *dst_bits, PixelFormat dst_format,
INT src_stride, const BYTE *src_bits, PixelFormat src_format, ARGB *src_palette) DECLSPEC_HIDDEN;
INT src_stride, const BYTE *src_bits, PixelFormat src_format, ColorPalette *palette) DECLSPEC_HIDDEN;
struct GpPen{
UINT style;
......
......@@ -3274,7 +3274,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
convert_pixels(bitmap->width, bitmap->height,
bitmap->width*4, temp_bits, dst_format,
bitmap->stride, bitmap->bits, bitmap->format,
bitmap->image.palette ? bitmap->image.palette->Entries : NULL);
bitmap->image.palette);
}
else
{
......
......@@ -501,7 +501,8 @@ GpStatus WINGDIPAPI GdipBitmapSetPixel(GpBitmap* bitmap, INT x, INT y,
GpStatus convert_pixels(INT width, INT height,
INT dst_stride, BYTE *dst_bits, PixelFormat dst_format,
INT src_stride, const BYTE *src_bits, PixelFormat src_format, ARGB *src_palette)
INT src_stride, const BYTE *src_bits, PixelFormat src_format,
ColorPalette *palette)
{
INT x, y;
......@@ -518,9 +519,10 @@ GpStatus convert_pixels(INT width, INT height,
for (x=0; x<width; x++) \
for (y=0; y<height; y++) { \
BYTE index; \
BYTE *color; \
ARGB argb; \
BYTE *color = (BYTE *)&argb; \
getpixel_function(&index, src_bits+src_stride*y, x); \
color = (BYTE*)(&src_palette[index]); \
argb = (palette && index < palette->Count) ? palette->Entries[index] : 0; \
setpixel_function(color[2], color[1], color[0], color[3], dst_bits+dst_stride*y, x); \
} \
return Ok; \
......@@ -1012,7 +1014,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
lockeddata->Stride, lockeddata->Scan0, format,
bitmap->stride,
bitmap->bits + bitmap->stride * act_rect.Y + PIXELFORMATBPP(bitmap->format) * act_rect.X / 8,
bitmap->format, bitmap->image.palette ? bitmap->image.palette->Entries : NULL);
bitmap->format, bitmap->image.palette);
if (stat != Ok)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment