Jacek Caban : gdi32: Use SetPixel for SetPixelV implementation.

Alexandre Julliard julliard at winehq.org
Fri Jul 23 18:08:01 CDT 2021


Module: wine
Branch: master
Commit: e7b9a16bc2d3beb457c219be7878cded46b738c2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e7b9a16bc2d3beb457c219be7878cded46b738c2

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jul 23 10:51:51 2021 +0200

gdi32: Use SetPixel for SetPixelV implementation.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/gdidc.c          |  8 ++++++++
 dlls/gdi32/painting.c       | 16 ----------------
 dlls/gdi32/tests/metafile.c |  1 -
 3 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c
index 0bfc48f3fcc..74280bc34b5 100644
--- a/dlls/gdi32/gdidc.c
+++ b/dlls/gdi32/gdidc.c
@@ -70,6 +70,14 @@ COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color )
     return NtGdiSetPixel( hdc, x, y, color );
 }
 
+/***********************************************************************
+ *           SetPixelV    (GDI32.@)
+ */
+BOOL WINAPI SetPixelV( HDC hdc, INT x, INT y, COLORREF color )
+{
+    return SetPixel( hdc, x, y, color ) != CLR_INVALID;
+}
+
 /***********************************************************************
  *           LineTo    (GDI32.@)
  */
diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c
index 1e03a2046d9..21c3c853998 100644
--- a/dlls/gdi32/painting.c
+++ b/dlls/gdi32/painting.c
@@ -415,22 +415,6 @@ COLORREF WINAPI NtGdiSetPixel( HDC hdc, INT x, INT y, COLORREF color )
     return ret;
 }
 
-/***********************************************************************
- *           SetPixelV    (GDI32.@)
- */
-BOOL WINAPI SetPixelV( HDC hdc, INT x, INT y, COLORREF color )
-{
-    PHYSDEV physdev;
-    DC * dc = get_dc_ptr( hdc );
-
-    if (!dc) return FALSE;
-    update_dc( dc );
-    physdev = GET_DC_PHYSDEV( dc, pSetPixel );
-    physdev->funcs->pSetPixel( physdev, x, y, color );
-    release_dc_ptr( dc );
-    return TRUE;
-}
-
 /***********************************************************************
  *           GetPixel    (GDI32.@)
  */
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index d310eb47fa2..5f626e83901 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -3231,7 +3231,6 @@ static void test_emf_SetPixel(void)
     ok(c == CLR_INVALID, "c = %x\n", c);
 
     ret = SetPixelV(hdc, 5, 5, RGB(1,2,3));
-    todo_wine
     ok(!ret, "ret = %x\n", ret);
 
     c = GetPixel(hdc, 5, 5);




More information about the wine-cvs mailing list