Andrew Eikum : gdiplus: Implement GdipSaveGraphics and GdipRestoreGraphics.
Alexandre Julliard
julliard at winehq.org
Wed Jul 8 14:35:55 CDT 2009
Module: wine
Branch: master
Commit: 1ef13941f6d80b4f1413f888cd753c8619ebaea4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1ef13941f6d80b4f1413f888cd753c8619ebaea4
Author: Andrew Eikum <andrew at brightnightgames.com>
Date: Tue Jul 7 22:30:49 2009 -0500
gdiplus: Implement GdipSaveGraphics and GdipRestoreGraphics.
---
dlls/gdiplus/graphics.c | 21 ++-------------------
dlls/gdiplus/tests/graphics.c | 24 ++++++++----------------
2 files changed, 10 insertions(+), 35 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 12f1e26..b59814e 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -3322,15 +3322,7 @@ GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics *graphics)
GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics *graphics, GraphicsState state)
{
- static int calls;
-
- if(!graphics)
- return InvalidParameter;
-
- if(!(calls++))
- FIXME("graphics state not implemented\n");
-
- return Ok;
+ return GdipEndContainer(graphics, state);
}
GpStatus WINGDIPAPI GdipRotateWorldTransform(GpGraphics *graphics, REAL angle,
@@ -3349,16 +3341,7 @@ GpStatus WINGDIPAPI GdipRotateWorldTransform(GpGraphics *graphics, REAL angle,
GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics *graphics, GraphicsState *state)
{
- static int calls;
-
- if(!graphics || !state)
- return InvalidParameter;
-
- if(!(calls++))
- FIXME("graphics state not implemented\n");
-
- *state = 0xdeadbeef;
- return Ok;
+ return GdipBeginContainer2(graphics, state);
}
GpStatus WINGDIPAPI GdipBeginContainer2(GpGraphics *graphics,
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c
index 23aa717..6fd49f7 100644
--- a/dlls/gdiplus/tests/graphics.c
+++ b/dlls/gdiplus/tests/graphics.c
@@ -137,8 +137,7 @@ static void test_save_restore(void)
stat = GdipRestoreGraphics(graphics1, state_a);
expect(Ok, stat);
GdipGetInterpolationMode(graphics1, &mode);
- todo_wine
- expect(InterpolationModeBilinear, mode);
+ expect(InterpolationModeBilinear, mode);
GdipDeleteGraphics(graphics1);
log_state(state_a, &state_log);
@@ -154,12 +153,10 @@ static void test_save_restore(void)
expect(Ok, stat);
GdipRestoreGraphics(graphics1, state_b);
GdipGetInterpolationMode(graphics1, &mode);
- todo_wine
- expect(InterpolationModeBicubic, mode);
+ expect(InterpolationModeBicubic, mode);
GdipRestoreGraphics(graphics1, state_a);
GdipGetInterpolationMode(graphics1, &mode);
- todo_wine
- expect(InterpolationModeBilinear, mode);
+ expect(InterpolationModeBilinear, mode);
GdipDeleteGraphics(graphics1);
log_state(state_a, &state_log);
@@ -176,16 +173,13 @@ static void test_save_restore(void)
GdipSetInterpolationMode(graphics1, InterpolationModeHighQualityBilinear);
GdipRestoreGraphics(graphics1, state_b);
GdipGetInterpolationMode(graphics1, &mode);
- todo_wine
- expect(InterpolationModeBicubic, mode);
+ expect(InterpolationModeBicubic, mode);
GdipRestoreGraphics(graphics1, state_c);
GdipGetInterpolationMode(graphics1, &mode);
- todo_wine
- expect(InterpolationModeBicubic, mode);
+ expect(InterpolationModeBicubic, mode);
GdipRestoreGraphics(graphics1, state_a);
GdipGetInterpolationMode(graphics1, &mode);
- todo_wine
- expect(InterpolationModeBilinear, mode);
+ expect(InterpolationModeBilinear, mode);
GdipDeleteGraphics(graphics1);
log_state(state_a, &state_log);
@@ -204,12 +198,10 @@ static void test_save_restore(void)
GdipSetInterpolationMode(graphics2, InterpolationModeNearestNeighbor);
GdipRestoreGraphics(graphics1, state_a);
GdipGetInterpolationMode(graphics1, &mode);
- todo_wine
- expect(InterpolationModeBilinear, mode);
+ expect(InterpolationModeBilinear, mode);
GdipRestoreGraphics(graphics2, state_b);
GdipGetInterpolationMode(graphics2, &mode);
- todo_wine
- expect(InterpolationModeBicubic, mode);
+ expect(InterpolationModeBicubic, mode);
GdipDeleteGraphics(graphics1);
GdipDeleteGraphics(graphics2);
More information about the wine-cvs
mailing list