Author: jimtabor
Date: Sun May 14 01:00:27 2017
New Revision: 74543

URL: http://svn.reactos.org/svn/reactos?rev=74543&view=rev
Log:
[NtGDI]
- Implement internal functions for setting and retrieving DC origin. Related to 
CORE-13110.
- Code fix ups.

Modified:
    trunk/reactos/win32ss/gdi/ntgdi/coord.c
    trunk/reactos/win32ss/gdi/ntgdi/coord.h
    trunk/reactos/win32ss/gdi/ntgdi/dcutil.c

Modified: trunk/reactos/win32ss/gdi/ntgdi/coord.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/coord.c?rev=74543&r1=74542&r2=74543&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/coord.c     [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/coord.c     [iso-8859-1] Sun May 14 
01:00:27 2017
@@ -1337,6 +1337,56 @@
 
 BOOL
 WINAPI
+GreSetDCOrg(
+    _In_ HDC hdc,
+    _In_ LONG x,
+    _In_ LONG y,
+    _In_opt_ PRECTL Rect)
+{
+    PDC dc;
+
+    dc = DC_LockDc(hdc);
+    if (!dc) return FALSE;
+
+    /* Set DC Origin */
+    dc->ptlDCOrig.x = x;
+    dc->ptlDCOrig.y = y;
+
+    /* Recalculate Fill Origin */
+    dc->ptlFillOrigin.x = dc->dclevel.ptlBrushOrigin.x + x;
+    dc->ptlFillOrigin.y = dc->dclevel.ptlBrushOrigin.y + y;
+
+    /* Set DC Window Rectangle */
+    if (Rect)
+        dc->erclWindow = *Rect;
+
+    DC_UnlockDc(dc);
+    return TRUE;
+}
+
+BOOL
+WINAPI
+GreGetDCOrgEx(
+    _In_ HDC hdc,
+    _Out_ PPOINTL Point,
+    _Out_ PRECTL Rect)
+{
+    PDC dc;
+
+    dc = DC_LockDc(hdc);
+    if (!dc) return FALSE;
+
+    /* Retrieve DC Window Rectangle without a check */
+    *Rect = dc->erclWindow;
+
+    DC_UnlockDc(dc);
+
+    /* Use default call for DC Origin and parameter checking */
+    return GreGetDCPoint( hdc, GdiGetDCOrg, Point);
+}
+
+BOOL
+WINAPI
 GreGetWindowExtEx(
     _In_ HDC hdc,
     _Out_ LPSIZE lpSize)

Modified: trunk/reactos/win32ss/gdi/ntgdi/coord.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/coord.h?rev=74543&r1=74542&r2=74543&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/coord.h     [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/coord.h     [iso-8859-1] Sun May 14 
01:00:27 2017
@@ -166,3 +166,5 @@
 BOOL WINAPI GreGetWindowExtEx( _In_ HDC hdc, _Out_ LPSIZE lpSize);
 BOOL WINAPI GreGetViewportExtEx( _In_ HDC hdc, _Out_ LPSIZE lpSize);
 BOOL FASTCALL GreSetViewportOrgEx(HDC,int,int,LPPOINT);
+BOOL WINAPI GreGetDCOrgEx(_In_ HDC, _Out_ PPOINTL, _Out_ PRECTL);
+BOOL WINAPI GreSetDCOrg(_In_  HDC, _In_ LONG, _In_ LONG, _In_opt_ PRECTL);

Modified: trunk/reactos/win32ss/gdi/ntgdi/dcutil.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcutil.c?rev=74543&r1=74542&r2=74543&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dcutil.c    [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dcutil.c    [iso-8859-1] Sun May 14 
01:00:27 2017
@@ -396,8 +396,8 @@
         pdc->erclWindow = rclWnd;
         pdc->erclClip = rclClip;
         /* Might be an InitDC or DCE... */
-        pdc->ptlFillOrigin.x = pdc->dcattr.VisRectRegion.Rect.right;
-        pdc->ptlFillOrigin.y = pdc->dcattr.VisRectRegion.Rect.bottom;
+        pdc->ptlFillOrigin.x = pdc->dcattr.ptlBrushOrigin.x;
+        pdc->ptlFillOrigin.y = pdc->dcattr.ptlBrushOrigin.y;
         return TRUE;
     }
 


Reply via email to