mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:53:40 +00:00
[WIN32K]
- Update direct DCs surface before blit if needed - call directly ppdev in MouseSafetyOnDraw{Start,End} - use directly the PDEVOBJ surface in mouse operations - Add some mouse-related sanity checks svn path=/branches/reactos-yarotows/; revision=46937
This commit is contained in:
parent
083f2b4f4a
commit
e918eb7c29
3 changed files with 31 additions and 29 deletions
|
@ -37,23 +37,17 @@ EngSetPointerTag(
|
||||||
*/
|
*/
|
||||||
INT INTERNAL_CALL
|
INT INTERNAL_CALL
|
||||||
MouseSafetyOnDrawStart(
|
MouseSafetyOnDrawStart(
|
||||||
SURFOBJ *pso,
|
PPDEVOBJ ppdev,
|
||||||
LONG HazardX1,
|
LONG HazardX1,
|
||||||
LONG HazardY1,
|
LONG HazardY1,
|
||||||
LONG HazardX2,
|
LONG HazardX2,
|
||||||
LONG HazardY2)
|
LONG HazardY2)
|
||||||
{
|
{
|
||||||
LONG tmp;
|
LONG tmp;
|
||||||
PDEVOBJ *ppdev;
|
|
||||||
GDIPOINTER *pgp;
|
GDIPOINTER *pgp;
|
||||||
|
|
||||||
ASSERT(pso != NULL);
|
ASSERT(ppdev != NULL);
|
||||||
|
ASSERT(ppdev->pSurface != NULL);
|
||||||
ppdev = GDIDEV(pso);
|
|
||||||
if (ppdev == NULL)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
pgp = &ppdev->Pointer;
|
pgp = &ppdev->Pointer;
|
||||||
|
|
||||||
|
@ -88,7 +82,7 @@ MouseSafetyOnDrawStart(
|
||||||
&& pgp->Exclude.top <= HazardY2)
|
&& pgp->Exclude.top <= HazardY2)
|
||||||
{
|
{
|
||||||
ppdev->SafetyRemoveLevel = ppdev->SafetyRemoveCount;
|
ppdev->SafetyRemoveLevel = ppdev->SafetyRemoveCount;
|
||||||
ppdev->pfnMovePointer(pso, -1, -1, NULL);
|
ppdev->pfnMovePointer(&ppdev->pSurface->SurfObj, -1, -1, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
@ -99,19 +93,12 @@ MouseSafetyOnDrawStart(
|
||||||
*/
|
*/
|
||||||
INT INTERNAL_CALL
|
INT INTERNAL_CALL
|
||||||
MouseSafetyOnDrawEnd(
|
MouseSafetyOnDrawEnd(
|
||||||
SURFOBJ *pso)
|
PPDEVOBJ ppdev)
|
||||||
{
|
{
|
||||||
PDEVOBJ *ppdev;
|
|
||||||
GDIPOINTER *pgp;
|
GDIPOINTER *pgp;
|
||||||
|
|
||||||
ASSERT(pso != NULL);
|
ASSERT(ppdev != NULL);
|
||||||
|
ASSERT(ppdev->pSurface != NULL);
|
||||||
ppdev = (PDEVOBJ*)pso->hdev;
|
|
||||||
|
|
||||||
if (ppdev == NULL)
|
|
||||||
{
|
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
pgp = &ppdev->Pointer;
|
pgp = &ppdev->Pointer;
|
||||||
|
|
||||||
|
@ -125,7 +112,7 @@ MouseSafetyOnDrawEnd(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ppdev->pfnMovePointer(pso, gpsi->ptCursor.x, gpsi->ptCursor.y, &pgp->Exclude);
|
ppdev->pfnMovePointer(&ppdev->pSurface->SurfObj, gpsi->ptCursor.x, gpsi->ptCursor.y, &pgp->Exclude);
|
||||||
|
|
||||||
ppdev->SafetyRemoveLevel = 0;
|
ppdev->SafetyRemoveLevel = 0;
|
||||||
|
|
||||||
|
@ -635,7 +622,9 @@ GreSetPointerShape(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
psurf = pdc->dclevel.pSurface;
|
ASSERT(pdc->dctype == DCTYPE_DIRECT);
|
||||||
|
/* We're not sure DC surface is the good one */
|
||||||
|
psurf = pdc->ppdev->pSurface;
|
||||||
if (!psurf)
|
if (!psurf)
|
||||||
{
|
{
|
||||||
DPRINT1("DC has no surface.\n");
|
DPRINT1("DC has no surface.\n");
|
||||||
|
@ -710,12 +699,13 @@ GreMovePointer(
|
||||||
DPRINT1("Failed to lock the DC.\n");
|
DPRINT1("Failed to lock the DC.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ASSERT(pdc->dctype == DCTYPE_DIRECT);
|
||||||
|
|
||||||
/* Store the cursor exclude position in the PDEV */
|
/* Store the cursor exclude position in the PDEV */
|
||||||
prcl = &pdc->ppdev->Pointer.Exclude;
|
prcl = &pdc->ppdev->Pointer.Exclude;
|
||||||
|
|
||||||
/* Call Eng/Drv function */
|
/* Call Eng/Drv function */
|
||||||
IntEngMovePointer(&pdc->dclevel.pSurface->SurfObj, x, y, prcl);
|
IntEngMovePointer(&pdc->ppdev->pSurface->SurfObj, x, y, prcl);
|
||||||
|
|
||||||
/* Unlock the DC */
|
/* Unlock the DC */
|
||||||
DC_UnlockDc(pdc);
|
DC_UnlockDc(pdc);
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
#include <include/winsta.h>
|
#include <include/winsta.h>
|
||||||
|
|
||||||
INT INTERNAL_CALL MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1, LONG HazardY1, LONG HazardX2, LONG HazardY2);
|
INT INTERNAL_CALL MouseSafetyOnDrawStart(PPDEVOBJ ppdev, LONG HazardX1, LONG HazardY1, LONG HazardX2, LONG HazardY2);
|
||||||
INT INTERNAL_CALL MouseSafetyOnDrawEnd(SURFOBJ *SurfObj);
|
INT INTERNAL_CALL MouseSafetyOnDrawEnd(PPDEVOBJ ppdev);
|
||||||
|
|
||||||
#ifndef XBUTTON1
|
#ifndef XBUTTON1
|
||||||
#define XBUTTON1 (0x01)
|
#define XBUTTON1 (0x01)
|
||||||
|
|
|
@ -493,20 +493,32 @@ DC_vPrepareDCsForBlit(PDC pdc1,
|
||||||
if(pdcFirst && pdcFirst->dctype == DCTYPE_DIRECT)
|
if(pdcFirst && pdcFirst->dctype == DCTYPE_DIRECT)
|
||||||
{
|
{
|
||||||
EngAcquireSemaphore(pdcFirst->ppdev->hsemDevLock);
|
EngAcquireSemaphore(pdcFirst->ppdev->hsemDevLock);
|
||||||
MouseSafetyOnDrawStart(&pdcFirst->dclevel.pSurface->SurfObj,
|
MouseSafetyOnDrawStart(pdcFirst->ppdev,
|
||||||
prcFirst->left,
|
prcFirst->left,
|
||||||
prcFirst->top,
|
prcFirst->top,
|
||||||
prcFirst->right,
|
prcFirst->right,
|
||||||
prcFirst->bottom) ;
|
prcFirst->bottom) ;
|
||||||
|
/* Update surface if needed */
|
||||||
|
if(pdcFirst->ppdev->pSurface != pdcFirst->dclevel.pSurface)
|
||||||
|
{
|
||||||
|
SURFACE_ShareUnlockSurface(pdcFirst->dclevel.pSurface);
|
||||||
|
pdcFirst->dclevel.pSurface = PDEVOBJ_pSurface(pdcFirst->ppdev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(pdcSecond && pdcSecond->dctype == DCTYPE_DIRECT)
|
if(pdcSecond && pdcSecond->dctype == DCTYPE_DIRECT)
|
||||||
{
|
{
|
||||||
EngAcquireSemaphore(pdcSecond->ppdev->hsemDevLock);
|
EngAcquireSemaphore(pdcSecond->ppdev->hsemDevLock);
|
||||||
MouseSafetyOnDrawStart(&pdcSecond->dclevel.pSurface->SurfObj,
|
MouseSafetyOnDrawStart(pdcSecond->ppdev,
|
||||||
prcSecond->left,
|
prcSecond->left,
|
||||||
prcSecond->top,
|
prcSecond->top,
|
||||||
prcSecond->right,
|
prcSecond->right,
|
||||||
prcSecond->bottom) ;
|
prcSecond->bottom) ;
|
||||||
|
/* Update surface if needed */
|
||||||
|
if(pdcSecond->ppdev->pSurface != pdcSecond->dclevel.pSurface)
|
||||||
|
{
|
||||||
|
SURFACE_ShareUnlockSurface(pdcSecond->dclevel.pSurface);
|
||||||
|
pdcSecond->dclevel.pSurface = PDEVOBJ_pSurface(pdcSecond->ppdev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,7 +529,7 @@ DC_vFinishBlit(PDC pdc1, PDC pdc2)
|
||||||
{
|
{
|
||||||
if(pdc1->dctype == DCTYPE_DIRECT)
|
if(pdc1->dctype == DCTYPE_DIRECT)
|
||||||
{
|
{
|
||||||
MouseSafetyOnDrawEnd(&pdc1->dclevel.pSurface->SurfObj);
|
MouseSafetyOnDrawEnd(pdc1->ppdev);
|
||||||
EngReleaseSemaphore(pdc1->ppdev->hsemDevLock);
|
EngReleaseSemaphore(pdc1->ppdev->hsemDevLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,7 +537,7 @@ DC_vFinishBlit(PDC pdc1, PDC pdc2)
|
||||||
{
|
{
|
||||||
if(pdc2->dctype == DCTYPE_DIRECT)
|
if(pdc2->dctype == DCTYPE_DIRECT)
|
||||||
{
|
{
|
||||||
MouseSafetyOnDrawEnd(&pdc2->dclevel.pSurface->SurfObj);
|
MouseSafetyOnDrawEnd(pdc2->ppdev);
|
||||||
EngReleaseSemaphore(pdc2->ppdev->hsemDevLock);
|
EngReleaseSemaphore(pdc2->ppdev->hsemDevLock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue