Author: fireball Date: Tue Jan 18 17:03:28 2011 New Revision: 50424
URL: http://svn.reactos.org/svn/reactos?rev=50424&view=rev Log: - Substitute rcVcPort by a ptlDCOrig, like in trunk. - Pass window origin in a call to RosGdiSetWindow(), which fixes drawing broken in a previous commit.
Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c branches/arwinss/reactos/dll/win32/winent.drv/winent.h branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c branches/arwinss/reactos/subsystems/win32/win32k/gdi/misc.c branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c branches/arwinss/reactos/subsystems/win32/win32k/gre/font.c branches/arwinss/reactos/subsystems/win32/win32k/gre/lineto.c branches/arwinss/reactos/subsystems/win32/win32k/gre/rect.c branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c
Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winent... ============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -104,6 +104,8 @@ INT CDECL RosDrv_ExtEscape( PDC_ATTR pdcattr, INT escape, INT in_count, LPCVOID in_data, INT out_count, LPVOID out_data ) { + POINTL ptOrigin; + switch(escape) { case NTDRV_ESCAPE: @@ -117,8 +119,10 @@ const struct ntdrv_escape_set_drawable *data = in_data;
pdcattr->dc_rect = data->dc_rect; - - RosGdiSetWindow(pdcattr->hKernelDC, data->drawable, data->clip_children); + ptOrigin.x = data->drawable_rect.left; + ptOrigin.y = data->drawable_rect.top; + + RosGdiSetWindow(pdcattr->hKernelDC, data->drawable, data->clip_children, ptOrigin);
TRACE( "SET_DRAWABLE hdc %p dc_rect %s drawable_rect %s\n", pdcattr->hdc, wine_dbgstr_rect(&data->dc_rect), wine_dbgstr_rect(&data->drawable_rect) );
Modified: branches/arwinss/reactos/dll/win32/winent.drv/winent.h URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winent... ============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/winent.h [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/winent.h [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -60,7 +60,7 @@ struct ntdrv_escape_set_drawable { enum ntdrv_escape_codes code; /* escape code (NTDRV_SET_DRAWABLE) */ - SWM_WINDOW_ID drawable; + SWM_WINDOW_ID drawable; BOOL clip_children;/* ClipByChildren or IncludeInferiors */ RECT dc_rect; /* DC rectangle relative to drawable */ RECT drawable_rect;/* Drawable rectangle relative to screen */
Modified: branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/include/reactos/... ============================================================================== --- branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h [iso-8859-1] (original) +++ branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -100,7 +100,7 @@ int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd); COLORREF APIENTRY RosGdiSetTextColor( HDC physDev, COLORREF color ); -VOID APIENTRY RosGdiSetWindow( HDC physDev, SWM_WINDOW_ID Wid, BOOL clipChildren ); +VOID APIENTRY RosGdiSetWindow( HDC physDev, SWM_WINDOW_ID Wid, BOOL clipChildren, POINTL ptOrigin );
/* enum.c */ int APIENTRY RosGdiChoosePixelFormat(HDC physDev,
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -150,9 +150,8 @@ DPRINT("Creating a memory DC %x\n", hNewDC); pNewDC->dclevel.pSurface = SURFACE_ShareLockSurface(StockObjects[DEFAULT_BITMAP]);
- /* Set DC rectangles */ - pNewDC->rcVport.left = 0; pNewDC->rcVport.top = 0; - pNewDC->rcVport.right = 1; pNewDC->rcVport.bottom = 1; + /* Set DC origin */ + pNewDC->ptlDCOrig.x = 0; pNewDC->ptlDCOrig.y = 0;
pNewDC->pWindow = NULL; } @@ -161,11 +160,9 @@ DPRINT("Creating a display DC %x\n", hNewDC); pNewDC->dclevel.pSurface = SURFACE_ShareLockSurface(PrimarySurface.pSurface);
- /* Set DC rectangles */ - pNewDC->rcVport.left = 0; - pNewDC->rcVport.top = 0; - pNewDC->rcVport.right = PrimarySurface.gdiinfo.ulHorzRes; - pNewDC->rcVport.bottom = PrimarySurface.gdiinfo.ulVertRes; + /* Set DC origin */ + pNewDC->ptlDCOrig.x = 0; + pNewDC->ptlDCOrig.y = 0;
pNewDC->pWindow = &SwmRoot; } @@ -237,11 +234,9 @@ /* Select it */ pDC->dclevel.pSurface = pSurface;
- /* Set DC rectangles */ - pDC->rcVport.left = 0; - pDC->rcVport.top = 0; - pDC->rcVport.right = pSurface->SurfObj.sizlBitmap.cx; - pDC->rcVport.bottom = pSurface->SurfObj.sizlBitmap.cy; + /* Set DC origin */ + pDC->ptlDCOrig.x = 0; + pDC->ptlDCOrig.y = 0;
/* Update clipping to reflect changes in the surface */ RosGdiUpdateClipping(pDC, FALSE); @@ -593,14 +588,14 @@ for (i=0; i<count; i++) { RECTL_vOffsetRect(&pSafeRects[i], - pDC->rcVport.left, - pDC->rcVport.top); + pDC->ptlDCOrig.x, + pDC->ptlDCOrig.y); }
/* Offset bounding rect */ RECTL_vOffsetRect(&rcSafeBounds, - pDC->rcVport.left, - pDC->rcVport.top); + pDC->ptlDCOrig.x, + pDC->ptlDCOrig.y);
/* Delete old clipping region */ if (pDC->Clipping) @@ -668,7 +663,7 @@ return color; }
-VOID APIENTRY RosGdiSetWindow(HDC physDev, SWM_WINDOW_ID Wid, BOOL clipChildren) +VOID APIENTRY RosGdiSetWindow(HDC physDev, SWM_WINDOW_ID Wid, BOOL clipChildren, POINTL ptOrigin) { PDC pDC;
@@ -682,9 +677,10 @@ if (Wid) { pDC->pWindow = SwmGetWindowById(Wid); - RECTL_vSetRect(&pDC->rcVport, - pDC->pWindow->Window.left, pDC->pWindow->Window.top, - pDC->pWindow->Window.right, pDC->pWindow->Window.bottom); + //PDC->ptlDCOrig.x = pDC->pWindow->Window.left; + //PDC->ptlDCOrig.y = pDC->pWindow->Window.top + pDC->ptlDCOrig = ptOrigin; + DPRINT("hdc %x set window hwnd %x\n", physDev, pDC->pWindow->hwnd); } else
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/misc.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gdi/misc.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gdi/misc.c [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -24,10 +24,10 @@ pDC = DC_LockDc(physDev);
/* Add DC origin */ - left += pDC->rcVport.left; - top += pDC->rcVport.top; - right += pDC->rcVport.left; - bottom += pDC->rcVport.top; + left += pDC->ptlDCOrig.x; + top += pDC->ptlDCOrig.y; + right += pDC->ptlDCOrig.x; + bottom += pDC->ptlDCOrig.y;
GreEllipse(pDC, left, top, right, bottom);
@@ -60,8 +60,8 @@ }
/* Add DC origin */ - Pt.x = XStart + dc->rcVport.left; - Pt.y = YStart + dc->rcVport.top; + Pt.x = XStart + dc->ptlDCOrig.x; + Pt.y = YStart + dc->ptlDCOrig.y;
/* Call GRE routine */ Ret = GreFloodFill(dc, &Pt, Color, FillType); @@ -107,10 +107,10 @@ pt[1].x = x2; pt[1].y = y2;
/* Add DC origin */ - pt[0].x += pDC->rcVport.left; - pt[0].y += pDC->rcVport.top; - pt[1].x += pDC->rcVport.left; - pt[1].y += pDC->rcVport.top; + pt[0].x += pDC->ptlDCOrig.x; + pt[0].y += pDC->ptlDCOrig.y; + pt[1].x += pDC->ptlDCOrig.x; + pt[1].y += pDC->ptlDCOrig.y;
GreLineTo(&pDC->dclevel.pSurface->SurfObj, pDC->CombinedClip, @@ -135,14 +135,14 @@ pDC = DC_LockDc(physDev);
/* Add DC origin */ - left += pDC->rcVport.left; - top += pDC->rcVport.top; - right += pDC->rcVport.left; - bottom += pDC->rcVport.top; - xstart += pDC->rcVport.left; - ystart += pDC->rcVport.top; - xend += pDC->rcVport.left; - yend += pDC->rcVport.top; + left += pDC->ptlDCOrig.x; + top += pDC->ptlDCOrig.y; + right += pDC->ptlDCOrig.x; + bottom += pDC->ptlDCOrig.y; + xstart += pDC->ptlDCOrig.x; + ystart += pDC->ptlDCOrig.y; + xend += pDC->ptlDCOrig.x; + yend += pDC->ptlDCOrig.y;
GrepArc(pDC, left, top, right, bottom, xstart, ystart, xend, yend, arc);
@@ -207,8 +207,8 @@ }
/* Calculate bounding rect and offset points data */ - pPoints[0].x += pDC->rcVport.left; - pPoints[0].y += pDC->rcVport.top; + pPoints[0].x += pDC->ptlDCOrig.x; + pPoints[0].y += pDC->ptlDCOrig.y;
rcBound.left = pPoints[0].x; rcBound.right = pPoints[0].x; @@ -217,8 +217,8 @@
for (i=1; i<count; i++) { - pPoints[i].x += pDC->rcVport.left; - pPoints[i].y += pDC->rcVport.top; + pPoints[i].x += pDC->ptlDCOrig.x; + pPoints[i].y += pDC->ptlDCOrig.y;
rcBound.left = min(rcBound.left, pPoints[i].x); rcBound.right = max(rcBound.right, pPoints[i].x);
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -274,20 +274,14 @@ DestRect.right = XDest+WidthDst; DestRect.bottom = YDest+HeightDst;
- DestRect.left += pDest->rcVport.left; - DestRect.top += pDest->rcVport.top; - DestRect.right += pDest->rcVport.left; - DestRect.bottom += pDest->rcVport.top; + RECTL_vOffsetRect(&DestRect, pDest->ptlDCOrig.x, pDest->ptlDCOrig.y);
SrcRect.left = XSrc; SrcRect.top = YSrc; SrcRect.right = XSrc+WidthSrc; SrcRect.bottom = YSrc+HeightSrc;
- SrcRect.left += pSrc->rcVport.left; - SrcRect.top += pSrc->rcVport.top; - SrcRect.right += pSrc->rcVport.left; - SrcRect.bottom += pSrc->rcVport.top; + RECTL_vOffsetRect(&SrcRect, pSrc->ptlDCOrig.x, pSrc->ptlDCOrig.y);
/* Create the XLATEOBJ. */ EXLATEOBJ_vInitXlateFromDCs(&exlo, pSrc, pDest); @@ -324,18 +318,15 @@ DestRect.right = XDest+Width; DestRect.bottom = YDest+Height;
- DestRect.left += pDest->rcVport.left; - DestRect.top += pDest->rcVport.top; - DestRect.right += pDest->rcVport.left; - DestRect.bottom += pDest->rcVport.top; + RECTL_vOffsetRect(&DestRect, pDest->ptlDCOrig.x, pDest->ptlDCOrig.y);
SourcePoint.x = XSrc; SourcePoint.y = YSrc;
if (pSrc) { - SourcePoint.x += pSrc->rcVport.left; - SourcePoint.y += pSrc->rcVport.top; + SourcePoint.x += pSrc->ptlDCOrig.x; + SourcePoint.y += pSrc->ptlDCOrig.y; }
/* Create the XLATEOBJ. */ @@ -406,10 +397,7 @@ DestRect.bottom = YLeft + 1; }
- DestRect.left += pDC->rcVport.left; - DestRect.top += pDC->rcVport.top; - DestRect.right += pDC->rcVport.left; - DestRect.bottom += pDC->rcVport.top; + RECTL_vOffsetRect(&DestRect, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y);
BrushOrigin.x = pDC->dclevel.ptlBrushOrigin.x; BrushOrigin.y = pDC->dclevel.ptlBrushOrigin.y; @@ -469,10 +457,7 @@ DestRect.right = XOriginDest+WidthDest; DestRect.bottom = YOriginDest+HeightDest;
- DestRect.left += DCDest->rcVport.left; - DestRect.top += DCDest->rcVport.top; - DestRect.right += DCDest->rcVport.left; - DestRect.bottom += DCDest->rcVport.top; + RECTL_vOffsetRect(&DestRect, DCDest->ptlDCOrig.x, DCDest->ptlDCOrig.y);
SourceRect.left = XOriginSrc; SourceRect.top = YOriginSrc; @@ -480,12 +465,7 @@ SourceRect.bottom = YOriginSrc+HeightSrc;
if (UsesSource) - { - SourceRect.left += DCSrc->rcVport.left; - SourceRect.top += DCSrc->rcVport.top; - SourceRect.right += DCSrc->rcVport.left; - SourceRect.bottom += DCSrc->rcVport.top; - } + RECTL_vOffsetRect(&SourceRect, DCSrc->ptlDCOrig.x, DCSrc->ptlDCOrig.y);
BrushOrigin.x = DCDest->dclevel.ptlBrushOrigin.x; BrushOrigin.y = DCDest->dclevel.ptlBrushOrigin.y; @@ -1125,8 +1105,8 @@
rcDest.left = XDest; rcDest.top = YDest; - rcDest.left += pDC->rcVport.left; - rcDest.top += pDC->rcVport.top; + rcDest.left += pDC->ptlDCOrig.x; + rcDest.top += pDC->ptlDCOrig.y;
rcDest.right = rcDest.left + Width; rcDest.bottom = rcDest.top + Height;
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/font.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/font.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/font.c [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -225,8 +225,8 @@
for(idx = 0; idx < count; idx++) { sharp_glyph_fn(pDC, - pDC->rcVport.left + x + offset.x, - pDC->rcVport.top + y + offset.y, + pDC->ptlDCOrig.x + x + offset.x, + pDC->ptlDCOrig.y + y + offset.y, formatEntry->bitmaps[wstr[idx]], &formatEntry->gis[wstr[idx]], &pTextPen);
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/lineto.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/lineto.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/lineto.c [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -115,10 +115,10 @@ Mix = ROP2_TO_MIX(R2_COPYPEN);/*pdcattr->jROP2*/ for (i=0; i<count-1; i++) { - ptLine[0].x = ptPoints[i].x + pDC->rcVport.left; - ptLine[0].y = ptPoints[i].y + pDC->rcVport.top; - ptLine[1].x = ptPoints[i+1].x + pDC->rcVport.left; - ptLine[1].y = ptPoints[i+1].y + pDC->rcVport.top; + ptLine[0].x = ptPoints[i].x + pDC->ptlDCOrig.x; + ptLine[0].y = ptPoints[i].y + pDC->ptlDCOrig.y; + ptLine[1].x = ptPoints[i+1].x + pDC->ptlDCOrig.x; + ptLine[1].y = ptPoints[i+1].y + pDC->ptlDCOrig.y;
DestRect.left = min(ptLine[0].x, ptLine[1].x); DestRect.top = min(ptLine[0].y, ptLine[1].y);
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/rect.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/rect.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/rect.c [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -32,10 +32,10 @@ MIX Mix; POINTL BrushOrigin;
- DestRect.left = LeftRect + pDC->rcVport.left; - DestRect.right = RightRect + pDC->rcVport.left; - DestRect.top = TopRect + pDC->rcVport.top; - DestRect.bottom = BottomRect + pDC->rcVport.top; + DestRect.left = LeftRect + pDC->ptlDCOrig.x; + DestRect.right = RightRect + pDC->ptlDCOrig.x; + DestRect.top = TopRect + pDC->ptlDCOrig.y; + DestRect.bottom = BottomRect + pDC->ptlDCOrig.y;
BrushOrigin.x = pDC->dclevel.ptlBrushOrigin.x; BrushOrigin.y = pDC->dclevel.ptlBrushOrigin.y;
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -825,8 +825,8 @@ SURFOBJ *pso;
/* Offset coordinate by DC origin */ - x += pDC->rcVport.left; - y += pDC->rcVport.top; + x += pDC->ptlDCOrig.x; + y += pDC->ptlDCOrig.y;
/* If point is outside the combined clipping region - return error */ if (!RECTL_bPointInRect(&pDC->CombinedClip->rclBounds, x, y))
Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -31,8 +31,7 @@ EBRUSHOBJ eboFill; EBRUSHOBJ eboLine;
- /* Origins and extents */ - RECTL rcVport; + POINTL ptlDCOrig;
/* Combined clipping region */ struct region *Clipping;
Modified: branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c [iso-8859-1] Tue Jan 18 17:03:28 2011 @@ -627,10 +627,10 @@ if (SwmWin->Entry.Blink != &SwmWindows) { /* Create a whole screen region */ - rcScreen.left = 0; - rcScreen.top = 0; - rcScreen.right = pDC->rcVport.right; - rcScreen.bottom = pDC->rcVport.bottom; + rcScreen.left = SwmRoot.Window.left; + rcScreen.top = SwmRoot.Window.top; + rcScreen.right = SwmRoot.Window.right; + rcScreen.bottom = SwmRoot.Window.bottom;
/* Free user clipping, if any */ if (pDC->Clipping) free_region(pDC->Clipping);