Commit b4bfa6e1 authored by Justin Chevrier's avatar Justin Chevrier Committed by Alexandre Julliard

gdiplus: Basic implementation of GdipGetNearestColor with changes to test to reflect fixes.

parent 56238cd7
...@@ -3173,9 +3173,10 @@ GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics *graphics, ...@@ -3173,9 +3173,10 @@ GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics *graphics,
return Ok; return Ok;
} }
/* FIXME: Need to handle color depths less than 24bpp */
GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb) 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) if(!graphics || !argb)
return InvalidParameter; return InvalidParameter;
...@@ -3183,7 +3184,7 @@ GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb) ...@@ -3183,7 +3184,7 @@ GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
if(graphics->busy) if(graphics->busy)
return ObjectBusy; return ObjectBusy;
return NotImplemented; return Ok;
} }
GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics *graphics, REAL *scale) GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics *graphics, REAL *scale)
......
...@@ -2299,7 +2299,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2299,7 +2299,7 @@ static void test_GdipGetNearestColor(void)
if (status == Ok) if (status == Ok)
{ {
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
expect(0xdeadbeef, color); expect(0xdeadbeef, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
} }
...@@ -2312,7 +2312,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2312,7 +2312,7 @@ static void test_GdipGetNearestColor(void)
if (status == Ok) if (status == Ok)
{ {
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
expect(0xdeadbeef, color); expect(0xdeadbeef, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
} }
...@@ -2325,7 +2325,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2325,7 +2325,7 @@ static void test_GdipGetNearestColor(void)
if (status == Ok) if (status == Ok)
{ {
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
expect(0xdeadbeef, color); expect(0xdeadbeef, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
} }
...@@ -2344,7 +2344,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2344,7 +2344,7 @@ static void test_GdipGetNearestColor(void)
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status); expect(Ok, status);
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
expect(0xdeadbeef, color); expect(0xdeadbeef, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
...@@ -2354,7 +2354,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2354,7 +2354,7 @@ static void test_GdipGetNearestColor(void)
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status); expect(Ok, status);
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
expect(0xdeadbeef, color); expect(0xdeadbeef, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
...@@ -2364,7 +2364,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2364,7 +2364,7 @@ static void test_GdipGetNearestColor(void)
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status); expect(Ok, status);
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
expect(0xdeadbeef, color); expect(0xdeadbeef, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
...@@ -2374,7 +2374,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2374,7 +2374,7 @@ static void test_GdipGetNearestColor(void)
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status); expect(Ok, status);
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
expect(0xdeadbeef, color); expect(0xdeadbeef, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
...@@ -2384,7 +2384,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2384,7 +2384,7 @@ static void test_GdipGetNearestColor(void)
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status); expect(Ok, status);
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
expect(0xdeadbeef, color); expect(0xdeadbeef, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
...@@ -2394,7 +2394,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2394,7 +2394,7 @@ static void test_GdipGetNearestColor(void)
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status); expect(Ok, status);
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
expect(0xdeadbeef, color); expect(0xdeadbeef, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
...@@ -2404,7 +2404,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2404,7 +2404,7 @@ static void test_GdipGetNearestColor(void)
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status); expect(Ok, status);
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
todo_wine expect(0xffa8bce8, color); todo_wine expect(0xffa8bce8, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
...@@ -2414,7 +2414,7 @@ static void test_GdipGetNearestColor(void) ...@@ -2414,7 +2414,7 @@ static void test_GdipGetNearestColor(void)
status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, status); expect(Ok, status);
status = GdipGetNearestColor(graphics, &color); status = GdipGetNearestColor(graphics, &color);
todo_wine expect(Ok, status); expect(Ok, status);
todo_wine expect(0xffa8b8e8, color); todo_wine expect(0xffa8b8e8, color);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap); GdipDisposeImage((GpImage*)bitmap);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment