ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 2009
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
25 participants
476 discussions
Start a n
N
ew thread
[tkreuzer] 40451: Divide eng/bitblt.c into bitblt.c, alphablend.c and stretchblt.c. Remove EngIntersectRect and replace it with RECTL_bIntersectRect, which is changed to the code of EngIntersectRect, that was better.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Apr 11 03:53:09 2009 New Revision: 40451 URL:
http://svn.reactos.org/svn/reactos?rev=40451&view=rev
Log: Divide eng/bitblt.c into bitblt.c, alphablend.c and stretchblt.c. Remove EngIntersectRect and replace it with RECTL_bIntersectRect, which is changed to the code of EngIntersectRect, that was better. Added: trunk/reactos/subsystems/win32/win32k/eng/alphablend.c (with props) trunk/reactos/subsystems/win32/win32k/eng/stretchblt.c (with props) Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c trunk/reactos/subsystems/win32/win32k/eng/copybits.c trunk/reactos/subsystems/win32/win32k/eng/transblt.c trunk/reactos/subsystems/win32/win32k/objects/rect.c trunk/reactos/subsystems/win32/win32k/win32k.rbuild Added: trunk/reactos/subsystems/win32/win32k/eng/alphablend.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/alphablend.c (added) +++ trunk/reactos/subsystems/win32/win32k/eng/alphablend.c [iso-8859-1] Sat Apr 11 03:53:09 2009 @@ -1,0 +1,376 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: GDI alpha blending functions + * FILE: subsystems/win32/win32k/eng/alphablend.c + * PROGRAMER: Jason Filby + */ + +#include <w32k.h> + +#define NDEBUG +#include <debug.h> + + +/* + * @implemented + */ +BOOL +APIENTRY +EngAlphaBlend(IN SURFOBJ *psoDest, + IN SURFOBJ *psoSource, + IN CLIPOBJ *ClipRegion, + IN XLATEOBJ *ColorTranslation, + IN PRECTL DestRect, + IN PRECTL SourceRect, + IN BLENDOBJ *BlendObj) +{ + RECTL SourceStretchedRect; + SIZEL SourceStretchedSize; + HBITMAP SourceStretchedBitmap = 0; + SURFOBJ* SourceStretchedObj = NULL; + RECTL InputRect; + RECTL OutputRect; + RECTL ClipRect; + RECTL CombinedRect; + RECTL Rect; + POINTL Translate; + INTENG_ENTER_LEAVE EnterLeaveSource; + INTENG_ENTER_LEAVE EnterLeaveDest; + SURFOBJ* InputObj; + SURFOBJ* OutputObj; + LONG Width; + LONG ClippingType; + RECT_ENUM RectEnum; + BOOL EnumMore; + INT i; + BOOLEAN Ret; + + DPRINT("EngAlphaBlend(psoDest:0x%p, psoSource:0x%p, ClipRegion:0x%p, ColorTranslation:0x%p,\n", psoDest, psoSource, ClipRegion, ColorTranslation); + DPRINT(" DestRect:{0x%x, 0x%x, 0x%x, 0x%x}, SourceRect:{0x%x, 0x%x, 0x%x, 0x%x},\n", + DestRect->left, DestRect->top, DestRect->right, DestRect->bottom, + SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom); + DPRINT(" BlendObj:{0x%x, 0x%x, 0x%x, 0x%x}\n", BlendObj->BlendFunction.BlendOp, + BlendObj->BlendFunction.BlendFlags, BlendObj->BlendFunction.SourceConstantAlpha, + BlendObj->BlendFunction.AlphaFormat); + + + /* Validate output */ + OutputRect = *DestRect; + if (OutputRect.right < OutputRect.left) + { + OutputRect.left = DestRect->right; + OutputRect.right = DestRect->left; + } + if (OutputRect.bottom < OutputRect.top) + { + OutputRect.left = DestRect->right; + OutputRect.right = DestRect->left; + } + + + /* Validate input */ + + /* FIXME when WindowOrg.x or .y are negitve this check are not vaild, + * we need convert the inputRect to the windows org and do it right */ + InputRect = *SourceRect; + if ( (InputRect.top < 0) || (InputRect.bottom < 0) || + (InputRect.left < 0) || (InputRect.right < 0) ) + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (psoDest == psoSource && + !(OutputRect.left >= SourceRect->right || InputRect.left >= OutputRect.right || + OutputRect.top >= SourceRect->bottom || InputRect.top >= OutputRect.bottom)) + { + DPRINT1("Source and destination rectangles overlap!\n"); + return FALSE; + } + + if (BlendObj->BlendFunction.BlendOp != AC_SRC_OVER) + { + DPRINT1("BlendOp != AC_SRC_OVER (0x%x)\n", BlendObj->BlendFunction.BlendOp); + return FALSE; + } + if (BlendObj->BlendFunction.BlendFlags != 0) + { + DPRINT1("BlendFlags != 0 (0x%x)\n", BlendObj->BlendFunction.BlendFlags); + return FALSE; + } + if ((BlendObj->BlendFunction.AlphaFormat & ~AC_SRC_ALPHA) != 0) + { + DPRINT1("Unsupported AlphaFormat (0x%x)\n", BlendObj->BlendFunction.AlphaFormat); + return FALSE; + } + + /* Check if there is anything to draw */ + if (ClipRegion != NULL && + (ClipRegion->rclBounds.left >= ClipRegion->rclBounds.right || + ClipRegion->rclBounds.top >= ClipRegion->rclBounds.bottom)) + { + /* Nothing to do */ + return TRUE; + } + + /* Stretch source if needed */ + if (OutputRect.right - OutputRect.left != InputRect.right - InputRect.left || + OutputRect.bottom - OutputRect.top != InputRect.bottom - InputRect.top) + { + SourceStretchedSize.cx = OutputRect.right - OutputRect.left; + SourceStretchedSize.cy = OutputRect.bottom - OutputRect.top; + Width = DIB_GetDIBWidthBytes(SourceStretchedSize.cx, BitsPerFormat(psoSource->iBitmapFormat)); + /* FIXME: Maybe it is a good idea to use EngCreateDeviceBitmap and IntEngStretchBlt + if possible to get a HW accelerated stretch. */ + SourceStretchedBitmap = EngCreateBitmap(SourceStretchedSize, Width, psoSource->iBitmapFormat, + BMF_TOPDOWN | BMF_NOZEROINIT, NULL); + if (SourceStretchedBitmap == 0) + { + DPRINT1("EngCreateBitmap failed!\n"); + return FALSE; + } + SourceStretchedObj = EngLockSurface((HSURF)SourceStretchedBitmap); + if (SourceStretchedObj == NULL) + { + DPRINT1("EngLockSurface failed!\n"); + EngDeleteSurface((HSURF)SourceStretchedBitmap); + return FALSE; + } + + SourceStretchedRect.left = 0; + SourceStretchedRect.right = SourceStretchedSize.cx; + SourceStretchedRect.top = 0; + SourceStretchedRect.bottom = SourceStretchedSize.cy; + /* FIXME: IntEngStretchBlt isn't used here atm because it results in a + try to acquire an already acquired mutex (lock the already locked source surface) */ + /*if (!IntEngStretchBlt(SourceStretchedObj, psoSource, NULL, NULL, + NULL, &SourceStretchedRect, SourceRect, NULL, + NULL, NULL, COLORONCOLOR))*/ + if (!EngStretchBlt(SourceStretchedObj, psoSource, NULL, NULL, NULL, + NULL, NULL, &SourceStretchedRect, &InputRect, + NULL, COLORONCOLOR)) + { + DPRINT1("EngStretchBlt failed!\n"); + EngFreeMem(SourceStretchedObj->pvBits); + EngUnlockSurface(SourceStretchedObj); + EngDeleteSurface((HSURF)SourceStretchedBitmap); + return FALSE; + } + InputRect.top = SourceStretchedRect.top; + InputRect.bottom = SourceStretchedRect.bottom; + InputRect.left = SourceStretchedRect.left; + InputRect.right = SourceStretchedRect.right; + psoSource = SourceStretchedObj; + } + + /* Now call the DIB function */ + if (!IntEngEnter(&EnterLeaveSource, psoSource, &InputRect, TRUE, &Translate, &InputObj)) + { + if (SourceStretchedObj != NULL) + { + EngFreeMem(SourceStretchedObj->pvBits); + EngUnlockSurface(SourceStretchedObj); + } + if (SourceStretchedBitmap != 0) + { + EngDeleteSurface((HSURF)SourceStretchedBitmap); + } + return FALSE; + } + InputRect.left += Translate.x; + InputRect.right += Translate.x; + InputRect.top += Translate.y; + InputRect.bottom += Translate.y; + + if (!IntEngEnter(&EnterLeaveDest, psoDest, &OutputRect, FALSE, &Translate, &OutputObj)) + { + IntEngLeave(&EnterLeaveSource); + if (SourceStretchedObj != NULL) + { + EngFreeMem(SourceStretchedObj->pvBits); + EngUnlockSurface(SourceStretchedObj); + } + if (SourceStretchedBitmap != 0) + { + EngDeleteSurface((HSURF)SourceStretchedBitmap); + } + return FALSE; + } + OutputRect.left += Translate.x; + OutputRect.right += Translate.x; + OutputRect.top += Translate.y; + OutputRect.bottom += Translate.y; + + Ret = FALSE; + ClippingType = (ClipRegion == NULL) ? DC_TRIVIAL : ClipRegion->iDComplexity; + switch (ClippingType) + { + case DC_TRIVIAL: + Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend( + OutputObj, InputObj, &OutputRect, &InputRect, ClipRegion, ColorTranslation, BlendObj); + break; + + case DC_RECT: + ClipRect.left = ClipRegion->rclBounds.left + Translate.x; + ClipRect.right = ClipRegion->rclBounds.right + Translate.x; + ClipRect.top = ClipRegion->rclBounds.top + Translate.y; + ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y; + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + { + Rect.left = InputRect.left + CombinedRect.left - OutputRect.left; + Rect.right = InputRect.right + CombinedRect.right - OutputRect.right; + Rect.top = InputRect.top + CombinedRect.top - OutputRect.top; + Rect.bottom = InputRect.bottom + CombinedRect.bottom - OutputRect.bottom; + Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend( + OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj); + } + break; + + case DC_COMPLEX: + Ret = TRUE; + CLIPOBJ_cEnumStart(ClipRegion, FALSE, CT_RECTANGLES, CD_ANY, 0); + do + { + EnumMore = CLIPOBJ_bEnum(ClipRegion,(ULONG) sizeof(RectEnum), + (PVOID) &RectEnum); + + for (i = 0; i < RectEnum.c; i++) + { + ClipRect.left = RectEnum.arcl[i].left + Translate.x; + ClipRect.right = RectEnum.arcl[i].right + Translate.x; + ClipRect.top = RectEnum.arcl[i].top + Translate.y; + ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y; + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + { + Rect.left = InputRect.left + CombinedRect.left - OutputRect.left; + Rect.right = InputRect.right + CombinedRect.right - OutputRect.right; + Rect.top = InputRect.top + CombinedRect.top - OutputRect.top; + Rect.bottom = InputRect.bottom + CombinedRect.bottom - OutputRect.bottom; + Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend( + OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj) && Ret; + } + } + } + while (EnumMore); + break; + + default: + UNIMPLEMENTED; + ASSERT(FALSE); + break; + } + + IntEngLeave(&EnterLeaveDest); + IntEngLeave(&EnterLeaveSource); + + if (SourceStretchedObj != NULL) + { + EngFreeMem(SourceStretchedObj->pvBits); + EngUnlockSurface(SourceStretchedObj); + } + if (SourceStretchedBitmap != 0) + { + EngDeleteSurface((HSURF)SourceStretchedBitmap); + } + + return Ret; +} + +BOOL APIENTRY +IntEngAlphaBlend(IN SURFOBJ *psoDest, + IN SURFOBJ *psoSource, + IN CLIPOBJ *ClipRegion, + IN XLATEOBJ *ColorTranslation, + IN PRECTL DestRect, + IN PRECTL SourceRect, + IN BLENDOBJ *BlendObj) +{ + BOOL ret = FALSE; + SURFACE *psurfDest; + SURFACE *psurfSource; + + ASSERT(psoDest); + psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); + + ASSERT(psoSource); + psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj); + + ASSERT(DestRect); + ASSERT(SourceRect); + + /* Check if there is anything to draw */ + if (ClipRegion != NULL && + (ClipRegion->rclBounds.left >= ClipRegion->rclBounds.right || + ClipRegion->rclBounds.top >= ClipRegion->rclBounds.bottom)) + { + /* Nothing to do */ + return TRUE; + } + + SURFACE_LockBitmapBits(psurfDest); + MouseSafetyOnDrawStart(psoDest, DestRect->left, DestRect->top, + DestRect->right, DestRect->bottom); + + if (psoSource != psoDest) + SURFACE_LockBitmapBits(psurfSource); + MouseSafetyOnDrawStart(psoSource, SourceRect->left, SourceRect->top, + SourceRect->right, SourceRect->bottom); + + /* Call the driver's DrvAlphaBlend if available */ + if (psurfDest->flHooks & HOOK_ALPHABLEND) + { + ret = GDIDEVFUNCS(psoDest).AlphaBlend( + psoDest, psoSource, ClipRegion, ColorTranslation, + DestRect, SourceRect, BlendObj); + } + + if (! ret) + { + ret = EngAlphaBlend(psoDest, psoSource, ClipRegion, ColorTranslation, + DestRect, SourceRect, BlendObj); + } + + MouseSafetyOnDrawEnd(psoSource); + if (psoSource != psoDest) + SURFACE_UnlockBitmapBits(psurfSource); + MouseSafetyOnDrawEnd(psoDest); + SURFACE_UnlockBitmapBits(psurfDest); + + return ret; +} + +/* + * @implemented + */ +BOOL +APIENTRY +NtGdiEngAlphaBlend(IN SURFOBJ *psoDest, + IN SURFOBJ *psoSource, + IN CLIPOBJ *ClipRegion, + IN XLATEOBJ *ColorTranslation, + IN PRECTL upDestRect, + IN PRECTL upSourceRect, + IN BLENDOBJ *BlendObj) +{ + RECTL DestRect; + RECTL SourceRect; + + _SEH2_TRY + { + ProbeForRead(upDestRect, sizeof(RECTL), 1); + RtlCopyMemory(&DestRect,upDestRect, sizeof(RECTL)); + + ProbeForRead(upSourceRect, sizeof(RECTL), 1); + RtlCopyMemory(&SourceRect, upSourceRect, sizeof(RECTL)); + + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + _SEH2_YIELD(return FALSE); + } + _SEH2_END; + + return EngAlphaBlend(psoDest, psoSource, ClipRegion, ColorTranslation, &DestRect, &SourceRect, BlendObj); +} + Propchange: trunk/reactos/subsystems/win32/win32k/eng/alphablend.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] Sat Apr 11 03:53:09 2009 @@ -1,23 +1,4 @@ /* - * ReactOS W32 Subsystem - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * PURPOSE: GDI BitBlt Functions @@ -42,39 +23,6 @@ BRUSHOBJ* pbo, POINTL* BrushOrigin, ROP4 Rop4); -typedef BOOLEAN (APIENTRY *PSTRETCHRECTFUNC)(SURFOBJ* OutputObj, - SURFOBJ* InputObj, - SURFOBJ* Mask, - XLATEOBJ* ColorTranslation, - RECTL* OutputRect, - RECTL* InputRect, - POINTL* MaskOrigin, - BRUSHOBJ* pbo, - POINTL* BrushOrigin, - ROP4 Rop4); - -BOOL APIENTRY EngIntersectRect(RECTL* prcDst, RECTL* prcSrc1, RECTL* prcSrc2) -{ - static const RECTL rclEmpty = { 0, 0, 0, 0 }; - - prcDst->left = max(prcSrc1->left, prcSrc2->left); - prcDst->right = min(prcSrc1->right, prcSrc2->right); - - if (prcDst->left < prcDst->right) - { - prcDst->top = max(prcSrc1->top, prcSrc2->top); - prcDst->bottom = min(prcSrc1->bottom, prcSrc2->bottom); - - if (prcDst->top < prcDst->bottom) - { - return TRUE; - } - } - - *prcDst = rclEmpty; - - return FALSE; -} static BOOLEAN APIENTRY BltMask(SURFOBJ* psoDest, @@ -539,7 +487,7 @@ ClipRect.right = ClipRegion->rclBounds.right + Translate.x; ClipRect.top = ClipRegion->rclBounds.top + Translate.y; ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) { Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left; Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top; @@ -579,7 +527,7 @@ ClipRect.right = RectEnum.arcl[i].right + Translate.x; ClipRect.top = RectEnum.arcl[i].top + Translate.y; ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) { Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left; Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top; @@ -691,7 +639,7 @@ * outside the surface */ if (NULL != ClipRegion) { - if (! EngIntersectRect(&OutputRect, &InputClippedRect, + if (!RECTL_bIntersectRect(&OutputRect, &InputClippedRect, &ClipRegion->rclBounds)) { return TRUE; @@ -760,891 +708,6 @@ return ret; } -static BOOLEAN APIENTRY -CallDibStretchBlt(SURFOBJ* psoDest, - SURFOBJ* psoSource, - SURFOBJ* Mask, - XLATEOBJ* ColorTranslation, - RECTL* OutputRect, - RECTL* InputRect, - POINTL* MaskOrigin, - BRUSHOBJ* pbo, - POINTL* BrushOrigin, - ROP4 Rop4) -{ - POINTL RealBrushOrigin; - SURFACE* psurfPattern; - PEBRUSHOBJ GdiBrush = NULL; - SURFOBJ* PatternSurface = NULL; - XLATEOBJ* XlatePatternToDest = NULL; - - if (BrushOrigin == NULL) - { - RealBrushOrigin.x = RealBrushOrigin.y = 0; - } - else - { - RealBrushOrigin = *BrushOrigin; - } - - /* Pattern brush */ - if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF) - { - GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject); - psurfPattern = SURFACE_LockSurface(GdiBrush->pbrush->hbmPattern); - if (psurfPattern) - { - PatternSurface = &psurfPattern->SurfObj; - } - else - { - /* FIXME - What to do here? */ - } - XlatePatternToDest = GdiBrush->XlateObject; - } - else - { - psurfPattern = NULL; - } - - return DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_StretchBlt( - psoDest, psoSource, Mask, PatternSurface, - OutputRect, InputRect, MaskOrigin, pbo, &RealBrushOrigin, - ColorTranslation, XlatePatternToDest, Rop4); - - /* Pattern brush */ - if (psurfPattern) - { - SURFACE_UnlockSurface(psurfPattern); - } -} - - -BOOL -APIENTRY -NtGdiEngStretchBlt( - IN SURFOBJ *psoDest, - IN SURFOBJ *psoSource, - IN SURFOBJ *Mask, - IN CLIPOBJ *ClipRegion, - IN XLATEOBJ *ColorTranslation, - IN COLORADJUSTMENT *pca, - IN POINTL *BrushOrigin, - IN RECTL *prclDest, - IN RECTL *prclSrc, - IN POINTL *MaskOrigin, - IN ULONG Mode) -{ - COLORADJUSTMENT ca; - POINTL lBrushOrigin; - RECTL rclDest; - RECTL rclSrc; - POINTL lMaskOrigin; - - _SEH2_TRY - { - ProbeForRead(pca, sizeof(COLORADJUSTMENT), 1); - RtlCopyMemory(&ca,pca, sizeof(COLORADJUSTMENT)); - - ProbeForRead(BrushOrigin, sizeof(POINTL), 1); - RtlCopyMemory(&lBrushOrigin, BrushOrigin, sizeof(POINTL)); - - ProbeForRead(prclDest, sizeof(RECTL), 1); - RtlCopyMemory(&rclDest, prclDest, sizeof(RECTL)); - - ProbeForRead(prclSrc, sizeof(RECTL), 1); - RtlCopyMemory(&rclSrc, prclSrc, sizeof(RECTL)); - - ProbeForRead(MaskOrigin, sizeof(POINTL), 1); - RtlCopyMemory(&lMaskOrigin, MaskOrigin, sizeof(POINTL)); - - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - _SEH2_YIELD(return FALSE); - } - _SEH2_END; - - return EngStretchBlt(psoDest, psoSource, Mask, ClipRegion, ColorTranslation, &ca, &lBrushOrigin, &rclDest, &rclSrc, &lMaskOrigin, Mode); -} - -/* - * @implemented - */ -BOOL -APIENTRY -EngStretchBltROP( - IN SURFOBJ *psoDest, - IN SURFOBJ *psoSource, - IN SURFOBJ *Mask, - IN CLIPOBJ *ClipRegion, - IN XLATEOBJ *ColorTranslation, - IN COLORADJUSTMENT *pca, - IN POINTL *BrushOrigin, - IN RECTL *prclDest, - IN RECTL *prclSrc, - IN POINTL *MaskOrigin, - IN ULONG Mode, - IN BRUSHOBJ *pbo, - IN DWORD ROP4) -{ - RECTL InputRect; - RECTL OutputRect; - POINTL Translate; - INTENG_ENTER_LEAVE EnterLeaveSource; - INTENG_ENTER_LEAVE EnterLeaveDest; - SURFOBJ* psoInput; - SURFOBJ* psoOutput; - PSTRETCHRECTFUNC BltRectFunc; - BOOLEAN Ret = TRUE; - POINTL AdjustedBrushOrigin; - BOOL UsesSource = ROP4_USES_SOURCE(ROP4); - - BYTE clippingType; - RECTL ClipRect; - RECT_ENUM RectEnum; - BOOL EnumMore; - ULONG Direction; - RECTL CombinedRect; - RECTL InputToCombinedRect; - unsigned i; - - LONG DstHeight; - LONG DstWidth; - LONG SrcHeight; - LONG SrcWidth; - - /* Determine clipping type */ - if (ClipRegion == (CLIPOBJ *) NULL) - { - clippingType = DC_TRIVIAL; - } - else - { - clippingType = ClipRegion->iDComplexity; - } - - if (ROP4 == R4_NOOP) - { - /* Copy destination onto itself: nop */ - return TRUE; - } - - OutputRect = *prclDest; - if (OutputRect.right < OutputRect.left) - { - OutputRect.left = prclDest->right; - OutputRect.right = prclDest->left; - } - if (OutputRect.bottom < OutputRect.top) - { - OutputRect.top = prclDest->bottom; - OutputRect.bottom = prclDest->top; - } - - InputRect = *prclSrc; - if (UsesSource) - { - if (NULL == prclSrc) - { - return FALSE; - } - - if (! IntEngEnter(&EnterLeaveSource, psoSource, &InputRect, TRUE, - &Translate, &psoInput)) - { - return FALSE; - } - - InputRect.left += Translate.x; - InputRect.right += Translate.x; - InputRect.top += Translate.y; - InputRect.bottom += Translate.y; - } - - if (NULL != ClipRegion) - { - if (OutputRect.left < ClipRegion->rclBounds.left) - { - InputRect.left += ClipRegion->rclBounds.left - OutputRect.left; - OutputRect.left = ClipRegion->rclBounds.left; - } - if (ClipRegion->rclBounds.right < OutputRect.right) - { - InputRect.right -= OutputRect.right - ClipRegion->rclBounds.right; - OutputRect.right = ClipRegion->rclBounds.right; - } - if (OutputRect.top < ClipRegion->rclBounds.top) - { - InputRect.top += ClipRegion->rclBounds.top - OutputRect.top; - OutputRect.top = ClipRegion->rclBounds.top; - } - if (ClipRegion->rclBounds.bottom < OutputRect.bottom) - { - InputRect.bottom -= OutputRect.bottom - ClipRegion->rclBounds.bottom; - OutputRect.bottom = ClipRegion->rclBounds.bottom; - } - } - - /* Check for degenerate case: if height or width of OutputRect is 0 pixels there's - nothing to do */ - if (OutputRect.right <= OutputRect.left || OutputRect.bottom <= OutputRect.top) - { - if (UsesSource) - { - IntEngLeave(&EnterLeaveSource); - } - return TRUE; - } - - if (! IntEngEnter(&EnterLeaveDest, psoDest, &OutputRect, FALSE, &Translate, &psoOutput)) - { - if (UsesSource) - { - IntEngLeave(&EnterLeaveSource); - } - return FALSE; - } - - OutputRect.left += Translate.x; - OutputRect.right += Translate.x; - OutputRect.top += Translate.y; - OutputRect.bottom += Translate.y; - - if (BrushOrigin) - { - AdjustedBrushOrigin.x = BrushOrigin->x + Translate.x; - AdjustedBrushOrigin.y = BrushOrigin->y + Translate.y; - } - else - { - AdjustedBrushOrigin = Translate; - } - - BltRectFunc = CallDibStretchBlt; - - DstHeight = OutputRect.bottom - OutputRect.top; - DstWidth = OutputRect.right - OutputRect.left; - SrcHeight = InputRect.bottom - InputRect.top; - SrcWidth = InputRect.right - InputRect.left; - switch (clippingType) - { - case DC_TRIVIAL: - Ret = (*BltRectFunc)(psoOutput, psoInput, Mask, - ColorTranslation, &OutputRect, &InputRect, MaskOrigin, - pbo, &AdjustedBrushOrigin, ROP4); - break; - case DC_RECT: - // Clip the blt to the clip rectangle - ClipRect.left = ClipRegion->rclBounds.left + Translate.x; - ClipRect.right = ClipRegion->rclBounds.right + Translate.x; - ClipRect.top = ClipRegion->rclBounds.top + Translate.y; - ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) - { - InputToCombinedRect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * SrcHeight / DstHeight; - InputToCombinedRect.bottom = InputRect.top + (CombinedRect.bottom - OutputRect.top) * SrcHeight / DstHeight; - InputToCombinedRect.left = InputRect.left + (CombinedRect.left - OutputRect.left) * SrcWidth / DstWidth; - InputToCombinedRect.right = InputRect.left + (CombinedRect.right - OutputRect.left) * SrcWidth / DstWidth; - Ret = (*BltRectFunc)(psoOutput, psoInput, Mask, - ColorTranslation, - &CombinedRect, - &InputToCombinedRect, - MaskOrigin, - pbo, - &AdjustedBrushOrigin, - ROP4); - } - break; - case DC_COMPLEX: - if (psoOutput == psoInput) - { - if (OutputRect.top < InputRect.top) - { - Direction = OutputRect.left < InputRect.left ? - CD_RIGHTDOWN : CD_LEFTDOWN; - } - else - { - Direction = OutputRect.left < InputRect.left ? - CD_RIGHTUP : CD_LEFTUP; - } - } - else - { - Direction = CD_ANY; - } - CLIPOBJ_cEnumStart(ClipRegion, FALSE, CT_RECTANGLES, Direction, 0); - do - { - EnumMore = CLIPOBJ_bEnum(ClipRegion,(ULONG) sizeof(RectEnum), - (PVOID) &RectEnum); - for (i = 0; i < RectEnum.c; i++) - { - ClipRect.left = RectEnum.arcl[i].left + Translate.x; - ClipRect.right = RectEnum.arcl[i].right + Translate.x; - ClipRect.top = RectEnum.arcl[i].top + Translate.y; - ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) - { - InputToCombinedRect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * SrcHeight / DstHeight; - InputToCombinedRect.bottom = InputRect.top + (CombinedRect.bottom - OutputRect.top) * SrcHeight / DstHeight; - InputToCombinedRect.left = InputRect.left + (CombinedRect.left - OutputRect.left) * SrcWidth / DstWidth; - InputToCombinedRect.right = InputRect.left + (CombinedRect.right - OutputRect.left) * SrcWidth / DstWidth; - Ret = (*BltRectFunc)(psoOutput, psoInput, Mask, - ColorTranslation, - &CombinedRect, - &InputToCombinedRect, - MaskOrigin, - pbo, - &AdjustedBrushOrigin, - ROP4); - } - } - } - while (EnumMore); - break; - } - - IntEngLeave(&EnterLeaveDest); - if (UsesSource) - { - IntEngLeave(&EnterLeaveSource); - } - - return Ret; -} - -/* - * @implemented - */ -BOOL -APIENTRY -EngStretchBlt( - IN SURFOBJ *psoDest, - IN SURFOBJ *psoSource, - IN SURFOBJ *Mask, - IN CLIPOBJ *ClipRegion, - IN XLATEOBJ *ColorTranslation, - IN COLORADJUSTMENT *pca, - IN POINTL *BrushOrigin, - IN RECTL *prclDest, - IN RECTL *prclSrc, - IN POINTL *MaskOrigin, - IN ULONG Mode) -{ - return EngStretchBltROP( - psoDest, - psoSource, - Mask, - ClipRegion, - ColorTranslation, - pca, - BrushOrigin, - prclDest, - prclSrc, - MaskOrigin, - Mode, - NULL, - ROP3_TO_ROP4(SRCCOPY)); -} - -BOOL APIENTRY -IntEngStretchBlt(SURFOBJ *psoDest, - SURFOBJ *psoSource, - SURFOBJ *MaskSurf, - CLIPOBJ *ClipRegion, - XLATEOBJ *ColorTranslation, - RECTL *DestRect, - RECTL *SourceRect, - POINTL *pMaskOrigin, - BRUSHOBJ *pbo, - POINTL *BrushOrigin, - ROP4 ROP) -{ - BOOLEAN ret; - COLORADJUSTMENT ca; - POINT MaskOrigin; - SURFACE *psurfDest; - SURFACE *psurfSource = NULL; - RECTL InputClippedRect; - RECTL InputRect; - RECTL OutputRect; - BOOL UsesSource = ROP4_USES_SOURCE(ROP); - LONG InputClWidth, InputClHeight, InputWidth, InputHeight; - - ASSERT(psoDest); - psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); - ASSERT(psurfDest); - ASSERT(DestRect); - - InputClippedRect = *DestRect; - if (InputClippedRect.right < InputClippedRect.left) - { - InputClippedRect.left = DestRect->right; - InputClippedRect.right = DestRect->left; - } - if (InputClippedRect.bottom < InputClippedRect.top) - { - InputClippedRect.top = DestRect->bottom; - InputClippedRect.bottom = DestRect->top; - } - - if (UsesSource) - { - if (NULL == SourceRect || NULL == psoSource) - { - return FALSE; - } - InputRect = *SourceRect; - - if (InputRect.right < InputRect.left || - InputRect.bottom < InputRect.top) - { - /* Everything clipped away, nothing to do */ - return TRUE; - } - } - - if (ClipRegion) - { - if (! EngIntersectRect(&OutputRect, &InputClippedRect, - &ClipRegion->rclBounds)) - { - return TRUE; - } - /* Update source rect */ - InputClWidth = InputClippedRect.right - InputClippedRect.left; - InputClHeight = InputClippedRect.bottom - InputClippedRect.top; - InputWidth = InputRect.right - InputRect.left; - InputHeight = InputRect.bottom - InputRect.top; - - InputRect.left += (InputWidth * (OutputRect.left - InputClippedRect.left)) / InputClWidth; - InputRect.right -= (InputWidth * (InputClippedRect.right - OutputRect.right)) / InputClWidth; - InputRect.top += (InputHeight * (OutputRect.top - InputClippedRect.top)) / InputClHeight; - InputRect.bottom -= (InputHeight * (InputClippedRect.bottom - OutputRect.bottom)) / InputClHeight; - } - else - { - OutputRect = InputClippedRect; - } - - if (pMaskOrigin != NULL) - { - MaskOrigin.x = pMaskOrigin->x; MaskOrigin.y = pMaskOrigin->y; - } - - /* No success yet */ - ret = FALSE; - SURFACE_LockBitmapBits(psurfDest); - MouseSafetyOnDrawStart(psoDest, OutputRect.left, OutputRect.top, - OutputRect.right, OutputRect.bottom); - - if (UsesSource) - { - psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj); - if (psoSource != psoDest) - { - SURFACE_LockBitmapBits(psurfSource); - } - MouseSafetyOnDrawStart(psoSource, InputRect.left, InputRect.top, - InputRect.right, InputRect.bottom); - } - - /* Prepare color adjustment */ - - /* Call the driver's DrvStretchBlt if available */ - if (psurfDest->flHooks & HOOK_STRETCHBLTROP) - { - /* Drv->StretchBltROP (look at
http://www.osronline.com/ddkx/graphics/ddifncs_0z3b.htm
) */ - // FIXME: MaskOrigin is always NULL ! - ret = GDIDEVFUNCS(psoDest).StretchBltROP(psoDest, (UsesSource) ? psoSource : NULL, MaskSurf, ClipRegion, ColorTranslation, - &ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, pbo, ROP); - } - - if (! ret) - { - // FIXME: see previous fixme - ret = EngStretchBltROP(psoDest, (UsesSource) ? psoSource : NULL, MaskSurf, ClipRegion, ColorTranslation, - &ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, pbo, ROP); - } - - if (UsesSource) - { - MouseSafetyOnDrawEnd(psoSource); - if (psoSource != psoDest) - { - SURFACE_UnlockBitmapBits(psurfSource); - } - } - MouseSafetyOnDrawEnd(psoDest); - SURFACE_UnlockBitmapBits(psurfDest); - - return ret; -} - - -/* - * @implemented - */ -BOOL -APIENTRY -NtGdiEngAlphaBlend(IN SURFOBJ *psoDest, - IN SURFOBJ *psoSource, - IN CLIPOBJ *ClipRegion, - IN XLATEOBJ *ColorTranslation, - IN PRECTL upDestRect, - IN PRECTL upSourceRect, - IN BLENDOBJ *BlendObj) -{ - RECTL DestRect; - RECTL SourceRect; - - _SEH2_TRY - { - ProbeForRead(upDestRect, sizeof(RECTL), 1); - RtlCopyMemory(&DestRect,upDestRect, sizeof(RECTL)); - - ProbeForRead(upSourceRect, sizeof(RECTL), 1); - RtlCopyMemory(&SourceRect, upSourceRect, sizeof(RECTL)); - - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - _SEH2_YIELD(return FALSE); - } - _SEH2_END; - - return EngAlphaBlend(psoDest, psoSource, ClipRegion, ColorTranslation, &DestRect, &SourceRect, BlendObj); -} - -/* - * @implemented - */ -BOOL -APIENTRY -EngAlphaBlend(IN SURFOBJ *psoDest, - IN SURFOBJ *psoSource, - IN CLIPOBJ *ClipRegion, - IN XLATEOBJ *ColorTranslation, - IN PRECTL DestRect, - IN PRECTL SourceRect, - IN BLENDOBJ *BlendObj) -{ - RECTL SourceStretchedRect; - SIZEL SourceStretchedSize; - HBITMAP SourceStretchedBitmap = 0; - SURFOBJ* SourceStretchedObj = NULL; - RECTL InputRect; - RECTL OutputRect; - RECTL ClipRect; - RECTL CombinedRect; - RECTL Rect; - POINTL Translate; - INTENG_ENTER_LEAVE EnterLeaveSource; - INTENG_ENTER_LEAVE EnterLeaveDest; - SURFOBJ* InputObj; - SURFOBJ* OutputObj; - LONG Width; - LONG ClippingType; - RECT_ENUM RectEnum; - BOOL EnumMore; - INT i; - BOOLEAN Ret; - - DPRINT("EngAlphaBlend(psoDest:0x%p, psoSource:0x%p, ClipRegion:0x%p, ColorTranslation:0x%p,\n", psoDest, psoSource, ClipRegion, ColorTranslation); - DPRINT(" DestRect:{0x%x, 0x%x, 0x%x, 0x%x}, SourceRect:{0x%x, 0x%x, 0x%x, 0x%x},\n", - DestRect->left, DestRect->top, DestRect->right, DestRect->bottom, - SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom); - DPRINT(" BlendObj:{0x%x, 0x%x, 0x%x, 0x%x}\n", BlendObj->BlendFunction.BlendOp, - BlendObj->BlendFunction.BlendFlags, BlendObj->BlendFunction.SourceConstantAlpha, - BlendObj->BlendFunction.AlphaFormat); - - - /* Validate output */ - OutputRect = *DestRect; - if (OutputRect.right < OutputRect.left) - { - OutputRect.left = DestRect->right; - OutputRect.right = DestRect->left; - } - if (OutputRect.bottom < OutputRect.top) - { - OutputRect.left = DestRect->right; - OutputRect.right = DestRect->left; - } - - - /* Validate input */ - - /* FIXME when WindowOrg.x or .y are negitve this check are not vaild, - * we need convert the inputRect to the windows org and do it right */ - InputRect = *SourceRect; - if ( (InputRect.top < 0) || (InputRect.bottom < 0) || - (InputRect.left < 0) || (InputRect.right < 0) ) - { - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if (psoDest == psoSource && - !(OutputRect.left >= SourceRect->right || InputRect.left >= OutputRect.right || - OutputRect.top >= SourceRect->bottom || InputRect.top >= OutputRect.bottom)) - { - DPRINT1("Source and destination rectangles overlap!\n"); - return FALSE; - } - - if (BlendObj->BlendFunction.BlendOp != AC_SRC_OVER) - { - DPRINT1("BlendOp != AC_SRC_OVER (0x%x)\n", BlendObj->BlendFunction.BlendOp); - return FALSE; - } - if (BlendObj->BlendFunction.BlendFlags != 0) - { - DPRINT1("BlendFlags != 0 (0x%x)\n", BlendObj->BlendFunction.BlendFlags); - return FALSE; - } - if ((BlendObj->BlendFunction.AlphaFormat & ~AC_SRC_ALPHA) != 0) - { - DPRINT1("Unsupported AlphaFormat (0x%x)\n", BlendObj->BlendFunction.AlphaFormat); - return FALSE; - } - - /* Check if there is anything to draw */ - if (ClipRegion != NULL && - (ClipRegion->rclBounds.left >= ClipRegion->rclBounds.right || - ClipRegion->rclBounds.top >= ClipRegion->rclBounds.bottom)) - { - /* Nothing to do */ - return TRUE; - } - - /* Stretch source if needed */ - if (OutputRect.right - OutputRect.left != InputRect.right - InputRect.left || - OutputRect.bottom - OutputRect.top != InputRect.bottom - InputRect.top) - { - SourceStretchedSize.cx = OutputRect.right - OutputRect.left; - SourceStretchedSize.cy = OutputRect.bottom - OutputRect.top; - Width = DIB_GetDIBWidthBytes(SourceStretchedSize.cx, BitsPerFormat(psoSource->iBitmapFormat)); - /* FIXME: Maybe it is a good idea to use EngCreateDeviceBitmap and IntEngStretchBlt - if possible to get a HW accelerated stretch. */ - SourceStretchedBitmap = EngCreateBitmap(SourceStretchedSize, Width, psoSource->iBitmapFormat, - BMF_TOPDOWN | BMF_NOZEROINIT, NULL); - if (SourceStretchedBitmap == 0) - { - DPRINT1("EngCreateBitmap failed!\n"); - return FALSE; - } - SourceStretchedObj = EngLockSurface((HSURF)SourceStretchedBitmap); - if (SourceStretchedObj == NULL) - { - DPRINT1("EngLockSurface failed!\n"); - EngDeleteSurface((HSURF)SourceStretchedBitmap); - return FALSE; - } - - SourceStretchedRect.left = 0; - SourceStretchedRect.right = SourceStretchedSize.cx; - SourceStretchedRect.top = 0; - SourceStretchedRect.bottom = SourceStretchedSize.cy; - /* FIXME: IntEngStretchBlt isn't used here atm because it results in a - try to acquire an already acquired mutex (lock the already locked source surface) */ - /*if (!IntEngStretchBlt(SourceStretchedObj, psoSource, NULL, NULL, - NULL, &SourceStretchedRect, SourceRect, NULL, - NULL, NULL, COLORONCOLOR))*/ - if (!EngStretchBlt(SourceStretchedObj, psoSource, NULL, NULL, NULL, - NULL, NULL, &SourceStretchedRect, &InputRect, - NULL, COLORONCOLOR)) - { - DPRINT1("EngStretchBlt failed!\n"); - EngFreeMem(SourceStretchedObj->pvBits); - EngUnlockSurface(SourceStretchedObj); - EngDeleteSurface((HSURF)SourceStretchedBitmap); - return FALSE; - } - InputRect.top = SourceStretchedRect.top; - InputRect.bottom = SourceStretchedRect.bottom; - InputRect.left = SourceStretchedRect.left; - InputRect.right = SourceStretchedRect.right; - psoSource = SourceStretchedObj; - } - - /* Now call the DIB function */ - if (!IntEngEnter(&EnterLeaveSource, psoSource, &InputRect, TRUE, &Translate, &InputObj)) - { - if (SourceStretchedObj != NULL) - { - EngFreeMem(SourceStretchedObj->pvBits); - EngUnlockSurface(SourceStretchedObj); - } - if (SourceStretchedBitmap != 0) - { - EngDeleteSurface((HSURF)SourceStretchedBitmap); - } - return FALSE; - } - InputRect.left += Translate.x; - InputRect.right += Translate.x; - InputRect.top += Translate.y; - InputRect.bottom += Translate.y; - - if (!IntEngEnter(&EnterLeaveDest, psoDest, &OutputRect, FALSE, &Translate, &OutputObj)) - { - IntEngLeave(&EnterLeaveSource); - if (SourceStretchedObj != NULL) - { - EngFreeMem(SourceStretchedObj->pvBits); - EngUnlockSurface(SourceStretchedObj); - } - if (SourceStretchedBitmap != 0) - { - EngDeleteSurface((HSURF)SourceStretchedBitmap); - } - return FALSE; - } - OutputRect.left += Translate.x; - OutputRect.right += Translate.x; - OutputRect.top += Translate.y; - OutputRect.bottom += Translate.y; - - Ret = FALSE; - ClippingType = (ClipRegion == NULL) ? DC_TRIVIAL : ClipRegion->iDComplexity; - switch (ClippingType) - { - case DC_TRIVIAL: - Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend( - OutputObj, InputObj, &OutputRect, &InputRect, ClipRegion, ColorTranslation, BlendObj); - break; - - case DC_RECT: - ClipRect.left = ClipRegion->rclBounds.left + Translate.x; - ClipRect.right = ClipRegion->rclBounds.right + Translate.x; - ClipRect.top = ClipRegion->rclBounds.top + Translate.y; - ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) - { - Rect.left = InputRect.left + CombinedRect.left - OutputRect.left; - Rect.right = InputRect.right + CombinedRect.right - OutputRect.right; - Rect.top = InputRect.top + CombinedRect.top - OutputRect.top; - Rect.bottom = InputRect.bottom + CombinedRect.bottom - OutputRect.bottom; - Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend( - OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj); - } - break; - - case DC_COMPLEX: - Ret = TRUE; - CLIPOBJ_cEnumStart(ClipRegion, FALSE, CT_RECTANGLES, CD_ANY, 0); - do - { - EnumMore = CLIPOBJ_bEnum(ClipRegion,(ULONG) sizeof(RectEnum), - (PVOID) &RectEnum); - - for (i = 0; i < RectEnum.c; i++) - { - ClipRect.left = RectEnum.arcl[i].left + Translate.x; - ClipRect.right = RectEnum.arcl[i].right + Translate.x; - ClipRect.top = RectEnum.arcl[i].top + Translate.y; - ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) - { - Rect.left = InputRect.left + CombinedRect.left - OutputRect.left; - Rect.right = InputRect.right + CombinedRect.right - OutputRect.right; - Rect.top = InputRect.top + CombinedRect.top - OutputRect.top; - Rect.bottom = InputRect.bottom + CombinedRect.bottom - OutputRect.bottom; - Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend( - OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj) && Ret; - } - } - } - while (EnumMore); - break; - - default: - UNIMPLEMENTED; - ASSERT(FALSE); - break; - } - - IntEngLeave(&EnterLeaveDest); - IntEngLeave(&EnterLeaveSource); - - if (SourceStretchedObj != NULL) - { - EngFreeMem(SourceStretchedObj->pvBits); - EngUnlockSurface(SourceStretchedObj); - } - if (SourceStretchedBitmap != 0) - { - EngDeleteSurface((HSURF)SourceStretchedBitmap); - } - - return Ret; -} - -BOOL APIENTRY -IntEngAlphaBlend(IN SURFOBJ *psoDest, - IN SURFOBJ *psoSource, - IN CLIPOBJ *ClipRegion, - IN XLATEOBJ *ColorTranslation, - IN PRECTL DestRect, - IN PRECTL SourceRect, - IN BLENDOBJ *BlendObj) -{ - BOOL ret = FALSE; - SURFACE *psurfDest; - SURFACE *psurfSource; - - ASSERT(psoDest); - psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); - - ASSERT(psoSource); - psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj); - - ASSERT(DestRect); - ASSERT(SourceRect); - - /* Check if there is anything to draw */ - if (ClipRegion != NULL && - (ClipRegion->rclBounds.left >= ClipRegion->rclBounds.right || - ClipRegion->rclBounds.top >= ClipRegion->rclBounds.bottom)) - { - /* Nothing to do */ - return TRUE; - } - - SURFACE_LockBitmapBits(psurfDest); - MouseSafetyOnDrawStart(psoDest, DestRect->left, DestRect->top, - DestRect->right, DestRect->bottom); - - if (psoSource != psoDest) - SURFACE_LockBitmapBits(psurfSource); - MouseSafetyOnDrawStart(psoSource, SourceRect->left, SourceRect->top, - SourceRect->right, SourceRect->bottom); - - /* Call the driver's DrvAlphaBlend if available */ - if (psurfDest->flHooks & HOOK_ALPHABLEND) - { - ret = GDIDEVFUNCS(psoDest).AlphaBlend( - psoDest, psoSource, ClipRegion, ColorTranslation, - DestRect, SourceRect, BlendObj); - } - - if (! ret) - { - ret = EngAlphaBlend(psoDest, psoSource, ClipRegion, ColorTranslation, - DestRect, SourceRect, BlendObj); - } - - MouseSafetyOnDrawEnd(psoSource); - if (psoSource != psoDest) - SURFACE_UnlockBitmapBits(psurfSource); - MouseSafetyOnDrawEnd(psoDest); - SURFACE_UnlockBitmapBits(psurfDest); - - return ret; -} /**** REACTOS FONT RENDERING CODE *********************************************/ @@ -1849,7 +912,7 @@ ClipRect.right = ClipRegion->rclBounds.right + Translate.x; ClipRect.top = ClipRegion->rclBounds.top + Translate.y; ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) { Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left; Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top; @@ -1893,7 +956,7 @@ ClipRect.right = RectEnum.arcl[i].right + Translate.x; ClipRect.top = RectEnum.arcl[i].top + Translate.y; ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) { Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left; Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top; @@ -1953,7 +1016,7 @@ * outside the surface */ if (NULL != ClipRegion) { - if (! EngIntersectRect(&OutputRect, DestRect, &ClipRegion->rclBounds)) + if (!RECTL_bIntersectRect(&OutputRect, DestRect, &ClipRegion->rclBounds)) { return TRUE; } Modified: trunk/reactos/subsystems/win32/win32k/eng/copybits.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/copybits.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/copybits.c [iso-8859-1] Sat Apr 11 03:53:09 2009 @@ -155,7 +155,7 @@ case DC_RECT: // Clip the blt to the clip rectangle - EngIntersectRect(&BltInfo.DestRect, DestRect, &Clip->rclBounds); + RECTL_bIntersectRect(&BltInfo.DestRect, DestRect, &Clip->rclBounds); BltInfo.SourcePoint.x = SourcePoint->x + BltInfo.DestRect.left - DestRect->left; BltInfo.SourcePoint.y = SourcePoint->y + BltInfo.DestRect.top - DestRect->top; @@ -183,7 +183,7 @@ RECTL* prcl = &RectEnum.arcl[0]; do { - EngIntersectRect(&BltInfo.DestRect, prcl, DestRect); + RECTL_bIntersectRect(&BltInfo.DestRect, prcl, DestRect); BltInfo.SourcePoint.x = SourcePoint->x + prcl->left - DestRect->left; BltInfo.SourcePoint.y = SourcePoint->y + prcl->top - DestRect->top; Added: trunk/reactos/subsystems/win32/win32k/eng/stretchblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/stretchblt.c (added) +++ trunk/reactos/subsystems/win32/win32k/eng/stretchblt.c [iso-8859-1] Sat Apr 11 03:53:09 2009 @@ -1,0 +1,548 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: GDI stretch blt functions + * FILE: subsystems/win32/win32k/eng/stretchblt.c + * PROGRAMER: Jason Filby + */ + +#include <w32k.h> + +#define NDEBUG +#include <debug.h> + +typedef BOOLEAN (APIENTRY *PSTRETCHRECTFUNC)(SURFOBJ* OutputObj, + SURFOBJ* InputObj, + SURFOBJ* Mask, + XLATEOBJ* ColorTranslation, + RECTL* OutputRect, + RECTL* InputRect, + POINTL* MaskOrigin, + BRUSHOBJ* pbo, + POINTL* BrushOrigin, + ROP4 Rop4); + +static BOOLEAN APIENTRY +CallDibStretchBlt(SURFOBJ* psoDest, + SURFOBJ* psoSource, + SURFOBJ* Mask, + XLATEOBJ* ColorTranslation, + RECTL* OutputRect, + RECTL* InputRect, + POINTL* MaskOrigin, + BRUSHOBJ* pbo, + POINTL* BrushOrigin, + ROP4 Rop4) +{ + POINTL RealBrushOrigin; + SURFACE* psurfPattern; + PEBRUSHOBJ GdiBrush = NULL; + SURFOBJ* PatternSurface = NULL; + XLATEOBJ* XlatePatternToDest = NULL; + + if (BrushOrigin == NULL) + { + RealBrushOrigin.x = RealBrushOrigin.y = 0; + } + else + { + RealBrushOrigin = *BrushOrigin; + } + + /* Pattern brush */ + if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF) + { + GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject); + psurfPattern = SURFACE_LockSurface(GdiBrush->pbrush->hbmPattern); + if (psurfPattern) + { + PatternSurface = &psurfPattern->SurfObj; + } + else + { + /* FIXME - What to do here? */ + } + XlatePatternToDest = GdiBrush->XlateObject; + } + else + { + psurfPattern = NULL; + } + + return DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_StretchBlt( + psoDest, psoSource, Mask, PatternSurface, + OutputRect, InputRect, MaskOrigin, pbo, &RealBrushOrigin, + ColorTranslation, XlatePatternToDest, Rop4); + + /* Pattern brush */ + if (psurfPattern) + { + SURFACE_UnlockSurface(psurfPattern); + } +} + + + +/* + * @implemented + */ +BOOL +APIENTRY +EngStretchBltROP( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSource, + IN SURFOBJ *Mask, + IN CLIPOBJ *ClipRegion, + IN XLATEOBJ *ColorTranslation, + IN COLORADJUSTMENT *pca, + IN POINTL *BrushOrigin, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN POINTL *MaskOrigin, + IN ULONG Mode, + IN BRUSHOBJ *pbo, + IN DWORD ROP4) +{ + RECTL InputRect; + RECTL OutputRect; + POINTL Translate; + INTENG_ENTER_LEAVE EnterLeaveSource; + INTENG_ENTER_LEAVE EnterLeaveDest; + SURFOBJ* psoInput; + SURFOBJ* psoOutput; + PSTRETCHRECTFUNC BltRectFunc; + BOOLEAN Ret = TRUE; + POINTL AdjustedBrushOrigin; + BOOL UsesSource = ROP4_USES_SOURCE(ROP4); + + BYTE clippingType; + RECTL ClipRect; + RECT_ENUM RectEnum; + BOOL EnumMore; + ULONG Direction; + RECTL CombinedRect; + RECTL InputToCombinedRect; + unsigned i; + + LONG DstHeight; + LONG DstWidth; + LONG SrcHeight; + LONG SrcWidth; + + /* Determine clipping type */ + if (ClipRegion == (CLIPOBJ *) NULL) + { + clippingType = DC_TRIVIAL; + } + else + { + clippingType = ClipRegion->iDComplexity; + } + + if (ROP4 == R4_NOOP) + { + /* Copy destination onto itself: nop */ + return TRUE; + } + + OutputRect = *prclDest; + if (OutputRect.right < OutputRect.left) + { + OutputRect.left = prclDest->right; + OutputRect.right = prclDest->left; + } + if (OutputRect.bottom < OutputRect.top) + { + OutputRect.top = prclDest->bottom; + OutputRect.bottom = prclDest->top; + } + + InputRect = *prclSrc; + if (UsesSource) + { + if (NULL == prclSrc) + { + return FALSE; + } + + if (! IntEngEnter(&EnterLeaveSource, psoSource, &InputRect, TRUE, + &Translate, &psoInput)) + { + return FALSE; + } + + InputRect.left += Translate.x; + InputRect.right += Translate.x; + InputRect.top += Translate.y; + InputRect.bottom += Translate.y; + } + + if (NULL != ClipRegion) + { + if (OutputRect.left < ClipRegion->rclBounds.left) + { + InputRect.left += ClipRegion->rclBounds.left - OutputRect.left; + OutputRect.left = ClipRegion->rclBounds.left; + } + if (ClipRegion->rclBounds.right < OutputRect.right) + { + InputRect.right -= OutputRect.right - ClipRegion->rclBounds.right; + OutputRect.right = ClipRegion->rclBounds.right; + } + if (OutputRect.top < ClipRegion->rclBounds.top) + { + InputRect.top += ClipRegion->rclBounds.top - OutputRect.top; + OutputRect.top = ClipRegion->rclBounds.top; + } + if (ClipRegion->rclBounds.bottom < OutputRect.bottom) + { + InputRect.bottom -= OutputRect.bottom - ClipRegion->rclBounds.bottom; + OutputRect.bottom = ClipRegion->rclBounds.bottom; + } + } + + /* Check for degenerate case: if height or width of OutputRect is 0 pixels there's + nothing to do */ + if (OutputRect.right <= OutputRect.left || OutputRect.bottom <= OutputRect.top) + { + if (UsesSource) + { + IntEngLeave(&EnterLeaveSource); + } + return TRUE; + } + + if (! IntEngEnter(&EnterLeaveDest, psoDest, &OutputRect, FALSE, &Translate, &psoOutput)) + { + if (UsesSource) + { + IntEngLeave(&EnterLeaveSource); + } + return FALSE; + } + + OutputRect.left += Translate.x; + OutputRect.right += Translate.x; + OutputRect.top += Translate.y; + OutputRect.bottom += Translate.y; + + if (BrushOrigin) + { + AdjustedBrushOrigin.x = BrushOrigin->x + Translate.x; + AdjustedBrushOrigin.y = BrushOrigin->y + Translate.y; + } + else + { + AdjustedBrushOrigin = Translate; + } + + BltRectFunc = CallDibStretchBlt; + + DstHeight = OutputRect.bottom - OutputRect.top; + DstWidth = OutputRect.right - OutputRect.left; + SrcHeight = InputRect.bottom - InputRect.top; + SrcWidth = InputRect.right - InputRect.left; + switch (clippingType) + { + case DC_TRIVIAL: + Ret = (*BltRectFunc)(psoOutput, psoInput, Mask, + ColorTranslation, &OutputRect, &InputRect, MaskOrigin, + pbo, &AdjustedBrushOrigin, ROP4); + break; + case DC_RECT: + // Clip the blt to the clip rectangle + ClipRect.left = ClipRegion->rclBounds.left + Translate.x; + ClipRect.right = ClipRegion->rclBounds.right + Translate.x; + ClipRect.top = ClipRegion->rclBounds.top + Translate.y; + ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y; + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + { + InputToCombinedRect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * SrcHeight / DstHeight; + InputToCombinedRect.bottom = InputRect.top + (CombinedRect.bottom - OutputRect.top) * SrcHeight / DstHeight; + InputToCombinedRect.left = InputRect.left + (CombinedRect.left - OutputRect.left) * SrcWidth / DstWidth; + InputToCombinedRect.right = InputRect.left + (CombinedRect.right - OutputRect.left) * SrcWidth / DstWidth; + Ret = (*BltRectFunc)(psoOutput, psoInput, Mask, + ColorTranslation, + &CombinedRect, + &InputToCombinedRect, + MaskOrigin, + pbo, + &AdjustedBrushOrigin, + ROP4); + } + break; + case DC_COMPLEX: + if (psoOutput == psoInput) + { + if (OutputRect.top < InputRect.top) + { + Direction = OutputRect.left < InputRect.left ? + CD_RIGHTDOWN : CD_LEFTDOWN; + } + else + { + Direction = OutputRect.left < InputRect.left ? + CD_RIGHTUP : CD_LEFTUP; + } + } + else + { + Direction = CD_ANY; + } + CLIPOBJ_cEnumStart(ClipRegion, FALSE, CT_RECTANGLES, Direction, 0); + do + { + EnumMore = CLIPOBJ_bEnum(ClipRegion,(ULONG) sizeof(RectEnum), + (PVOID) &RectEnum); + for (i = 0; i < RectEnum.c; i++) + { + ClipRect.left = RectEnum.arcl[i].left + Translate.x; + ClipRect.right = RectEnum.arcl[i].right + Translate.x; + ClipRect.top = RectEnum.arcl[i].top + Translate.y; + ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y; + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + { + InputToCombinedRect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * SrcHeight / DstHeight; + InputToCombinedRect.bottom = InputRect.top + (CombinedRect.bottom - OutputRect.top) * SrcHeight / DstHeight; + InputToCombinedRect.left = InputRect.left + (CombinedRect.left - OutputRect.left) * SrcWidth / DstWidth; + InputToCombinedRect.right = InputRect.left + (CombinedRect.right - OutputRect.left) * SrcWidth / DstWidth; + Ret = (*BltRectFunc)(psoOutput, psoInput, Mask, + ColorTranslation, + &CombinedRect, + &InputToCombinedRect, + MaskOrigin, + pbo, + &AdjustedBrushOrigin, + ROP4); + } + } + } + while (EnumMore); + break; + } + + IntEngLeave(&EnterLeaveDest); + if (UsesSource) + { + IntEngLeave(&EnterLeaveSource); + } + + return Ret; +} + +/* + * @implemented + */ +BOOL +APIENTRY +EngStretchBlt( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSource, + IN SURFOBJ *Mask, + IN CLIPOBJ *ClipRegion, + IN XLATEOBJ *ColorTranslation, + IN COLORADJUSTMENT *pca, + IN POINTL *BrushOrigin, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN POINTL *MaskOrigin, + IN ULONG Mode) +{ + return EngStretchBltROP( + psoDest, + psoSource, + Mask, + ClipRegion, + ColorTranslation, + pca, + BrushOrigin, + prclDest, + prclSrc, + MaskOrigin, + Mode, + NULL, + ROP3_TO_ROP4(SRCCOPY)); +} + +BOOL APIENTRY +IntEngStretchBlt(SURFOBJ *psoDest, + SURFOBJ *psoSource, + SURFOBJ *MaskSurf, + CLIPOBJ *ClipRegion, + XLATEOBJ *ColorTranslation, + RECTL *DestRect, + RECTL *SourceRect, + POINTL *pMaskOrigin, + BRUSHOBJ *pbo, + POINTL *BrushOrigin, + ROP4 ROP) +{ + BOOLEAN ret; + COLORADJUSTMENT ca; + POINT MaskOrigin; + SURFACE *psurfDest; + SURFACE *psurfSource = NULL; + RECTL InputClippedRect; + RECTL InputRect; + RECTL OutputRect; + BOOL UsesSource = ROP4_USES_SOURCE(ROP); + LONG InputClWidth, InputClHeight, InputWidth, InputHeight; + + ASSERT(psoDest); + psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); + ASSERT(psurfDest); + ASSERT(DestRect); + + InputClippedRect = *DestRect; + if (InputClippedRect.right < InputClippedRect.left) + { + InputClippedRect.left = DestRect->right; + InputClippedRect.right = DestRect->left; + } + if (InputClippedRect.bottom < InputClippedRect.top) + { + InputClippedRect.top = DestRect->bottom; + InputClippedRect.bottom = DestRect->top; + } + + if (UsesSource) + { + if (NULL == SourceRect || NULL == psoSource) + { + return FALSE; + } + InputRect = *SourceRect; + + if (InputRect.right < InputRect.left || + InputRect.bottom < InputRect.top) + { + /* Everything clipped away, nothing to do */ + return TRUE; + } + } + + if (ClipRegion) + { + if (!RECTL_bIntersectRect(&OutputRect, &InputClippedRect, + &ClipRegion->rclBounds)) + { + return TRUE; + } + /* Update source rect */ + InputClWidth = InputClippedRect.right - InputClippedRect.left; + InputClHeight = InputClippedRect.bottom - InputClippedRect.top; + InputWidth = InputRect.right - InputRect.left; + InputHeight = InputRect.bottom - InputRect.top; + + InputRect.left += (InputWidth * (OutputRect.left - InputClippedRect.left)) / InputClWidth; + InputRect.right -= (InputWidth * (InputClippedRect.right - OutputRect.right)) / InputClWidth; + InputRect.top += (InputHeight * (OutputRect.top - InputClippedRect.top)) / InputClHeight; + InputRect.bottom -= (InputHeight * (InputClippedRect.bottom - OutputRect.bottom)) / InputClHeight; + } + else + { + OutputRect = InputClippedRect; + } + + if (pMaskOrigin != NULL) + { + MaskOrigin.x = pMaskOrigin->x; MaskOrigin.y = pMaskOrigin->y; + } + + /* No success yet */ + ret = FALSE; + SURFACE_LockBitmapBits(psurfDest); + MouseSafetyOnDrawStart(psoDest, OutputRect.left, OutputRect.top, + OutputRect.right, OutputRect.bottom); + + if (UsesSource) + { + psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj); + if (psoSource != psoDest) + { + SURFACE_LockBitmapBits(psurfSource); + } + MouseSafetyOnDrawStart(psoSource, InputRect.left, InputRect.top, + InputRect.right, InputRect.bottom); + } + + /* Prepare color adjustment */ + + /* Call the driver's DrvStretchBlt if available */ + if (psurfDest->flHooks & HOOK_STRETCHBLTROP) + { + /* Drv->StretchBltROP (look at
http://www.osronline.com/ddkx/graphics/ddifncs_0z3b.htm
) */ + // FIXME: MaskOrigin is always NULL ! + ret = GDIDEVFUNCS(psoDest).StretchBltROP(psoDest, (UsesSource) ? psoSource : NULL, MaskSurf, ClipRegion, ColorTranslation, + &ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, pbo, ROP); + } + + if (! ret) + { + // FIXME: see previous fixme + ret = EngStretchBltROP(psoDest, (UsesSource) ? psoSource : NULL, MaskSurf, ClipRegion, ColorTranslation, + &ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, pbo, ROP); + } + + if (UsesSource) + { + MouseSafetyOnDrawEnd(psoSource); + if (psoSource != psoDest) + { + SURFACE_UnlockBitmapBits(psurfSource); + } + } + MouseSafetyOnDrawEnd(psoDest); + SURFACE_UnlockBitmapBits(psurfDest); + + return ret; +} + +BOOL +APIENTRY +NtGdiEngStretchBlt( + IN SURFOBJ *psoDest, + IN SURFOBJ *psoSource, + IN SURFOBJ *Mask, + IN CLIPOBJ *ClipRegion, + IN XLATEOBJ *ColorTranslation, + IN COLORADJUSTMENT *pca, + IN POINTL *BrushOrigin, + IN RECTL *prclDest, + IN RECTL *prclSrc, + IN POINTL *MaskOrigin, + IN ULONG Mode) +{ + COLORADJUSTMENT ca; + POINTL lBrushOrigin; + RECTL rclDest; + RECTL rclSrc; + POINTL lMaskOrigin; + + _SEH2_TRY + { + ProbeForRead(pca, sizeof(COLORADJUSTMENT), 1); + RtlCopyMemory(&ca,pca, sizeof(COLORADJUSTMENT)); + + ProbeForRead(BrushOrigin, sizeof(POINTL), 1); + RtlCopyMemory(&lBrushOrigin, BrushOrigin, sizeof(POINTL)); + + ProbeForRead(prclDest, sizeof(RECTL), 1); + RtlCopyMemory(&rclDest, prclDest, sizeof(RECTL)); + + ProbeForRead(prclSrc, sizeof(RECTL), 1); + RtlCopyMemory(&rclSrc, prclSrc, sizeof(RECTL)); + + ProbeForRead(MaskOrigin, sizeof(POINTL), 1); + RtlCopyMemory(&lMaskOrigin, MaskOrigin, sizeof(POINTL)); + + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + _SEH2_YIELD(return FALSE); + } + _SEH2_END; + + return EngStretchBlt(psoDest, psoSource, Mask, ClipRegion, ColorTranslation, &ca, &lBrushOrigin, &rclDest, &rclSrc, &lMaskOrigin, Mode); +} + Propchange: trunk/reactos/subsystems/win32/win32k/eng/stretchblt.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/subsystems/win32/win32k/eng/transblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/transblt.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/transblt.c [iso-8859-1] Sat Apr 11 03:53:09 2009 @@ -143,7 +143,7 @@ ClipRect.right = Clip->rclBounds.right + Translate.x; ClipRect.top = Clip->rclBounds.top + Translate.y; ClipRect.bottom = Clip->rclBounds.bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) { InputToCombinedRect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * SrcHeight / DstHeight; InputToCombinedRect.bottom = InputRect.top + (CombinedRect.bottom - OutputRect.top) * SrcHeight / DstHeight; @@ -189,7 +189,7 @@ ClipRect.right = RectEnum.arcl[i].right + Translate.x; ClipRect.top = RectEnum.arcl[i].top + Translate.y; ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y; - if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) + if (RECTL_bIntersectRect(&CombinedRect, &OutputRect, &ClipRect)) { InputToCombinedRect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * SrcHeight / DstHeight; InputToCombinedRect.bottom = InputRect.top + (CombinedRect.bottom - OutputRect.top) * SrcHeight / DstHeight; @@ -264,7 +264,7 @@ * outside the surface */ if(Clip) { - if(!EngIntersectRect(&OutputRect, &InputClippedRect, &Clip->rclBounds)) + if(!RECTL_bIntersectRect(&OutputRect, &InputClippedRect, &Clip->rclBounds)) { return TRUE; } Modified: trunk/reactos/subsystems/win32/win32k/objects/rect.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/rect.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/rect.c [iso-8859-1] Sat Apr 11 03:53:09 2009 @@ -62,22 +62,25 @@ BOOL FASTCALL -RECTL_bIntersectRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2) +RECTL_bIntersectRect(RECTL* prclDst, const RECTL* prcl1, const RECTL* prcl2) { - if (RECTL_bIsEmptyRect(prcl1) || RECTL_bIsEmptyRect(prcl2) || - prcl1->left >= prcl2->right || prcl2->left >= prcl1->right || - prcl1->top >= prcl2->bottom || prcl2->top >= prcl1->bottom) + prclDst->left = max(prcl1->left, prcl2->left); + prclDst->right = min(prcl1->right, prcl2->right); + + if (prclDst->left < prclDst->right) { - RECTL_vSetEmptyRect(prclDst); - return FALSE; + prclDst->top = max(prcl1->top, prcl2->top); + prclDst->bottom = min(prcl1->bottom, prcl2->bottom); + + if (prclDst->top < prclDst->bottom) + { + return TRUE; + } } - prclDst->left = max(prcl1->left, prcl2->left); - prclDst->right = min(prcl1->right, prcl2->right); - prclDst->top = max(prcl1->top, prcl2->top); - prclDst->bottom = min(prcl1->bottom, prcl2->bottom); + RECTL_vSetEmptyRect(prclDst); - return TRUE; + return FALSE; } Modified: trunk/reactos/subsystems/win32/win32k/win32k.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/wi…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] Sat Apr 11 03:53:09 2009 @@ -44,6 +44,7 @@ </ifnot> </directory> <directory name="eng"> + <file>alphablend.c</file> <file>bitblt.c</file> <file>engbrush.c</file> <file>clip.c</file> @@ -70,6 +71,7 @@ <file>semaphor.c</file> <file>sort.c</file> <file>string.c</file> + <file>stretchblt.c</file> <file>surface.c</file> <file>transblt.c</file> <file>engwindow.c</file>
15 years, 9 months
1
0
0
0
[gschneider] 40450: Update wine sync information for r40448, update msvcrt cpp paths and add a older sync of undname i did
by gschneider@svn.reactos.org
Author: gschneider Date: Sat Apr 11 03:11:02 2009 New Revision: 40450 URL:
http://svn.reactos.org/svn/reactos?rev=40450&view=rev
Log: Update wine sync information for r40448, update msvcrt cpp paths and add a older sync of undname i did Modified: trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Apr 11 03:11:02 2009 @@ -191,7 +191,7 @@ reactos/dll/win32/advapi32/crypt/*.c # ekohl says we're not sharing this gdi32 - - reactos/dll/win32/gdi32/objects/linedda.c # Out of sync + reactos/dll/win32/gdi32/objects/linedda.c # Synched at 20090410 kernel32 - reactos/dll/win32/kernel32/misc/errormsg.c # Out of sync @@ -199,12 +199,12 @@ reactos/dll/win32/kernel32/misc/lcformat.c # Out of sync msvcrt - - reactos/lib/sdk/crt/cpp.c # Synced at 20071111 - reactos/lib/sdk/crt/cppexcept.c # Synced at 20071111 + reactos/lib/sdk/crt/except/cpp.c # Synced at 20071111 + reactos/lib/sdk/crt/except/cppexcept.c # Synced at 20071111 reactos/lib/sdk/crt/strings/scanf.c/h # Synced at 20080604 reactos/lib/sdk/crt/strings/wcs.c # Synced at 20080611 reactos/lib/sdk/crt/wine/heap.c # Synced at 20080529 - reactos/lib/sdk/crt/wine/undname.c # Synced at XXXXXXXX + reactos/lib/sdk/crt/wine/undname.c # Synced at 20081130 reactos/lib/sdk/crt/thread/thread.c # Synced at 20080604 snmpapi -
15 years, 9 months
1
0
0
0
[tkreuzer] 40449: EngMaskBitBlt and IntEngMaskBlt do not have a source surface, so it makes no sense to have a source point. Remove it from the prototype. (Aplpha)BltMask need to have a spacial prototype including a source surface and point, but they are unused, use the mask point instead of the source point. IntEngMaskBitBlt: call IntEngEnter with the mask surface, instead of 2 times with the dest surface, intersect with Clip bounding rect before. Fixes wrong text origin/crippled text when outp
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Apr 11 00:50:57 2009 New Revision: 40449 URL:
http://svn.reactos.org/svn/reactos?rev=40449&view=rev
Log: EngMaskBitBlt and IntEngMaskBlt do not have a source surface, so it makes no sense to have a source point. Remove it from the prototype. (Aplpha)BltMask need to have a spacial prototype including a source surface and point, but they are unused, use the mask point instead of the source point. IntEngMaskBitBlt: call IntEngEnter with the mask surface, instead of 2 times with the dest surface, intersect with Clip bounding rect before. Fixes wrong text origin/crippled text when outputting clipped text. Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c trunk/reactos/subsystems/win32/win32k/include/eng.h trunk/reactos/subsystems/win32/win32k/objects/freetype.c Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] Sat Apr 11 00:50:57 2009 @@ -78,14 +78,14 @@ static BOOLEAN APIENTRY BltMask(SURFOBJ* psoDest, - SURFOBJ* psoSource, // FIXME: why isn't this used? + SURFOBJ* psoSource, // unused SURFOBJ* psoMask, - XLATEOBJ* ColorTranslation, - RECTL* DestRect, - POINTL* SourcePoint, - POINTL* MaskPoint, // FIXME: why isn't this used? + XLATEOBJ* ColorTranslation, // unused + RECTL* prclDest, + POINTL* pptlSource, // unused + POINTL* pptlMask, BRUSHOBJ* pbo, - POINTL* BrushPoint, + POINTL* pptlBrush, ROP4 Rop4) { LONG x, y; @@ -123,31 +123,31 @@ else psurfPattern = NULL; - pjMskLine = (PBYTE)psoMask->pvScan0 + SourcePoint->y * psoMask->lDelta + (SourcePoint->x >> 3); - fjMaskBit0 = 0x80 >> (SourcePoint->x & 0x07); + pjMskLine = (PBYTE)psoMask->pvScan0 + pptlMask->y * psoMask->lDelta + (pptlMask->x >> 3); + fjMaskBit0 = 0x80 >> (pptlMask->x & 0x07); fnDest_PutPixel = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel; if (psurfPattern) { XlateObj = pebo ? pebo->XlateObject : NULL; - PatternY = (DestRect->top - BrushPoint->y) % PatternHeight; + PatternY = (prclDest->top - pptlBrush->y) % PatternHeight; if (PatternY < 0) { PatternY += PatternHeight; } - PatternX0 = (DestRect->left - BrushPoint->x) % PatternWidth; + PatternX0 = (prclDest->left - pptlBrush->x) % PatternWidth; if (PatternX0 < 0) { PatternX0 += PatternWidth; } - for (y = DestRect->top; y < DestRect->bottom; y++) + for (y = prclDest->top; y < prclDest->bottom; y++) { pjMskCurrent = pjMskLine; fjMaskBit = fjMaskBit0; PatternX = PatternX0; - for (x = DestRect->left; x < DestRect->right; x++) + for (x = prclDest->left; x < prclDest->right; x++) { if (*pjMskCurrent & fjMaskBit) { @@ -168,12 +168,12 @@ else { Pattern = pbo ? pbo->iSolidColor : 0; - for (y = DestRect->top; y < DestRect->bottom; y++) + for (y = prclDest->top; y < prclDest->bottom; y++) { pjMskCurrent = pjMskLine; fjMaskBit = fjMaskBit0; - for (x = DestRect->left; x < DestRect->right; x++) + for (x = prclDest->left; x < prclDest->right; x++) { if (*pjMskCurrent & fjMaskBit) { @@ -1651,32 +1651,32 @@ /* renders the alpha mask bitmap */ static BOOLEAN APIENTRY AlphaBltMask(SURFOBJ* psoDest, - SURFOBJ* psoSource, - SURFOBJ* Mask, + SURFOBJ* psoSource, // unused + SURFOBJ* psoMask, XLATEOBJ* ColorTranslation, XLATEOBJ* SrcColorTranslation, - RECTL* DestRect, - POINTL* SourcePoint, - POINTL* MaskPoint, + RECTL* prclDest, + POINTL* pptlSource, // unused + POINTL* pptlMask, BRUSHOBJ* pbo, - POINTL* BrushPoint) + POINTL* pptlBrush) { LONG i, j, dx, dy; int r, g, b; ULONG Background, BrushColor, NewColor; BYTE *tMask, *lMask; - dx = DestRect->right - DestRect->left; - dy = DestRect->bottom - DestRect->top; - - if (Mask != NULL) + dx = prclDest->right - prclDest->left; + dy = prclDest->bottom - prclDest->top; + + if (psoMask != NULL) { BrushColor = XLATEOBJ_iXlate(SrcColorTranslation, pbo ? pbo->iSolidColor : 0); r = (int)GetRValue(BrushColor); g = (int)GetGValue(BrushColor); b = (int)GetBValue(BrushColor); - tMask = (PBYTE)Mask->pvScan0 + (SourcePoint->y * Mask->lDelta) + SourcePoint->x; + tMask = (PBYTE)psoMask->pvScan0 + (pptlMask->y * psoMask->lDelta) + pptlMask->x; for (j = 0; j < dy; j++) { lMask = tMask; @@ -1687,11 +1687,11 @@ if (*lMask == 0xff) { DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel( - psoDest, DestRect->left + i, DestRect->top + j, pbo ? pbo->iSolidColor : 0); + psoDest, prclDest->left + i, prclDest->top + j, pbo ? pbo->iSolidColor : 0); } else { - Background = DIB_GetSource(psoDest, DestRect->left + i, DestRect->top + j, + Background = DIB_GetSource(psoDest, prclDest->left + i, prclDest->top + j, SrcColorTranslation); NewColor = @@ -1701,12 +1701,12 @@ Background = XLATEOBJ_iXlate(ColorTranslation, NewColor); DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel( - psoDest, DestRect->left + i, DestRect->top + j, Background); + psoDest, prclDest->left + i, prclDest->top + j, Background); } } lMask++; } - tMask += Mask->lDelta; + tMask += psoMask->lDelta; } return TRUE; } @@ -1716,6 +1716,7 @@ } } +static BOOL APIENTRY EngMaskBitBlt(SURFOBJ *psoDest, SURFOBJ *psoMask, @@ -1723,8 +1724,7 @@ XLATEOBJ *DestColorTranslation, XLATEOBJ *SourceColorTranslation, RECTL *DestRect, - POINTL *SourcePoint, - POINTL *MaskOrigin, + POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *BrushOrigin) { @@ -1749,12 +1749,12 @@ ASSERT(psoMask); - if (NULL != SourcePoint) - { - InputRect.left = SourcePoint->x; - InputRect.right = SourcePoint->x + (DestRect->right - DestRect->left); - InputRect.top = SourcePoint->y; - InputRect.bottom = SourcePoint->y + (DestRect->bottom - DestRect->top); + if (pptlMask) + { + InputRect.left = pptlMask->x; + InputRect.right = pptlMask->x + (DestRect->right - DestRect->left); + InputRect.top = pptlMask->y; + InputRect.bottom = pptlMask->y + (DestRect->bottom - DestRect->top); } else { @@ -1764,29 +1764,12 @@ InputRect.bottom = DestRect->bottom - DestRect->top; } - if (! IntEngEnter(&EnterLeaveSource, psoDest, &InputRect, TRUE, &Translate, &psoInput)) - { - return FALSE; - } - - if (NULL != SourcePoint) - { - InputPoint.x = SourcePoint->x + Translate.x; - InputPoint.y = SourcePoint->y + Translate.y; - } - else - { - InputPoint.x = 0; - InputPoint.y = 0; - } - OutputRect = *DestRect; if (NULL != ClipRegion) { if (OutputRect.left < ClipRegion->rclBounds.left) { InputRect.left += ClipRegion->rclBounds.left - OutputRect.left; - InputPoint.x += ClipRegion->rclBounds.left - OutputRect.left; OutputRect.left = ClipRegion->rclBounds.left; } if (ClipRegion->rclBounds.right < OutputRect.right) @@ -1797,7 +1780,6 @@ if (OutputRect.top < ClipRegion->rclBounds.top) { InputRect.top += ClipRegion->rclBounds.top - OutputRect.top; - InputPoint.y += ClipRegion->rclBounds.top - OutputRect.top; OutputRect.top = ClipRegion->rclBounds.top; } if (ClipRegion->rclBounds.bottom < OutputRect.bottom) @@ -1806,6 +1788,14 @@ OutputRect.bottom = ClipRegion->rclBounds.bottom; } } + + if (! IntEngEnter(&EnterLeaveSource, psoMask, &InputRect, TRUE, &Translate, &psoInput)) + { + return FALSE; + } + + InputPoint.x = InputRect.left + Translate.x; + InputPoint.y = InputRect.top + Translate.y; /* Check for degenerate case: if height or width of OutputRect is 0 pixels there's nothing to do */ @@ -1846,11 +1836,11 @@ { case DC_TRIVIAL: if (psoMask->iBitmapFormat == BMF_8BPP) - Ret = AlphaBltMask(psoOutput, psoInput, psoMask, DestColorTranslation, SourceColorTranslation, - &OutputRect, &InputPoint, MaskOrigin, pbo, &AdjustedBrushOrigin); + Ret = AlphaBltMask(psoOutput, NULL , psoInput, DestColorTranslation, SourceColorTranslation, + &OutputRect, &InputPoint, pptlMask, pbo, &AdjustedBrushOrigin); else - Ret = BltMask(psoOutput, psoInput, psoMask, DestColorTranslation, - &OutputRect, &InputPoint, MaskOrigin, pbo, &AdjustedBrushOrigin, + Ret = BltMask(psoOutput, NULL, psoInput, DestColorTranslation, + &OutputRect, &InputPoint, pptlMask, pbo, &AdjustedBrushOrigin, R4_MASK); break; case DC_RECT: @@ -1866,12 +1856,12 @@ if (psoMask->iBitmapFormat == BMF_8BPP) { Ret = AlphaBltMask(psoOutput, psoInput, psoMask, DestColorTranslation, SourceColorTranslation, - &CombinedRect, &Pt, MaskOrigin, pbo, &AdjustedBrushOrigin); + &CombinedRect, &Pt, pptlMask, pbo, &AdjustedBrushOrigin); } else { Ret = BltMask(psoOutput, psoInput, psoMask, DestColorTranslation, - &CombinedRect, &Pt, MaskOrigin, pbo, &AdjustedBrushOrigin, R4_MASK); + &CombinedRect, &Pt, pptlMask, pbo, &AdjustedBrushOrigin, R4_MASK); } } break; @@ -1912,14 +1902,14 @@ Ret = AlphaBltMask(psoOutput, psoInput, psoMask, DestColorTranslation, SourceColorTranslation, - &CombinedRect, &Pt, MaskOrigin, pbo, + &CombinedRect, &Pt, pptlMask, pbo, &AdjustedBrushOrigin) && Ret; } else { Ret = BltMask(psoOutput, psoInput, psoMask, DestColorTranslation, &CombinedRect, &Pt, - MaskOrigin, pbo, &AdjustedBrushOrigin, + pptlMask, pbo, &AdjustedBrushOrigin, R4_MASK) && Ret; } } @@ -1943,8 +1933,7 @@ XLATEOBJ *DestColorTranslation, XLATEOBJ *SourceColorTranslation, RECTL *DestRect, - POINTL *SourcePoint, - POINTL *MaskOrigin, + POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *BrushOrigin) { @@ -1955,9 +1944,9 @@ ASSERT(psoMask); - if (NULL != SourcePoint) - { - InputPoint = *SourcePoint; + if (pptlMask) + { + InputPoint = *pptlMask; } /* Clip against the bounds of the clipping region so we won't try to write @@ -1989,15 +1978,15 @@ This should really be done using a call to DrvSynchronizeSurface, but the VMware driver doesn't hook that call. */ IntEngBitBltEx(psoDest, NULL, psoMask, ClipRegion, DestColorTranslation, - DestRect, SourcePoint, MaskOrigin, pbo, BrushOrigin, + DestRect, pptlMask, pptlMask, pbo, BrushOrigin, R4_NOOP, FALSE); ret = EngMaskBitBlt(psoDest, psoMask, ClipRegion, DestColorTranslation, SourceColorTranslation, - &OutputRect, &InputPoint, MaskOrigin, pbo, BrushOrigin); + &OutputRect, &InputPoint, pbo, BrushOrigin); /* Dummy BitBlt to let driver know that something has changed. */ IntEngBitBltEx(psoDest, NULL, psoMask, ClipRegion, DestColorTranslation, - DestRect, SourcePoint, MaskOrigin, pbo, BrushOrigin, + DestRect, pptlMask, pptlMask, pbo, BrushOrigin, R4_NOOP, FALSE); MouseSafetyOnDrawEnd(psoDest); Modified: trunk/reactos/subsystems/win32/win32k/include/eng.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/eng.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/eng.h [iso-8859-1] Sat Apr 11 00:50:57 2009 @@ -4,16 +4,15 @@ BOOL APIENTRY EngIntersectRect (PRECTL prcDst, PRECTL prcSrc1, PRECTL prcSrc2); VOID FASTCALL EngDeleteXlate (XLATEOBJ *XlateObj); BOOL APIENTRY -IntEngMaskBlt(SURFOBJ *DestObj, - SURFOBJ *Mask, - CLIPOBJ *ClipRegion, - XLATEOBJ *DestColorTranslation, - XLATEOBJ *SourceColorTranslation, - RECTL *DestRect, - POINTL *SourcePoint, - POINTL *MaskOrigin, - BRUSHOBJ *Brush, - POINTL *BrushOrigin); +IntEngMaskBlt(SURFOBJ *psoDest, + SURFOBJ *psoMask, + CLIPOBJ *ClipRegion, + XLATEOBJ *DestColorTranslation, + XLATEOBJ *SourceColorTranslation, + RECTL *DestRect, + POINTL *pptlMask, + BRUSHOBJ *pbo, + POINTL *BrushOrigin); VOID FASTCALL IntEngWindowChanged( Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Sat Apr 11 00:50:57 2009 @@ -3571,7 +3571,6 @@ XlateObj, XlateObj2, &DestRect, - &SourcePoint, (PPOINTL)&MaskRect, &dc->eboText.BrushObject, &BrushOrigin);
15 years, 9 months
1
0
0
0
[gschneider] 40448: Update LineDDA implementation, -13 gdi32 path tests
by gschneider@svn.reactos.org
Author: gschneider Date: Sat Apr 11 00:39:05 2009 New Revision: 40448 URL:
http://svn.reactos.org/svn/reactos?rev=40448&view=rev
Log: Update LineDDA implementation, -13 gdi32 path tests Modified: trunk/reactos/dll/win32/gdi32/objects/linedda.c Modified: trunk/reactos/dll/win32/gdi32/objects/linedda.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/li…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/linedda.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/linedda.c [iso-8859-1] Sat Apr 11 00:39:05 2009 @@ -1,7 +1,9 @@ /* - * LineDDA + * GDI drawing functions. * - * Copyright 1993 Bob Amstadt + * Copyright 1993, 1994 Alexandre Julliard + * Copyright 1997 Bertho A. Stultiens + * 1999 Huw D M Davies * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -15,15 +17,15 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS GDI32 * PURPOSE: LineDDA Function - * FILE: lib/gdi32/objects/linedda.c + * FILE: dll/win32/gdi32/objects/linedda.c * PROGRAMER: Steven Edwards - * REVISION HISTORY: 2003/11/15 sedwards Created + * REVISION HISTORY: 2003/11/15 sedwards Created, 2009/04 gschneider Updated * NOTES: Adapted from Wine */ @@ -36,7 +38,7 @@ * @implemented */ BOOL WINAPI LineDDA(INT nXStart, INT nYStart, INT nXEnd, INT nYEnd, - LINEDDAPROC lpLineFunc, LPARAM lpData ) + LINEDDAPROC callback, LPARAM lParam ) { INT xadd = 1, yadd = 1; INT err,erradd; @@ -44,73 +46,46 @@ INT dx = nXEnd - nXStart; INT dy = nYEnd - nYStart; - // optimized for vertical and horizontal lines so we avoid unnecessary math - if(nXStart == nXEnd) - { - // vertical line - use dx,dy as temp variables so we don't waste stack space - if(nYStart < nYEnd) - { - dx = nYStart; - dy = nYEnd; - } else { - dx = nYEnd; - dy = nYStart; - } - for(cnt = dx; cnt <= dy; cnt++) - { - lpLineFunc(nXStart,cnt,lpData); - } - return TRUE; - } - - if(nYStart == nYEnd) - { - // horizontal line - use dx,dy as temp variables so we don't waste stack space - if(nXStart < nXEnd) - { - dx = nXStart; - dy = nXEnd; - } else { - dx = nXEnd; - dy = nXStart; - } - for(cnt = dx; cnt <= dy; cnt++) - { - lpLineFunc(cnt, nYStart,lpData); - } - return TRUE; - } - // end of H/V line code - if (dx < 0) { - dx = -dx; xadd = -1; + if (dx < 0) + { + dx = -dx; + xadd = -1; } - if (dy < 0) { - dy = -dy; yadd = -1; + if (dy < 0) + { + dy = -dy; + yadd = -1; } - if (dx > dy) { /* line is "more horizontal" */ - err = 2*dy - dx; erradd = 2*dy - 2*dx; - for(cnt = 0;cnt <= dx; cnt++) { - lpLineFunc(nXStart,nYStart,lpData); - if (err > 0) { - nYStart += yadd; - err += erradd; - } else { - err += 2*dy; - } - nXStart += xadd; - } - } else { /* line is "more vertical" */ - err = 2*dx - dy; erradd = 2*dx - 2*dy; - for(cnt = 0;cnt <= dy; cnt++) { - lpLineFunc(nXStart,nYStart,lpData); - if (err > 0) { - nXStart += xadd; - err += erradd; - } else { - err += 2*dx; - } - nYStart += yadd; - } + if (dx > dy) /* line is "more horizontal" */ + { + err = 2*dy - dx; erradd = 2*dy - 2*dx; + for(cnt = 0;cnt < dx; cnt++) + { + callback(nXStart,nYStart,lParam); + if (err > 0) + { + nYStart += yadd; + err += erradd; + } + else err += 2*dy; + nXStart += xadd; + } + } + else /* line is "more vertical" */ + { + err = 2*dx - dy; erradd = 2*dx - 2*dy; + for(cnt = 0;cnt < dy; cnt++) + { + callback(nXStart,nYStart,lParam); + if (err > 0) + { + nXStart += xadd; + err += erradd; + } + else err += 2*dx; + nYStart += yadd; + } } return TRUE; } +
15 years, 9 months
1
0
0
0
[cgutman] 40447: - MiniSendComplete acquires the adapter lock so release the lock before calling it
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Apr 11 00:04:08 2009 New Revision: 40447 URL:
http://svn.reactos.org/svn/reactos?rev=40447&view=rev
Log: - MiniSendComplete acquires the adapter lock so release the lock before calling it Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Sat Apr 11 00:04:08 2009 @@ -349,15 +349,15 @@ else { /* Send is called at DISPATCH_LEVEL for all serialized miniports */ - KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &RaiseOldIrql); for (i = 0; i < NumberOfPackets; i++) { + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &RaiseOldIrql); NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, PacketArray[i], PacketArray[i]->Private.Flags); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, RaiseOldIrql); if (NdisStatus != NDIS_STATUS_PENDING) MiniSendComplete(Adapter, PacketArray[i], NdisStatus); } - KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, RaiseOldIrql); } } }
15 years, 9 months
1
0
0
0
[cgutman] 40446: - Acquire the adapter lock instead of just raising to DISPATCH_LEVEL (MSDN hints at this in various areas)
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Apr 10 23:55:07 2009 New Revision: 40446 URL:
http://svn.reactos.org/svn/reactos?rev=40446&view=rev
Log: - Acquire the adapter lock instead of just raising to DISPATCH_LEVEL (MSDN hints at this in various areas) Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c trunk/reactos/drivers/network/ndis/ndis/protocol.c Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Fri Apr 10 23:55:07 2009 @@ -355,11 +355,9 @@ NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - - KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); + Adapter->NdisMiniportBlock.PendingRequest = NULL; - KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock); if( MacBlock->Binding->RequestCompleteHandler ) { (*MacBlock->Binding->RequestCompleteHandler)( @@ -367,7 +365,7 @@ Request, Status); } - KeLowerIrql(OldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); } VOID NTAPI @@ -384,6 +382,7 @@ * Status = Status of send operation */ { + PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle; PADAPTER_BINDING AdapterBinding; KIRQL OldIrql; @@ -391,12 +390,12 @@ AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[0]; - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); (*AdapterBinding->ProtocolBinding->Chars.SendCompleteHandler)( AdapterBinding->NdisOpenBlock.ProtocolBindingContext, Packet, Status); - KeLowerIrql(OldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); } @@ -417,6 +416,7 @@ IN NDIS_STATUS Status, IN UINT BytesTransferred) { + PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle; PADAPTER_BINDING AdapterBinding; KIRQL OldIrql; @@ -424,13 +424,13 @@ AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[0]; - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); (*AdapterBinding->ProtocolBinding->Chars.TransferDataCompleteHandler)( AdapterBinding->NdisOpenBlock.ProtocolBindingContext, Packet, Status, BytesTransferred); - KeLowerIrql(OldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); } @@ -605,7 +605,7 @@ NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); /* call the miniport's queryinfo handler */ - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.QueryInformationHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, Oid, @@ -613,7 +613,7 @@ Size, BytesWritten, &BytesNeeded); - KeLowerIrql(OldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); /* FIXME: Wait in pending case! */ @@ -634,11 +634,11 @@ BOOLEAN Ret = FALSE; KIRQL OldIrql; - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); if (Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.CheckForHangHandler) Ret = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.CheckForHangHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext); - KeLowerIrql(OldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); return Ret; } @@ -667,16 +667,14 @@ NdisMIndicateStatus(Adapter, NDIS_STATUS_RESET_START, NULL, 0); NdisMIndicateStatusComplete(Adapter); - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); Status = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.ResetHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, AddressingReset); - KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock); Adapter->NdisMiniportBlock.ResetStatus = Status; - KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock); - - KeLowerIrql(OldIrql); + + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); if (Status != NDIS_STATUS_PENDING) { NdisMIndicateStatus(Adapter, NDIS_STATUS_RESET_END, NULL, 0); @@ -854,11 +852,9 @@ KIRQL OldIrql; NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - - KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); + Adapter->NdisMiniportBlock.PendingRequest = NdisRequest; - KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock); switch (NdisRequest->RequestType) { @@ -887,12 +883,10 @@ } if (Status != NDIS_STATUS_PENDING) { - KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock); Adapter->NdisMiniportBlock.PendingRequest = NULL; - KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock); - } - - KeLowerIrql(OldIrql); + } + + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); return Status; } @@ -909,12 +903,10 @@ { PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; - KIRQL OldIrql; ASSERT(Adapter); - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + /* This isn't a handler supplied by the miniport */ if (Adapter->NdisMiniportBlock.SetCompleteHandler) (Adapter->NdisMiniportBlock.SetCompleteHandler)(MiniportAdapterHandle, Status); - KeLowerIrql(OldIrql); } @@ -930,12 +922,10 @@ { PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; - KIRQL OldIrql; ASSERT(Adapter); - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + /* This isn't a handler supplied by the miniport */ if( Adapter->NdisMiniportBlock.QueryCompleteHandler ) (Adapter->NdisMiniportBlock.QueryCompleteHandler)(MiniportAdapterHandle, Status); - KeLowerIrql(OldIrql); } VOID @@ -980,13 +970,11 @@ else { /* SendPackets is called at DISPATCH_LEVEL for all serialized miniports */ - KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql); - { + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &RaiseOldIrql); NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's SendPackets handler\n")); (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, (PPNDIS_PACKET)&WorkItemContext, 1); - } - KeLowerIrql(RaiseOldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, RaiseOldIrql); NdisStatus = NDIS_GET_PACKET_STATUS((PNDIS_PACKET)WorkItemContext); if( NdisStatus == NDIS_STATUS_RESOURCES ) { @@ -1008,13 +996,13 @@ else { /* Send is called at DISPATCH_LEVEL for all serialized miniports */ - KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &RaiseOldIrql); NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send handler\n")); NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, (PNDIS_PACKET)WorkItemContext, ((PNDIS_PACKET)WorkItemContext)->Private.Flags); NDIS_DbgPrint(MAX_TRACE, ("back from miniport's send handler\n")); - KeLowerIrql(RaiseOldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, RaiseOldIrql); if( NdisStatus == NDIS_STATUS_RESOURCES ) { MiniQueueWorkItem(Adapter, WorkItemType, WorkItemContext, TRUE); break; @@ -1046,19 +1034,14 @@ NdisMIndicateStatus(Adapter, NDIS_STATUS_RESET_START, NULL, 0); NdisMIndicateStatusComplete(Adapter); - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.ResetHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, &AddressingReset); - if (NdisStatus == NDIS_STATUS_PENDING) - { - KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock); - Adapter->NdisMiniportBlock.ResetStatus = NDIS_STATUS_PENDING; - KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock); - } - - KeLowerIrql(OldIrql); + Adapter->NdisMiniportBlock.ResetStatus = NdisStatus; + + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); if (NdisStatus != NDIS_STATUS_PENDING) MiniResetComplete(Adapter, NdisStatus, AddressingReset); Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Fri Apr 10 23:55:07 2009 @@ -204,13 +204,11 @@ NdisStatus = NDIS_STATUS_PENDING; } else { /* SendPackets is called at DISPATCH_LEVEL for all serialized miniports */ - KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql); - { + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &RaiseOldIrql); NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's SendPackets handler\n")); (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, &Packet, 1); - } - KeLowerIrql(RaiseOldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, RaiseOldIrql); NdisStatus = NDIS_GET_PACKET_STATUS(Packet); if (NdisStatus == NDIS_STATUS_RESOURCES) { @@ -229,12 +227,12 @@ NDIS_DbgPrint(MAX_TRACE, ("back from miniport's send handler\n")); } else { /* Send is called at DISPATCH_LEVEL for all serialized miniports */ - KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &RaiseOldIrql); NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send handler\n")); NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, Packet, Packet->Private.Flags); NDIS_DbgPrint(MAX_TRACE, ("back from miniport's send handler\n")); - KeLowerIrql(RaiseOldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, RaiseOldIrql); if (NdisStatus == NDIS_STATUS_RESOURCES) { MiniQueueWorkItem(Adapter, NdisWorkItemSend, Packet, TRUE); @@ -274,8 +272,6 @@ Adapter = AdapterBinding->Adapter; ASSERT(Adapter); - - /* if the following is not true, KeRaiseIrql() below will break */ ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); /* XXX what is this crazy black magic? */ @@ -326,10 +322,10 @@ else { /* SendPackets is called at DISPATCH_LEVEL for all serialized miniports */ - KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &RaiseOldIrql); (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, PacketArray, NumberOfPackets); - KeLowerIrql(RaiseOldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, RaiseOldIrql); for (i = 0; i < NumberOfPackets; i++) { NdisStatus = NDIS_GET_PACKET_STATUS(PacketArray[i]); @@ -353,7 +349,7 @@ else { /* Send is called at DISPATCH_LEVEL for all serialized miniports */ - KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &RaiseOldIrql); for (i = 0; i < NumberOfPackets; i++) { NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)( @@ -361,7 +357,7 @@ if (NdisStatus != NDIS_STATUS_PENDING) MiniSendComplete(Adapter, PacketArray[i], NdisStatus); } - KeLowerIrql(RaiseOldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, RaiseOldIrql); } } } @@ -408,7 +404,7 @@ return NDIS_STATUS_SUCCESS; } - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); Status = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.TransferDataHandler)( Packet, @@ -418,7 +414,7 @@ ByteOffset, BytesToTransfer); - KeLowerIrql(OldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); return Status; }
15 years, 9 months
1
0
0
0
[gschneider] 40445: Amendment to r40444: float -> double changes were not supposed to go in
by gschneider@svn.reactos.org
Author: gschneider Date: Fri Apr 10 23:46:06 2009 New Revision: 40445 URL:
http://svn.reactos.org/svn/reactos?rev=40445&view=rev
Log: Amendment to r40444: float -> double changes were not supposed to go in Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] Fri Apr 10 23:46:06 2009 @@ -1057,19 +1057,19 @@ DC_UpdateXforms(PDC dc) { XFORM xformWnd2Vport; - DOUBLE scaleX, scaleY; + FLOAT scaleX, scaleY; PDC_ATTR pdcattr = dc->pdcattr; XFORM xformWorld2Vport, xformWorld2Wnd, xformVport2World; /* Construct a transformation to do the window-to-viewport conversion */ - scaleX = (pdcattr->szlWindowExt.cx ? (DOUBLE)pdcattr->szlViewportExt.cx / (DOUBLE)pdcattr->szlWindowExt.cx : 0.0f); - scaleY = (pdcattr->szlWindowExt.cy ? (DOUBLE)pdcattr->szlViewportExt.cy / (DOUBLE)pdcattr->szlWindowExt.cy : 0.0f); + scaleX = (pdcattr->szlWindowExt.cx ? (FLOAT)pdcattr->szlViewportExt.cx / (FLOAT)pdcattr->szlWindowExt.cx : 0.0f); + scaleY = (pdcattr->szlWindowExt.cy ? (FLOAT)pdcattr->szlViewportExt.cy / (FLOAT)pdcattr->szlWindowExt.cy : 0.0f); xformWnd2Vport.eM11 = scaleX; xformWnd2Vport.eM12 = 0.0; xformWnd2Vport.eM21 = 0.0; xformWnd2Vport.eM22 = scaleY; - xformWnd2Vport.eDx = (DOUBLE)pdcattr->ptlViewportOrg.x - scaleX * (DOUBLE)pdcattr->ptlWindowOrg.x; - xformWnd2Vport.eDy = (DOUBLE)pdcattr->ptlViewportOrg.y - scaleY * (DOUBLE)pdcattr->ptlWindowOrg.y; + xformWnd2Vport.eDx = (FLOAT)pdcattr->ptlViewportOrg.x - scaleX * (FLOAT)pdcattr->ptlWindowOrg.x; + xformWnd2Vport.eDy = (FLOAT)pdcattr->ptlViewportOrg.y - scaleY * (FLOAT)pdcattr->ptlWindowOrg.y; /* Combine with the world transformation */ MatrixS2XForm(&xformWorld2Vport, &dc->dclevel.mxWorldToDevice);
15 years, 9 months
1
0
0
0
[gschneider] 40444: Don't hard code viewport extents, they depend on the dc size - highlighted by gdi32 mapping tests
by gschneider@svn.reactos.org
Author: gschneider Date: Fri Apr 10 23:40:48 2009 New Revision: 40444 URL:
http://svn.reactos.org/svn/reactos?rev=40444&view=rev
Log: Don't hard code viewport extents, they depend on the dc size - highlighted by gdi32 mapping tests Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] Fri Apr 10 23:40:48 2009 @@ -674,36 +674,36 @@ /* Fall through */ case MM_LOMETRIC: - pdcattr->szlWindowExt.cx = 3600; - pdcattr->szlWindowExt.cy = 2700; + pdcattr->szlWindowExt.cx = dc->ppdev->GDIInfo.ulHorzSize * 10; + pdcattr->szlWindowExt.cy = dc->ppdev->GDIInfo.ulVertSize * 10; pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes; pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes; break; case MM_HIMETRIC: - pdcattr->szlWindowExt.cx = 36000; - pdcattr->szlWindowExt.cy = 27000; + pdcattr->szlWindowExt.cx = dc->ppdev->GDIInfo.ulHorzSize * 100; + pdcattr->szlWindowExt.cy = dc->ppdev->GDIInfo.ulVertSize * 100; pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes; pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes; break; case MM_LOENGLISH: - pdcattr->szlWindowExt.cx = 1417; - pdcattr->szlWindowExt.cy = 1063; + pdcattr->szlWindowExt.cx = MulDiv(1000, dc->ppdev->GDIInfo.ulHorzSize, 254); + pdcattr->szlWindowExt.cy = MulDiv(1000, dc->ppdev->GDIInfo.ulVertSize, 254); pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes; pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes; break; case MM_HIENGLISH: - pdcattr->szlWindowExt.cx = 14173; - pdcattr->szlWindowExt.cy = 10630; + pdcattr->szlWindowExt.cx = MulDiv(10000, dc->ppdev->GDIInfo.ulHorzSize, 254); + pdcattr->szlWindowExt.cy = MulDiv(10000, dc->ppdev->GDIInfo.ulVertSize, 254); pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes; pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes; break; case MM_TWIPS: - pdcattr->szlWindowExt.cx = 20409; - pdcattr->szlWindowExt.cy = 15307; + pdcattr->szlWindowExt.cx = MulDiv(14400, dc->ppdev->GDIInfo.ulHorzSize, 254); + pdcattr->szlWindowExt.cy = MulDiv(14400, dc->ppdev->GDIInfo.ulVertSize, 254); pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes; pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes; break; @@ -1057,19 +1057,19 @@ DC_UpdateXforms(PDC dc) { XFORM xformWnd2Vport; - FLOAT scaleX, scaleY; + DOUBLE scaleX, scaleY; PDC_ATTR pdcattr = dc->pdcattr; XFORM xformWorld2Vport, xformWorld2Wnd, xformVport2World; /* Construct a transformation to do the window-to-viewport conversion */ - scaleX = (pdcattr->szlWindowExt.cx ? (FLOAT)pdcattr->szlViewportExt.cx / (FLOAT)pdcattr->szlWindowExt.cx : 0.0f); - scaleY = (pdcattr->szlWindowExt.cy ? (FLOAT)pdcattr->szlViewportExt.cy / (FLOAT)pdcattr->szlWindowExt.cy : 0.0f); + scaleX = (pdcattr->szlWindowExt.cx ? (DOUBLE)pdcattr->szlViewportExt.cx / (DOUBLE)pdcattr->szlWindowExt.cx : 0.0f); + scaleY = (pdcattr->szlWindowExt.cy ? (DOUBLE)pdcattr->szlViewportExt.cy / (DOUBLE)pdcattr->szlWindowExt.cy : 0.0f); xformWnd2Vport.eM11 = scaleX; xformWnd2Vport.eM12 = 0.0; xformWnd2Vport.eM21 = 0.0; xformWnd2Vport.eM22 = scaleY; - xformWnd2Vport.eDx = (FLOAT)pdcattr->ptlViewportOrg.x - scaleX * (FLOAT)pdcattr->ptlWindowOrg.x; - xformWnd2Vport.eDy = (FLOAT)pdcattr->ptlViewportOrg.y - scaleY * (FLOAT)pdcattr->ptlWindowOrg.y; + xformWnd2Vport.eDx = (DOUBLE)pdcattr->ptlViewportOrg.x - scaleX * (DOUBLE)pdcattr->ptlWindowOrg.x; + xformWnd2Vport.eDy = (DOUBLE)pdcattr->ptlViewportOrg.y - scaleY * (DOUBLE)pdcattr->ptlWindowOrg.y; /* Combine with the world transformation */ MatrixS2XForm(&xformWorld2Vport, &dc->dclevel.mxWorldToDevice);
15 years, 9 months
1
0
0
0
[fireball] 40443: - Move 4 apps from rosapps to trunk for consistency (fontview, magnify, winver and write) [2/2].
by fireball@svn.reactos.org
Author: fireball Date: Fri Apr 10 23:04:12 2009 New Revision: 40443 URL:
http://svn.reactos.org/svn/reactos?rev=40443&view=rev
Log: - Move 4 apps from rosapps to trunk for consistency (fontview, magnify, winver and write) [2/2]. Removed: trunk/rosapps/applications/fontview/ trunk/rosapps/applications/magnify/ trunk/rosapps/applications/winver/ trunk/rosapps/applications/write/ Modified: trunk/rosapps/applications/applications.rbuild Modified: trunk/rosapps/applications/applications.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/applications.…
============================================================================== --- trunk/rosapps/applications/applications.rbuild [iso-8859-1] (original) +++ trunk/rosapps/applications/applications.rbuild [iso-8859-1] Fri Apr 10 23:04:12 2009 @@ -17,18 +17,11 @@ <xi:include href="downloader/downloader.rbuild" /> </directory> - <directory name="fontview"> - <xi:include href="fontview/fontview.rbuild" /> - </directory> <!-- <directory name="fraginator"> <xi:include href="fraginator/fraginator.rbuild" /> </directory> --> - - <directory name="magnify"> - <xi:include href="magnify/magnify.rbuild" /> - </directory> <directory name="net"> <xi:include href="net/directory.rbuild" /> @@ -45,12 +38,4 @@ <directory name="winfile"> <xi:include href="winfile/winfile.rbuild" /> </directory> - - <directory name="winver"> - <xi:include href="winver/winver.rbuild" /> - </directory> - - <directory name="write"> - <xi:include href="write/write.rbuild" /> - </directory> </group>
15 years, 9 months
1
0
0
0
[fireball] 40442: - Move 4 apps from rosapps to trunk for consistency (fontview, magnify, winver and write) [1/2].
by fireball@svn.reactos.org
Author: fireball Date: Fri Apr 10 23:03:02 2009 New Revision: 40442 URL:
http://svn.reactos.org/svn/reactos?rev=40442&view=rev
Log: - Move 4 apps from rosapps to trunk for consistency (fontview, magnify, winver and write) [1/2]. Added: trunk/reactos/base/applications/fontview/ - copied from r40440, trunk/rosapps/applications/fontview/ trunk/reactos/base/applications/magnify/ - copied from r40440, trunk/rosapps/applications/magnify/ trunk/reactos/base/applications/winver/ - copied from r40440, trunk/rosapps/applications/winver/ trunk/reactos/base/applications/write/ - copied from r40440, trunk/rosapps/applications/write/ Modified: trunk/reactos/base/applications/applications.rbuild trunk/reactos/boot/bootdata/packages/reactos.dff Modified: trunk/reactos/base/applications/applications.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/applicat…
============================================================================== --- trunk/reactos/base/applications/applications.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/applications.rbuild [iso-8859-1] Fri Apr 10 23:03:02 2009 @@ -19,6 +19,9 @@ <directory name="dxdiag"> <xi:include href="dxdiag/dxdiag.rbuild" /> </directory> + <directory name="fontview"> + <xi:include href="fontview/fontview.rbuild" /> + </directory> <directory name="games"> <xi:include href="games/games.rbuild" /> </directory> @@ -33,6 +36,9 @@ </directory> <directory name="logoff"> <xi:include href="logoff/logoff.rbuild" /> + </directory> + <directory name="magnify"> + <xi:include href="magnify/magnify.rbuild" /> </directory> <directory name="mplay32"> <xi:include href="mplay32/mplay32.rbuild" /> @@ -76,7 +82,13 @@ <directory name="winhlp32"> <xi:include href="winhlp32/winhlp32.rbuild" /> </directory> + <directory name="winver"> + <xi:include href="winver/winver.rbuild" /> + </directory> <directory name="wordpad"> <xi:include href="wordpad/wordpad.rbuild" /> </directory> + <directory name="write"> + <xi:include href="write/write.rbuild" /> + </directory> </group> Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Fri Apr 10 23:03:02 2009 @@ -42,6 +42,7 @@ base\applications\cmdutils\xcopy\xcopy.exe 1 base\applications\control\control.exe 1 base\applications\dxdiag\dxdiag.exe 1 +base\applications\fontview\fontview.exe 1 base\applications\mscutils\devmgmt\devmgmt.exe 1 base\applications\mscutils\eventvwr\eventvwr.exe 1 base\applications\games\solitaire\sol.exe 1 @@ -50,6 +51,7 @@ base\applications\kbswitch\kbswitch.exe 1 base\applications\kbswitch\kbsdll\kbsdll.dll 1 base\applications\logoff\logoff.exe 1 +base\applications\magnify\magnify.exe 1 base\applications\mplay32\mplay32.exe 1 base\applications\msconfig\msconfig.exe 1 base\applications\mstsc\mstsc.exe 1 @@ -76,7 +78,9 @@ base\applications\sndvol32\sndvol32.exe 1 base\applications\taskmgr\taskmgr.exe 1 base\applications\winhlp32\winhlp32.exe 4 +base\applications\winver\winver.exe 1 base\applications\wordpad\wordpad.exe 1 +base\applications\write\write.exe 1 base\services\audiosrv\audiosrv.exe 1 base\services\dhcp\dhcp.exe 1 @@ -650,13 +654,11 @@ modules\rosapps\applications\sysutils\gettype\gettype.exe 1 optional modules\rosapps\applications\downloader\downloader.exe 1 optional modules\rosapps\applications\downloader\downloader.xml 1 optional -modules\rosapps\applications\fontview\fontview.exe 1 optional modules\rosapps\applications\net\ncftp\ncftp.exe 1 optional modules\rosapps\applications\net\netreg\netreg.exe 1 optional modules\rosapps\applications\net\niclist\niclist.exe 1 optional modules\rosapps\applications\net\roshttpd\roshttpd.exe 1 optional modules\rosapps\applications\notevil\notevil.exe 1 optional -modules\rosapps\applications\magnify\magnify.exe 1 optional modules\rosapps\applications\sysutils\chkdsk\chkdsk.exe 1 optional modules\rosapps\applications\sysutils\systeminfo\systeminfo.exe 1 optional modules\rosapps\applications\sysutils\chklib\chklib.exe 1 optional @@ -683,8 +685,6 @@ modules\rosapps\applications\sysutils\utils\stats\stats.exe 1 optional modules\rosapps\applications\sysutils\utils\tickcount\tickcount.exe 1 optional modules\rosapps\applications\winfile\winfile.exe 1 optional -modules\rosapps\applications\winver\winver.exe 1 optional -modules\rosapps\applications\write\write.exe 1 optional modules\rosapps\demos\maze\maze.exe 1 optional modules\rosapps\drivers\green\green.sys 2 optional
15 years, 9 months
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
...
48
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Results per page:
10
25
50
100
200