mirror of
https://github.com/reactos/reactos.git
synced 2025-06-28 07:59:43 +00:00
- Correctly translate output rect
- Don't call DIB routines for empty (clipped away) rectangles svn path=/trunk/; revision=16018
This commit is contained in:
parent
5d7043ea5a
commit
c37765923c
1 changed files with 56 additions and 34 deletions
|
@ -290,7 +290,7 @@ EngBitBlt(SURFOBJ *DestObj,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != SourcePoint)
|
if (UsesSource && NULL != SourcePoint)
|
||||||
{
|
{
|
||||||
InputRect.left = SourcePoint->x;
|
InputRect.left = SourcePoint->x;
|
||||||
InputRect.right = SourcePoint->x + (DestRect->right - DestRect->left);
|
InputRect.right = SourcePoint->x + (DestRect->right - DestRect->left);
|
||||||
|
@ -362,10 +362,10 @@ EngBitBlt(SURFOBJ *DestObj,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputRect.left = DestRect->left + Translate.x;
|
OutputRect.left += Translate.x;
|
||||||
OutputRect.right = DestRect->right + Translate.x;
|
OutputRect.right += Translate.x;
|
||||||
OutputRect.top = DestRect->top + Translate.y;
|
OutputRect.top += Translate.y;
|
||||||
OutputRect.bottom = DestRect->bottom + Translate.y;
|
OutputRect.bottom += Translate.y;
|
||||||
|
|
||||||
if(BrushOrigin)
|
if(BrushOrigin)
|
||||||
{
|
{
|
||||||
|
@ -412,11 +412,13 @@ EngBitBlt(SURFOBJ *DestObj,
|
||||||
ClipRect.right = ClipRegion->rclBounds.right + Translate.x;
|
ClipRect.right = ClipRegion->rclBounds.right + Translate.x;
|
||||||
ClipRect.top = ClipRegion->rclBounds.top + Translate.y;
|
ClipRect.top = ClipRegion->rclBounds.top + Translate.y;
|
||||||
ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y;
|
ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y;
|
||||||
EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect);
|
if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect))
|
||||||
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
{
|
||||||
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
||||||
Ret = (*BltRectFunc)(OutputObj, InputObj, Mask, ColorTranslation,
|
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
||||||
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, Rop4);
|
Ret = (*BltRectFunc)(OutputObj, InputObj, Mask, ColorTranslation,
|
||||||
|
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, Rop4);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case DC_COMPLEX:
|
case DC_COMPLEX:
|
||||||
Ret = TRUE;
|
Ret = TRUE;
|
||||||
|
@ -446,12 +448,15 @@ EngBitBlt(SURFOBJ *DestObj,
|
||||||
ClipRect.right = RectEnum.arcl[i].right + Translate.x;
|
ClipRect.right = RectEnum.arcl[i].right + Translate.x;
|
||||||
ClipRect.top = RectEnum.arcl[i].top + Translate.y;
|
ClipRect.top = RectEnum.arcl[i].top + Translate.y;
|
||||||
ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y;
|
ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y;
|
||||||
EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect);
|
if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect))
|
||||||
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
{
|
||||||
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
||||||
Ret = (*BltRectFunc)(OutputObj, InputObj, Mask, ColorTranslation,
|
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
||||||
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, Rop4) &&
|
Ret = (*BltRectFunc)(OutputObj, InputObj, Mask,
|
||||||
Ret;
|
ColorTranslation, &CombinedRect, &Pt,
|
||||||
|
MaskOrigin, Brush, &AdjustedBrushOrigin,
|
||||||
|
Rop4) && Ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(EnumMore);
|
while(EnumMore);
|
||||||
|
@ -1001,15 +1006,21 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
||||||
ClipRect.right = ClipRegion->rclBounds.right + Translate.x;
|
ClipRect.right = ClipRegion->rclBounds.right + Translate.x;
|
||||||
ClipRect.top = ClipRegion->rclBounds.top + Translate.y;
|
ClipRect.top = ClipRegion->rclBounds.top + Translate.y;
|
||||||
ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y;
|
ClipRect.bottom = ClipRegion->rclBounds.bottom + Translate.y;
|
||||||
EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect);
|
if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect))
|
||||||
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
{
|
||||||
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
||||||
if(Mask->iBitmapFormat == BMF_8BPP)
|
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
||||||
Ret = AlphaBltMask(OutputObj, InputObj, Mask, DestColorTranslation, SourceColorTranslation,
|
if(Mask->iBitmapFormat == BMF_8BPP)
|
||||||
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin);
|
{
|
||||||
else
|
Ret = AlphaBltMask(OutputObj, InputObj, Mask, DestColorTranslation, SourceColorTranslation,
|
||||||
Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation,
|
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin);
|
||||||
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, R4_MASK);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation,
|
||||||
|
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, R4_MASK);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case DC_COMPLEX:
|
case DC_COMPLEX:
|
||||||
Ret = TRUE;
|
Ret = TRUE;
|
||||||
|
@ -1039,15 +1050,26 @@ EngMaskBitBlt(SURFOBJ *DestObj,
|
||||||
ClipRect.right = RectEnum.arcl[i].right + Translate.x;
|
ClipRect.right = RectEnum.arcl[i].right + Translate.x;
|
||||||
ClipRect.top = RectEnum.arcl[i].top + Translate.y;
|
ClipRect.top = RectEnum.arcl[i].top + Translate.y;
|
||||||
ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y;
|
ClipRect.bottom = RectEnum.arcl[i].bottom + Translate.y;
|
||||||
EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect);
|
if (EngIntersectRect(&CombinedRect, &OutputRect, &ClipRect))
|
||||||
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
{
|
||||||
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
|
||||||
if(Mask->iBitmapFormat == BMF_8BPP)
|
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
|
||||||
Ret = AlphaBltMask(OutputObj, InputObj, Mask, DestColorTranslation, SourceColorTranslation,
|
if(Mask->iBitmapFormat == BMF_8BPP)
|
||||||
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin) && Ret;
|
{
|
||||||
else
|
Ret = AlphaBltMask(OutputObj, InputObj, Mask,
|
||||||
Ret = BltMask(OutputObj, InputObj, Mask, DestColorTranslation,
|
DestColorTranslation,
|
||||||
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, R4_MASK) && Ret;
|
SourceColorTranslation,
|
||||||
|
&CombinedRect, &Pt, MaskOrigin, Brush,
|
||||||
|
&AdjustedBrushOrigin) && Ret;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ret = BltMask(OutputObj, InputObj, Mask,
|
||||||
|
DestColorTranslation, &CombinedRect, &Pt,
|
||||||
|
MaskOrigin, Brush, &AdjustedBrushOrigin,
|
||||||
|
R4_MASK) && Ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(EnumMore);
|
while(EnumMore);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue