From 075775a81b6036a466343f9b5d3c497bcf4a6d85 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 23 Apr 2012 13:12:05 -0500 Subject: [PATCH] gdiplus: Implement accessors for graphics rendering origin. --- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 5d5a92cde8..06dee29978 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -161,6 +161,7 @@ struct GpGraphics{ UINT textcontrast; /* not used yet. get/set only */ struct list containers; GraphicsContainer contid; /* last-issued container ID */ + INT origin_x, origin_y; /* For giving the caller an HDC when we technically can't: */ HBITMAP temp_hbitmap; int temp_hbitmap_width; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 084557940c..92bc27e786 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1976,6 +1976,7 @@ typedef struct _GraphicsContainerItem { UINT textcontrast; GpMatrix* worldtrans; GpRegion* clip; + INT origin_x, origin_y; } GraphicsContainerItem; static GpStatus init_container(GraphicsContainerItem** container, @@ -1997,6 +1998,8 @@ static GpStatus init_container(GraphicsContainerItem** container, (*container)->unit = graphics->unit; (*container)->textcontrast = graphics->textcontrast; (*container)->pixeloffset = graphics->pixeloffset; + (*container)->origin_x = graphics->origin_x; + (*container)->origin_y = graphics->origin_y; sts = GdipCloneMatrix(graphics->worldtrans, &(*container)->worldtrans); if(sts != Ok){ @@ -2055,6 +2058,8 @@ static GpStatus restore_container(GpGraphics* graphics, graphics->unit = container->unit; graphics->textcontrast = container->textcontrast; graphics->pixeloffset = container->pixeloffset; + graphics->origin_x = container->origin_x; + graphics->origin_y = container->origin_y; return Ok; } @@ -5499,23 +5504,28 @@ GpStatus WINGDIPAPI GdipSetRenderingOrigin(GpGraphics *graphics, INT x, INT y) TRACE("(%p,%i,%i)\n", graphics, x, y); if (!(calls++)) - FIXME("not implemented\n"); + FIXME("value is unused in rendering\n"); - return NotImplemented; + if (!graphics) + return InvalidParameter; + + graphics->origin_x = x; + graphics->origin_y = y; + + return Ok; } GpStatus WINGDIPAPI GdipGetRenderingOrigin(GpGraphics *graphics, INT *x, INT *y) { - static int calls; - TRACE("(%p,%p,%p)\n", graphics, x, y); - if (!(calls++)) - FIXME("not implemented\n"); + if (!graphics || !x || !y) + return InvalidParameter; - *x = *y = 0; + *x = graphics->origin_x; + *y = graphics->origin_y; - return NotImplemented; + return Ok; } GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mode)