Commit a16a4d97 authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

gdiplus: Start implementing CompositingModeSourceCopy.

parent 0bfb3826
......@@ -372,6 +372,9 @@ static GpStatus alpha_blend_bmp_pixels(GpGraphics *graphics, INT dst_x, INT dst_
{
GpBitmap *dst_bitmap = (GpBitmap*)graphics->image;
INT x, y;
CompositingMode comp_mode;
GdipGetCompositingMode(graphics, &comp_mode);
for (y=0; y<src_height; y++)
{
......@@ -380,14 +383,19 @@ static GpStatus alpha_blend_bmp_pixels(GpGraphics *graphics, INT dst_x, INT dst_
ARGB dst_color, src_color;
src_color = ((ARGB*)(src + src_stride * y))[x];
if (!(src_color & 0xff000000))
continue;
GdipBitmapGetPixel(dst_bitmap, x+dst_x, y+dst_y, &dst_color);
if (fmt & PixelFormatPAlpha)
GdipBitmapSetPixel(dst_bitmap, x+dst_x, y+dst_y, color_over_fgpremult(dst_color, src_color));
if (comp_mode == CompositingModeSourceCopy)
GdipBitmapSetPixel(dst_bitmap, x+dst_x, y+dst_y, src_color);
else
GdipBitmapSetPixel(dst_bitmap, x+dst_x, y+dst_y, color_over(dst_color, src_color));
{
if (!(src_color & 0xff000000))
continue;
GdipBitmapGetPixel(dst_bitmap, x+dst_x, y+dst_y, &dst_color);
if (fmt & PixelFormatPAlpha)
GdipBitmapSetPixel(dst_bitmap, x+dst_x, y+dst_y, color_over_fgpremult(dst_color, src_color));
else
GdipBitmapSetPixel(dst_bitmap, x+dst_x, y+dst_y, color_over(dst_color, src_color));
}
}
}
......
......@@ -4205,9 +4205,9 @@ static void test_DrawImage_SourceCopy(void)
status = GdipDrawImageI(graphics, u2.image, 0, 0);
expect(Ok, status);
todo_wine expect(0, dst_pixels[0]);
expect(0, dst_pixels[0]);
expect(0xffff0000, dst_pixels[1]);
todo_wine expect(0, dst_pixels[2]);
expect(0, dst_pixels[2]);
todo_wine expect(0, dst_pixels[3]);
status = GdipDeleteGraphics(graphics);
......
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