[PATCH 2/2] gdiplus: Basic implementation of GdipGetNearestColor with changes to test to reflect fixes [Try 5]

Justin Chevrier jchevrier at gmail.com
Thu Feb 25 20:45:55 CST 2010


---
 dlls/gdiplus/graphics.c       |    5 +++--
 dlls/gdiplus/tests/graphics.c |   22 +++++++++++-----------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 359b954..1fd870e 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -3173,9 +3173,10 @@ GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics *graphics,
     return Ok;
 }
 
+/* FIXME: Need to handle color depths less than 24bpp */
 GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
 {
-    FIXME("(%p, %p): stub\n", graphics, argb);
+    FIXME("(%p, %p): Passing color unmodified\n", graphics, argb);
 
     if(!graphics || !argb)
         return InvalidParameter;
@@ -3183,7 +3184,7 @@ GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
     if(graphics->busy)
         return ObjectBusy;
 
-    return NotImplemented;
+    return Ok;
 }
 
 GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics *graphics, REAL *scale)
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c
index 32d115e..b2dc9b2 100644
--- a/dlls/gdiplus/tests/graphics.c
+++ b/dlls/gdiplus/tests/graphics.c
@@ -2299,7 +2299,7 @@ static void test_GdipGetNearestColor(void)
     if (status == Ok)
     {
         status = GdipGetNearestColor(graphics, &color);
-        todo_wine expect(Ok, status);
+        expect(Ok, status);
         expect(0xdeadbeef, color);
         GdipDeleteGraphics(graphics);
     }
@@ -2312,7 +2312,7 @@ static void test_GdipGetNearestColor(void)
     if (status == Ok)
     {
         status = GdipGetNearestColor(graphics, &color);
-        todo_wine expect(Ok, status);
+        expect(Ok, status);
         expect(0xdeadbeef, color);
         GdipDeleteGraphics(graphics);
     }
@@ -2325,7 +2325,7 @@ static void test_GdipGetNearestColor(void)
     if (status == Ok)
     {
         status = GdipGetNearestColor(graphics, &color);
-        todo_wine expect(Ok, status);
+        expect(Ok, status);
         expect(0xdeadbeef, color);
         GdipDeleteGraphics(graphics);
     }
@@ -2344,7 +2344,7 @@ static void test_GdipGetNearestColor(void)
     status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
     expect(Ok, status);
     status = GdipGetNearestColor(graphics, &color);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     expect(0xdeadbeef, color);
     GdipDeleteGraphics(graphics);
     GdipDisposeImage((GpImage*)bitmap);
@@ -2354,7 +2354,7 @@ static void test_GdipGetNearestColor(void)
     status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
     expect(Ok, status);
     status = GdipGetNearestColor(graphics, &color);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     expect(0xdeadbeef, color);
     GdipDeleteGraphics(graphics);
     GdipDisposeImage((GpImage*)bitmap);
@@ -2364,7 +2364,7 @@ static void test_GdipGetNearestColor(void)
     status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
     expect(Ok, status);
     status = GdipGetNearestColor(graphics, &color);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     expect(0xdeadbeef, color);
     GdipDeleteGraphics(graphics);
     GdipDisposeImage((GpImage*)bitmap);
@@ -2374,7 +2374,7 @@ static void test_GdipGetNearestColor(void)
     status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
     expect(Ok, status);
     status = GdipGetNearestColor(graphics, &color);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     expect(0xdeadbeef, color);
     GdipDeleteGraphics(graphics);
     GdipDisposeImage((GpImage*)bitmap);
@@ -2384,7 +2384,7 @@ static void test_GdipGetNearestColor(void)
     status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
     expect(Ok, status);
     status = GdipGetNearestColor(graphics, &color);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     expect(0xdeadbeef, color);
     GdipDeleteGraphics(graphics);
     GdipDisposeImage((GpImage*)bitmap);
@@ -2394,7 +2394,7 @@ static void test_GdipGetNearestColor(void)
     status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
     expect(Ok, status);
     status = GdipGetNearestColor(graphics, &color);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     expect(0xdeadbeef, color);
     GdipDeleteGraphics(graphics);
     GdipDisposeImage((GpImage*)bitmap);
@@ -2404,7 +2404,7 @@ static void test_GdipGetNearestColor(void)
     status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
     expect(Ok, status);
     status = GdipGetNearestColor(graphics, &color);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     todo_wine expect(0xffa8bce8, color);
     GdipDeleteGraphics(graphics);
     GdipDisposeImage((GpImage*)bitmap);
@@ -2414,7 +2414,7 @@ static void test_GdipGetNearestColor(void)
     status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
     expect(Ok, status);
     status = GdipGetNearestColor(graphics, &color);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     todo_wine expect(0xffa8b8e8, color);
     GdipDeleteGraphics(graphics);
     GdipDisposeImage((GpImage*)bitmap);
-- 
1.6.5.rc1




More information about the wine-patches mailing list