Commit aa907299 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winex11: Use inline intersect_rect helper instead of IntersectRect.

parent ace09cf3
......@@ -1912,7 +1912,7 @@ static void x11drv_surface_flush( struct window_surface *window_surface )
coords.width = surface->header.rect.right - surface->header.rect.left;
coords.height = surface->header.rect.bottom - surface->header.rect.top;
SetRect( &coords.visrect, 0, 0, coords.width, coords.height );
if (IntersectRect( &coords.visrect, &coords.visrect, &surface->bounds ))
if (intersect_rect( &coords.visrect, &coords.visrect, &surface->bounds ))
{
TRACE( "flushing %p %dx%d bounds %s bits %p\n",
surface, coords.width, coords.height,
......
......@@ -124,7 +124,7 @@ RECT get_work_area(const RECT *monitor_rect)
work_rect.right = work_rect.left + work_area[i * 4 + 2];
work_rect.bottom = work_rect.top + work_area[i * 4 + 3];
if (IntersectRect(&work_rect, &work_rect, monitor_rect))
if (intersect_rect( &work_rect, &work_rect, monitor_rect ))
{
TRACE("work_rect:%s.\n", wine_dbgstr_rect(&work_rect));
XFree(work_area);
......@@ -146,7 +146,7 @@ RECT get_work_area(const RECT *monitor_rect)
SetRect(&work_rect, work_area[0], work_area[1], work_area[0] + work_area[2],
work_area[1] + work_area[3]);
if (IntersectRect(&work_rect, &work_rect, monitor_rect))
if (intersect_rect( &work_rect, &work_rect, monitor_rect ))
{
TRACE("work_rect:%s.\n", wine_dbgstr_rect(&work_rect));
XFree(work_area);
......
......@@ -147,7 +147,7 @@ void add_device_bounds( X11DRV_PDEVICE *dev, const RECT *rect )
if (!dev->bounds) return;
if (dev->region && NtGdiGetRgnBox( dev->region, &rc ))
{
if (IntersectRect( &rc, &rc, rect )) add_bounds_rect( dev->bounds, &rc );
if (intersect_rect( &rc, &rc, rect )) add_bounds_rect( dev->bounds, &rc );
}
else add_bounds_rect( dev->bounds, rect );
}
......
......@@ -709,7 +709,7 @@ static BOOL overlap_placed_displays(const RECT *rect, const struct x11drv_displa
for (display_idx = 0; display_idx < display_count; ++display_idx)
{
if (displays[display_idx].placed &&
IntersectRect(&intersect, &displays[display_idx].new_rect, rect))
intersect_rect(&intersect, &displays[display_idx].new_rect, rect))
return TRUE;
}
return FALSE;
......
......@@ -2309,7 +2309,7 @@ static inline BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rec
{
*surface_rect = NtUserGetVirtualScreenRect();
if (!IntersectRect( surface_rect, surface_rect, visible_rect )) return FALSE;
if (!intersect_rect( surface_rect, surface_rect, visible_rect )) return FALSE;
OffsetRect( surface_rect, -visible_rect->left, -visible_rect->top );
surface_rect->left &= ~31;
surface_rect->top &= ~31;
......@@ -2761,7 +2761,7 @@ BOOL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
if (info->prcDirty)
{
IntersectRect( &rect, &rect, info->prcDirty );
intersect_rect( &rect, &rect, info->prcDirty );
memcpy( src_bits, dst_bits, bmi->bmiHeader.biSizeImage );
NtGdiPatBlt( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, BLACKNESS );
}
......
......@@ -885,6 +885,15 @@ static inline HWND get_active_window(void)
return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndActive : 0;
}
static inline BOOL intersect_rect( RECT *dst, const RECT *src1, const RECT *src2 )
{
dst->left = max( src1->left, src2->left );
dst->top = max( src1->top, src2->top );
dst->right = min( src1->right, src2->right );
dst->bottom = min( src1->bottom, src2->bottom );
return !IsRectEmpty( dst );
}
/* registry helpers */
extern HKEY open_hkcu_key( const char *name ) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment