Author: tkreuzer Date: Wed Jul 16 14:48:19 2008 New Revision: 34553
URL: http://svn.reactos.org/svn/reactos?rev=34553&view=rev Log: DC_AllocDc: - Set DC's iGraphicsMode to GM_COMPATIBLE when creating a DC NtGdiRectangle: - only exclude bottom/right pixels if dc is GM_COMPATIBLE - fix indentation
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/fillshap.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Wed Jul 16 14:48:19 2008 @@ -2485,6 +2485,7 @@ Dc_Attr->ulDirty_ = 0; // Server side
Dc_Attr->iMapMode = MM_TEXT; + Dc_Attr->iGraphicsMode = GM_COMPATIBLE;
Dc_Attr->szlWindowExt.cx = 1; // Float to Int,,, WRONG! Dc_Attr->szlWindowExt.cy = 1;
Modified: trunk/reactos/subsystems/win32/win32k/objects/fillshap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] Wed Jul 16 14:48:19 2008 @@ -556,91 +556,95 @@ return PATH_Rectangle ( dc, LeftRect, TopRect, RightRect, BottomRect ); }
- { - DestRect.left = LeftRect; - DestRect.right = RightRect; - DestRect.top = TopRect; - DestRect.bottom = BottomRect; - - IntLPtoDP(dc, (LPPOINT)&DestRect, 2); - - DestRect.left += dc->ptlDCOrig.x; - DestRect.right += dc->ptlDCOrig.x - 1; - DestRect.top += dc->ptlDCOrig.y; - DestRect.bottom += dc->ptlDCOrig.y - 1; - - /* Special locking order to avoid lock-ups! */ - FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush); - PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen); - if (!PenBrushObj) - { - ret = FALSE; - goto cleanup; - } - BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap); - if (!BitmapObj) - { - ret = FALSE; - goto cleanup; - } - - if ( FillBrushObj ) - { - if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL)) - { - IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush); - ret = IntEngBitBlt(&BitmapObj->SurfObj, - NULL, - NULL, - dc->CombinedClip, - NULL, - &DestRect, - NULL, - NULL, - &FillBrushInst.BrushObject, - NULL, - ROP3_TO_ROP4(PATCOPY)); - } - } - - IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen); - - // Draw the rectangle with the current pen - - ret = TRUE; // change default to success - - if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) - { - Mix = ROP2_TO_MIX(Dc_Attr->jROP2); - ret = ret && IntEngLineTo(&BitmapObj->SurfObj, - dc->CombinedClip, - &PenBrushInst.BrushObject, - DestRect.left, DestRect.top, DestRect.right, DestRect.top, - &DestRect, // Bounding rectangle - Mix); - - ret = ret && IntEngLineTo(&BitmapObj->SurfObj, - dc->CombinedClip, - &PenBrushInst.BrushObject, - DestRect.right, DestRect.top, DestRect.right, DestRect.bottom, - &DestRect, // Bounding rectangle - Mix); - - ret = ret && IntEngLineTo(&BitmapObj->SurfObj, - dc->CombinedClip, - &PenBrushInst.BrushObject, - DestRect.right, DestRect.bottom, DestRect.left, DestRect.bottom, - &DestRect, // Bounding rectangle - Mix); - - ret = ret && IntEngLineTo(&BitmapObj->SurfObj, - dc->CombinedClip, - &PenBrushInst.BrushObject, - DestRect.left, DestRect.bottom, DestRect.left, DestRect.top, - &DestRect, // Bounding rectangle - Mix); - } - + DestRect.left = LeftRect; + DestRect.right = RightRect; + DestRect.top = TopRect; + DestRect.bottom = BottomRect; + + IntLPtoDP(dc, (LPPOINT)&DestRect, 2); + + DestRect.left += dc->ptlDCOrig.x; + DestRect.right += dc->ptlDCOrig.x; + DestRect.top += dc->ptlDCOrig.y; + DestRect.bottom += dc->ptlDCOrig.y; + + /* In GM_COMPATIBLE, don't include bottom and right edges */ + if (IntGetGraphicsMode(dc) == GM_COMPATIBLE) + { + DestRect.right--; + DestRect.bottom--; + } + + /* Special locking order to avoid lock-ups! */ + FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush); + PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen); + if (!PenBrushObj) + { + ret = FALSE; + goto cleanup; + } + BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap); + if (!BitmapObj) + { + ret = FALSE; + goto cleanup; + } + + if ( FillBrushObj ) + { + if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL)) + { + IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush); + ret = IntEngBitBlt(&BitmapObj->SurfObj, + NULL, + NULL, + dc->CombinedClip, + NULL, + &DestRect, + NULL, + NULL, + &FillBrushInst.BrushObject, + NULL, + ROP3_TO_ROP4(PATCOPY)); + } + } + + IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen); + + // Draw the rectangle with the current pen + + ret = TRUE; // change default to success + + if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) + { + Mix = ROP2_TO_MIX(Dc_Attr->jROP2); + ret = ret && IntEngLineTo(&BitmapObj->SurfObj, + dc->CombinedClip, + &PenBrushInst.BrushObject, + DestRect.left, DestRect.top, DestRect.right, DestRect.top, + &DestRect, // Bounding rectangle + Mix); + + ret = ret && IntEngLineTo(&BitmapObj->SurfObj, + dc->CombinedClip, + &PenBrushInst.BrushObject, + DestRect.right, DestRect.top, DestRect.right, DestRect.bottom, + &DestRect, // Bounding rectangle + Mix); + + ret = ret && IntEngLineTo(&BitmapObj->SurfObj, + dc->CombinedClip, + &PenBrushInst.BrushObject, + DestRect.right, DestRect.bottom, DestRect.left, DestRect.bottom, + &DestRect, // Bounding rectangle + Mix); + + ret = ret && IntEngLineTo(&BitmapObj->SurfObj, + dc->CombinedClip, + &PenBrushInst.BrushObject, + DestRect.left, DestRect.bottom, DestRect.left, DestRect.top, + &DestRect, // Bounding rectangle + Mix); }
cleanup: