Jacek Caban : gdi32: Use DC_ATTR for SetBrushOrgEx implementation.

Alexandre Julliard julliard at winehq.org
Tue Aug 3 16:52:23 CDT 2021


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Aug  3 12:56:29 2021 +0200

gdi32: Use DC_ATTR for SetBrushOrgEx 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/brush.c | 43 -------------------------------------------
 dlls/gdi32/gdidc.c | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+), 43 deletions(-)

diff --git a/dlls/gdi32/brush.c b/dlls/gdi32/brush.c
index a59fee700ce..5febac710dc 100644
--- a/dlls/gdi32/brush.c
+++ b/dlls/gdi32/brush.c
@@ -370,49 +370,6 @@ HBRUSH WINAPI CreateSolidBrush( COLORREF color )
 }
 
 
-/***********************************************************************
- *           SetBrushOrgEx    (GDI32.@)
- *
- * Set the brush origin for a device context.
- *
- * PARAMS
- *  hdc    [I] Device context to set the brush origin for
- *  x      [I] New x origin
- *  y      [I] New y origin
- *  oldorg [O] If non NULL, destination for previously set brush origin.
- *
- * RETURNS
- *  Success: TRUE. The origin is set to (x,y), and oldorg is updated if given.
- */
-BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg )
-{
-    DC *dc = get_dc_ptr( hdc );
-
-    if (!dc) return FALSE;
-    if (oldorg)
-        *oldorg = dc->attr->brush_org;
-
-    dc->attr->brush_org.x = x;
-    dc->attr->brush_org.y = y;
-    release_dc_ptr( dc );
-    return TRUE;
-}
-
-/***********************************************************************
- *           FixBrushOrgEx    (GDI32.@)
- *
- * See SetBrushOrgEx.
- *
- * NOTES
- *  This function is no longer documented by MSDN, but in Win95 GDI32 it
- *  is the same as SetBrushOrgEx().
- */
-BOOL WINAPI FixBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg )
-{
-    return SetBrushOrgEx(hdc,x,y,oldorg);
-}
-
-
 /***********************************************************************
  *           NtGdiSelectBrush (win32u.@)
  */
diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c
index a0af23c169d..bc02beea429 100644
--- a/dlls/gdi32/gdidc.c
+++ b/dlls/gdi32/gdidc.c
@@ -341,6 +341,27 @@ BOOL WINAPI GetBrushOrgEx( HDC hdc, POINT *point )
     return TRUE;
 }
 
+/***********************************************************************
+ *           SetBrushOrgEx    (GDI32.@)
+ */
+BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, POINT *oldorg )
+{
+    DC_ATTR *dc_attr;
+    if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
+    if (oldorg) *oldorg = dc_attr->brush_org;
+    dc_attr->brush_org.x = x;
+    dc_attr->brush_org.y = y;
+    return TRUE;
+}
+
+/***********************************************************************
+ *           FixBrushOrgEx    (GDI32.@)
+ */
+BOOL WINAPI FixBrushOrgEx( HDC hdc, INT x, INT y, POINT *oldorg )
+{
+    return SetBrushOrgEx( hdc, x, y, oldorg );
+}
+
 /***********************************************************************
  *           GetDCOrgEx  (GDI32.@)
  */




More information about the wine-cvs mailing list