2008/7/28 Aric Stewart aric@codeweavers.com:
if (Src != This)
{
xdst.top = 0;
xdst.bottom = DestRect->bottom - DestRect->top;
xdst.left = 0;
xdst.right = DestRect->right - DestRect->left;
}
This will still break the rectangle bounds check further down (around line 940), and anything else that depends on the position of the rectangle within the surface. Come to think of it, the rectangle bounds check should probably be done before trying to lock the surface. Something else I just thought of is that LockRect() probably won't handle mirrored or flipped destination rectangles very well.
Ok, well i can easily address the bound checking issue by moving the bound checks. i agree before doing the locks sounds correct.
I am unsure if you are thinking i should be concerned about the mirrored or flipped destinations as i will admit I have no idea what that entails.
I will look more for things that depend on the position of the rect on the within the surface. I think the trick is that xdst us assigned to DestRect in the code and with my patch they may need to be treated differently.
I had a suspicion this was not going to be as easy as it looked. -aric
H. Verbeet wrote:
2008/7/28 Aric Stewart aric@codeweavers.com:
if (Src != This)
{
xdst.top = 0;
xdst.bottom = DestRect->bottom - DestRect->top;
xdst.left = 0;
xdst.right = DestRect->right - DestRect->left;
}
This will still break the rectangle bounds check further down (around line 940), and anything else that depends on the position of the rectangle within the surface. Come to think of it, the rectangle bounds check should probably be done before trying to lock the surface. Something else I just thought of is that LockRect() probably won't handle mirrored or flipped destination rectangles very well.
2008/7/28 Aric Stewart aric@codeweavers.com:
I am unsure if you are thinking i should be concerned about the mirrored or flipped destinations as i will admit I have no idea what that entails.
I seem to remember that Blt allowed top > bottom and left > right in the source and destination rectangles, in order to support flipping or mirroring the image data. LockRect can't handle that though, so you'd have to make sure the rectangle you pass to LockRect has (left, top) as the top left corner. Right now I can't seem to find the code handling that though, so maybe it's not an issue.