Module: wine Branch: master Commit: af7b8efc94fa3f9db80ceb064e90fff5a16b708f URL: http://source.winehq.org/git/wine.git/?a=commit;h=af7b8efc94fa3f9db80ceb064e...
Author: Vincent Povirk vincent@codeweavers.com Date: Sun Mar 28 20:05:04 2010 -0500
gdiplus: Store a reference to the image in image graphics contexts.
---
dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/image.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index ca1cba6..fb2c1f5 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -112,6 +112,7 @@ struct GpGraphics{ HDC hdc; HWND hwnd; BOOL owndc; + GpImage *image; SmoothingMode smoothing; CompositingQuality compqual; InterpolationMode interpolation; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 1af73da..8736b23 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1946,6 +1946,7 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, GpGraphics **graphics) { HDC hdc; + GpStatus stat;
TRACE("%p %p\n", image, graphics);
@@ -1965,7 +1966,12 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, ((GpBitmap*)image)->hdc = hdc; }
- return GdipCreateFromHDC(hdc, graphics); + stat = GdipCreateFromHDC(hdc, graphics); + + if (stat == Ok) + (*graphics)->image = image; + + return stat; }
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)