- Fix definition of ROP_TO_ROP4
- Move some macros to intgdi.h
- Fix coordinate space mismatch in IntGdiBitBltRgn and IntGdiFillRgn
Fixes console window selection

svn path=/trunk/; revision=65914
This commit is contained in:
Timo Kreuzer 2014-12-30 21:03:13 +00:00
parent 1624612861
commit 1cb80f3aa0
3 changed files with 27 additions and 18 deletions

View file

@ -9,12 +9,6 @@
#include <win32k.h> #include <win32k.h>
DBG_DEFAULT_CHANNEL(GdiBlt); DBG_DEFAULT_CHANNEL(GdiBlt);
#define ROP_USES_SOURCE(Rop) (((((Rop) & 0xCC0000) >> 2) != ((Rop) & 0x330000)) || ((((Rop) & 0xCC000000) >> 2) != ((Rop) & 0x33000000)))
#define ROP_USES_MASK(Rop) (((Rop) & 0xFF000000) != (((Rop) & 0xff0000) << 8))
#define FIXUP_ROP(Rop) if(((Rop) & 0xFF000000) == 0) Rop = MAKEROP4((Rop), (Rop))
#define ROP_TO_ROP4(Rop) ((Rop) >> 16)
BOOL APIENTRY BOOL APIENTRY
NtGdiAlphaBlend( NtGdiAlphaBlend(
HDC hDCDest, HDC hDCDest,
@ -1038,7 +1032,7 @@ IntGdiBitBltRgn(
BOOL bResult; BOOL bResult;
NT_ASSERT((pdc != NULL) && (prgn != NULL)); NT_ASSERT((pdc != NULL) && (prgn != NULL));
/* Get the surface */ /* Check if we have a surface */
if (pdc->dclevel.pSurface == NULL) if (pdc->dclevel.pSurface == NULL)
{ {
return TRUE; return TRUE;
@ -1052,19 +1046,28 @@ IntGdiBitBltRgn(
} }
/* Transform given region into device coordinates */ /* Transform given region into device coordinates */
if (!REGION_LPTODP(pdc, prgnClip, prgn) || if (!REGION_LPTODP(pdc, prgnClip, prgn))
!REGION_bOffsetRgn(prgnClip, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y))
{ {
REGION_Delete(prgnClip); REGION_Delete(prgnClip);
return FALSE; return FALSE;
} }
/* Intersect with the system or RAO region */ /* Intersect with the system or RAO region (these are (atm) without DC-origin) */
if (pdc->prgnRao) if (pdc->prgnRao)
IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnRao, RGN_AND); IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnRao, RGN_AND);
else else
IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnVis, RGN_AND); IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnVis, RGN_AND);
/* Now account for the DC-origin */
if (!REGION_bOffsetRgn(prgnClip, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y))
{
REGION_Delete(prgnClip);
return FALSE;
}
/* Prepare the DC */
DC_vPrepareDCsForBlit(pdc, &prgnClip->rdh.rcBound, NULL, NULL);
/* Initialize a clip object */ /* Initialize a clip object */
IntEngInitClipObj(&xcoClip); IntEngInitClipObj(&xcoClip);
IntEngUpdateClipRegion(&xcoClip, IntEngUpdateClipRegion(&xcoClip,
@ -1072,9 +1075,6 @@ IntGdiBitBltRgn(
prgnClip->Buffer, prgnClip->Buffer,
&prgnClip->rdh.rcBound); &prgnClip->rdh.rcBound);
/* Prepare the DC */
DC_vPrepareDCsForBlit(pdc, &prgnClip->rdh.rcBound, NULL, NULL);
/* Call the Eng or Drv function */ /* Call the Eng or Drv function */
bResult = IntEngBitBlt(&pdc->dclevel.pSurface->SurfObj, bResult = IntEngBitBlt(&pdc->dclevel.pSurface->SurfObj,
NULL, NULL,
@ -1125,19 +1125,25 @@ IntGdiFillRgn(
} }
/* Transform region into device coordinates */ /* Transform region into device coordinates */
if (!REGION_LPTODP(pdc, prgnClip, prgn) || if (!REGION_LPTODP(pdc, prgnClip, prgn))
!REGION_bOffsetRgn(prgnClip, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y))
{ {
REGION_Delete(prgnClip); REGION_Delete(prgnClip);
return FALSE; return FALSE;
} }
/* Intersect with the system or RAO region */ /* Intersect with the system or RAO region (these are (atm) without DC-origin) */
if (pdc->prgnRao) if (pdc->prgnRao)
IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnRao, RGN_AND); IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnRao, RGN_AND);
else else
IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnVis, RGN_AND); IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnVis, RGN_AND);
/* Now account for the DC-origin */
if (!REGION_bOffsetRgn(prgnClip, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y))
{
REGION_Delete(prgnClip);
return FALSE;
}
IntEngInitClipObj(&xcoClip); IntEngInitClipObj(&xcoClip);
IntEngUpdateClipRegion(&xcoClip, IntEngUpdateClipRegion(&xcoClip,
prgnClip->rdh.nCount, prgnClip->rdh.nCount,

View file

@ -1109,8 +1109,6 @@ cleanup:
} }
#define ROP_TO_ROP4(Rop) ((Rop) >> 16)
W32KAPI W32KAPI
INT INT
APIENTRY APIENTRY

View file

@ -1,5 +1,10 @@
#pragma once #pragma once
#define ROP_USES_SOURCE(Rop) (((((Rop) & 0xCC0000) >> 2) != ((Rop) & 0x330000)) || ((((Rop) & 0xCC000000) >> 2) != ((Rop) & 0x33000000)))
#define ROP_USES_MASK(Rop) (((Rop) & 0xFF000000) != (((Rop) & 0xff0000) << 8))
#define FIXUP_ROP(Rop) if(((Rop) & 0xFF000000) == 0) Rop = MAKEROP4((Rop), (Rop))
#define ROP_TO_ROP4(Rop) (((Rop) >> 8) & 0xFF00) | ((Rop) >> 16)
/* Brush functions */ /* Brush functions */
extern HDC hSystemBM; extern HDC hSystemBM;