wined3d: in surface Blt when source and destination are not the same only lock the part of the destination surface that is requested to copy to.

Aric Stewart aric at
Mon Jul 28 11:24:44 CDT 2008

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 

I had a suspicion this was not going to be as easy as it looked.

H. Verbeet wrote:
> 2008/7/28 Aric Stewart <aric at>:
>> +        if (Src != This)
>> +        {
>> +   = 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.

More information about the wine-devel mailing list