[PATCH v2 04/21] dlls/gdiplus: Use FIXME_ONCE

David Kahurani k.kahurani at gmail.com
Mon Oct 18 07:58:03 CDT 2021


introduce FIXME_ONCE

Signed-off-by: David Kahurani <k.kahurani at gmail.com>
---
 dlls/gdiplus/graphics.c     | 26 +++++++-------------------
 dlls/gdiplus/graphicspath.c |  4 +---
 dlls/gdiplus/metafile.c     |  9 ++-------
 3 files changed, 10 insertions(+), 29 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 4a428c4..35e54fa 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1015,13 +1015,10 @@ static ARGB resample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT
     UINT height, GpPointF *point, GDIPCONST GpImageAttributes *attributes,
     InterpolationMode interpolation, PixelOffsetMode offset_mode)
 {
-    static int fixme;
-
     switch (interpolation)
     {
     default:
-        if (!fixme++)
-            FIXME("Unimplemented interpolation %i\n", interpolation);
+	 FIXME_ONCE("Unimplemented interpolation %i\n", interpolation);
         /* fall-through */
     case InterpolationModeBilinear:
     {
@@ -1409,30 +1406,22 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush,
 
         if (fill->focus.X != 0.0 || fill->focus.Y != 0.0)
         {
-            static int once;
-            if (!once++)
-                FIXME("path gradient focus not implemented\n");
+	     FIXME_ONCE("path gradient focus not implemented\n");
         }
 
         if (fill->gamma)
         {
-            static int once;
-            if (!once++)
-                FIXME("path gradient gamma correction not implemented\n");
+	     FIXME_ONCE("path gradient gamma correction not implemented\n");
         }
 
         if (fill->blendcount)
         {
-            static int once;
-            if (!once++)
-                FIXME("path gradient blend not implemented\n");
+	     FIXME_ONCE("path gradient blend not implemented\n");
         }
 
         if (fill->pblendcount)
         {
-            static int once;
-            if (!once++)
-                FIXME("path gradient preset blend not implemented\n");
+	     FIXME_ONCE("path gradient preset blend not implemented\n");
         }
 
         if (!transform_fixme_once)
@@ -4869,10 +4858,9 @@ GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
 
     if (graphics->image && graphics->image->type == ImageTypeBitmap)
     {
-        static int once;
         GpBitmap *bitmap = (GpBitmap *)graphics->image;
-        if (IsIndexedPixelFormat(bitmap->format) && !once++)
-            FIXME("(%p, %p): Passing color unmodified\n", graphics, argb);
+        if (IsIndexedPixelFormat(bitmap->format))
+            FIXME_ONCE("(%p, %p): Passing color unmodified\n", graphics, argb);
     }
 
     return Ok;
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index ce2666e..09c3a96 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -1860,9 +1860,7 @@ static void widen_joint(const GpPointF *p1, const GpPointF *p2, const GpPointF *
             }
             else if (pen->join == LineJoinMiter)
             {
-                static int once;
-                if (!once++)
-                    FIXME("should add a clipped corner\n");
+		 FIXME_ONCE("should add a clipped corner\n");
             }
             /* else fall-through */
         }
diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c
index d79c939..eecd199 100644
--- a/dlls/gdiplus/metafile.c
+++ b/dlls/gdiplus/metafile.c
@@ -5050,8 +5050,6 @@ GpStatus METAFILE_DrawDriverString(GpMetafile *metafile, GDIPCONST UINT16 *text,
 
     if (flags & DriverStringOptionsRealizedAdvance)
     {
-        static BOOL fixme_written = FALSE;
-
         /* Native never writes DriverStringOptionsRealizedAdvance. Instead,
            in the case of RealizedAdvance, each glyph position is computed
            and serialized.
@@ -5061,11 +5059,8 @@ GpStatus METAFILE_DrawDriverString(GpMetafile *metafile, GDIPCONST UINT16 *text,
            metafiles produced from GDI+ not setting this flag. Ideally we
            would also compute the position of each glyph here, serialize those
            values, and not set DriverStringOptionsRealizedAdvance. */
-        if (!fixme_written)
-        {
-            fixme_written = TRUE;
-            FIXME("serializing RealizedAdvance flag and single GlyphPos with padding\n");
-        }
+
+        FIXME_ONCE("serializing RealizedAdvance flag and single GlyphPos with padding\n");
 
         *((PointF*)cursor) = *positions;
     }
-- 
2.33.0




More information about the wine-devel mailing list