[PATCH] gdiplus: Make GdipGetNearestColor print FIXME only if indexed bitmap is associated with the graphics object.
Dmitry Timoshkov
dmitry at baikal.ru
Fri Feb 7 04:31:38 CST 2020
This avoids printing walls of FIXMEs running many .net graphics applications.
I've added quite a bit of tests for various bitmap formats associated with
the graphics object (manually created and created from GDI bitmaps, with and
without explicitly assigned palette, with different colors (with alpha 0-255)),
and GdipGetNearestColor() always returns unmodified color. So, it's better to
limit printing a FIXME only for graphics objects with an indexed bitmap.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
dlls/gdiplus/graphics.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index c52fa65445..8f3272b281 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -4775,7 +4775,7 @@ GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics *graphics,
/* FIXME: Need to handle color depths less than 24bpp */
GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
{
- FIXME("(%p, %p): Passing color unmodified\n", graphics, argb);
+ TRACE("(%p, %p)\n", graphics, argb);
if(!graphics || !argb)
return InvalidParameter;
@@ -4783,6 +4783,13 @@ GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
if(graphics->busy)
return ObjectBusy;
+ if (graphics->image->type == ImageTypeBitmap)
+ {
+ GpBitmap *bitmap = (GpBitmap *)graphics->image;
+ if (IsIndexedPixelFormat(bitmap->format))
+ FIXME("(%p, %p): Passing color unmodified\n", graphics, argb);
+ }
+
return Ok;
}
--
2.20.1
More information about the wine-devel
mailing list