Commit 3815add3 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Test getting/setting pixels of indexed color bitmaps.

parent 762845ca
...@@ -1133,6 +1133,7 @@ static void test_palette(void) ...@@ -1133,6 +1133,7 @@ static void test_palette(void)
INT size; INT size;
BYTE buffer[1040]; BYTE buffer[1040];
ColorPalette *palette=(ColorPalette*)buffer; ColorPalette *palette=(ColorPalette*)buffer;
ARGB color=0;
/* test initial palette from non-indexed bitmap */ /* test initial palette from non-indexed bitmap */
stat = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat32bppRGB, NULL, &bitmap); stat = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat32bppRGB, NULL, &bitmap);
...@@ -1178,6 +1179,22 @@ static void test_palette(void) ...@@ -1178,6 +1179,22 @@ static void test_palette(void)
expect(0xff000000, palette->Entries[0]); expect(0xff000000, palette->Entries[0]);
expect(0xffffffff, palette->Entries[1]); expect(0xffffffff, palette->Entries[1]);
/* test getting/setting pixels */
stat = GdipBitmapGetPixel(bitmap, 0, 0, &color);
todo_wine expect(Ok, stat);
todo_wine expect(0xff000000, color);
stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffffffff);
todo_wine ok((stat == Ok) ||
broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat);
if (stat == Ok)
{
stat = GdipBitmapGetPixel(bitmap, 0, 1, &color);
expect(Ok, stat);
expect(0xffffffff, color);
}
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
/* test initial palette on 4-bit bitmap */ /* test initial palette on 4-bit bitmap */
...@@ -1195,6 +1212,22 @@ static void test_palette(void) ...@@ -1195,6 +1212,22 @@ static void test_palette(void)
check_halftone_palette(palette); check_halftone_palette(palette);
/* test getting/setting pixels */
stat = GdipBitmapGetPixel(bitmap, 0, 0, &color);
todo_wine expect(Ok, stat);
todo_wine expect(0xff000000, color);
stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffff00ff);
todo_wine ok((stat == Ok) ||
broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat);
if (stat == Ok)
{
stat = GdipBitmapGetPixel(bitmap, 0, 1, &color);
expect(Ok, stat);
expect(0xffff00ff, color);
}
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
/* test initial palette on 8-bit bitmap */ /* test initial palette on 8-bit bitmap */
...@@ -1212,6 +1245,22 @@ static void test_palette(void) ...@@ -1212,6 +1245,22 @@ static void test_palette(void)
check_halftone_palette(palette); check_halftone_palette(palette);
/* test getting/setting pixels */
stat = GdipBitmapGetPixel(bitmap, 0, 0, &color);
todo_wine expect(Ok, stat);
todo_wine expect(0xff000000, color);
stat = GdipBitmapSetPixel(bitmap, 0, 1, 0xffcccccc);
todo_wine ok((stat == Ok) ||
broken(stat == InvalidParameter) /* pre-win7 */, "stat=%.8x\n", stat);
if (stat == Ok)
{
stat = GdipBitmapGetPixel(bitmap, 0, 1, &color);
expect(Ok, stat);
expect(0xffcccccc, color);
}
/* test setting/getting a different palette */ /* test setting/getting a different palette */
palette->Entries[1] = 0xffcccccc; palette->Entries[1] = 0xffcccccc;
......
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