From d808a5c8d6ea9baae32cb5977fc4b4e31517edc9 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Tue, 18 Aug 2009 14:10:55 -0500 Subject: [PATCH] gdiplus: add a test for drawing to application-provided memory --- dlls/gdiplus/tests/graphics.c | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 54d9b32..c95ffb5 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -1904,6 +1904,30 @@ static void test_GdipGetVisibleClipBounds(void) test_GdipGetVisibleClipBounds_window(); } +static void test_fromMemoryBitmap(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpBitmap *bitmap = NULL; + BYTE bits[48] = {0}; + + status = GdipCreateBitmapFromScan0(4, 4, 12, PixelFormat24bppRGB, bits, &bitmap); + expect(Ok, status); + + status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, status); + + status = GdipGraphicsClear(graphics, 0xff686868); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + + /* drawing writes to the memory provided */ + todo_wine expect(0x68, bits[10]); + + GdipDisposeImage((GpImage*)bitmap); +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -1938,6 +1962,7 @@ START_TEST(graphics) test_isempty(); test_clear(); test_textcontrast(); + test_fromMemoryBitmap(); GdiplusShutdown(gdiplusToken); } -- 1.5.4.3