Commit 728aaf29 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Add tests for the HDC's we get from bitmap objects.

parent 2a345f36
......@@ -2157,6 +2157,8 @@ static void test_fromMemoryBitmap(void)
GpGraphics *graphics = NULL;
GpBitmap *bitmap = NULL;
BYTE bits[48] = {0};
HDC hdc=NULL;
COLORREF color;
status = GdipCreateBitmapFromScan0(4, 4, 12, PixelFormat24bppRGB, bits, &bitmap);
expect(Ok, status);
......@@ -2172,6 +2174,50 @@ static void test_fromMemoryBitmap(void)
/* drawing writes to the memory provided */
todo_wine expect(0x68, bits[10]);
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status);
status = GdipGetDC(graphics, &hdc);
expect(Ok, status);
ok(hdc != NULL, "got NULL hdc\n");
color = GetPixel(hdc, 0, 0);
/* The HDC is write-only, and native fills with a solid color to figure out
* which pixels have changed. */
todo_wine expect(0x0c0b0d, color);
SetPixel(hdc, 0, 0, 0x797979);
SetPixel(hdc, 1, 0, 0x0c0b0d);
status = GdipReleaseDC(graphics, hdc);
expect(Ok, status);
GdipDeleteGraphics(graphics);
todo_wine expect(0x79, bits[0]);
todo_wine expect(0x68, bits[3]);
GdipDisposeImage((GpImage*)bitmap);
/* We get the same kind of write-only HDC for a "normal" bitmap */
status = GdipCreateBitmapFromScan0(4, 4, 12, PixelFormat24bppRGB, NULL, &bitmap);
expect(Ok, status);
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status);
status = GdipGetDC(graphics, &hdc);
expect(Ok, status);
ok(hdc != NULL, "got NULL hdc\n");
color = GetPixel(hdc, 0, 0);
todo_wine expect(0x0c0b0d, color);
status = GdipReleaseDC(graphics, hdc);
expect(Ok, status);
GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap);
}
......
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