Alexandre Julliard : gdi32: Don' t clip to the visible rectangle for screen DCs.
Alexandre Julliard
julliard at winehq.org
Tue Feb 14 13:23:31 CST 2012
Module: wine
Branch: master
Commit: b3ab012a424b953c9a8918aa2c1863d9fc760c0e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b3ab012a424b953c9a8918aa2c1863d9fc760c0e
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Feb 13 22:09:23 2012 +0100
gdi32: Don't clip to the visible rectangle for screen DCs.
---
dlls/gdi32/clipping.c | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c
index bb50bec..ef2dc12 100644
--- a/dlls/gdi32/clipping.c
+++ b/dlls/gdi32/clipping.c
@@ -32,11 +32,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(clipping);
/* return the DC visible rectangle if not empty */
static inline BOOL get_dc_visrect( DC *dc, RECT *rect )
{
+ if (dc->header.type != OBJ_MEMDC) return FALSE;
rect->left = 0;
rect->top = 0;
rect->right = dc->vis_rect.right - dc->vis_rect.left;
rect->bottom = dc->vis_rect.bottom - dc->vis_rect.top;
- return !is_rect_empty( rect );
+ return TRUE;
}
/***********************************************************************
@@ -114,19 +115,16 @@ void update_dc_clipping( DC * dc )
*/
static inline void create_default_clip_region( DC * dc )
{
- UINT width, height;
+ RECT rect;
- if (dc->header.type == OBJ_MEMDC)
- {
- width = dc->vis_rect.right - dc->vis_rect.left;
- height = dc->vis_rect.bottom - dc->vis_rect.top;
- }
- else
+ if (!get_dc_visrect( dc, &rect ))
{
- width = GetDeviceCaps( dc->hSelf, DESKTOPHORZRES );
- height = GetDeviceCaps( dc->hSelf, DESKTOPVERTRES );
+ rect.left = 0;
+ rect.top = 0;
+ rect.right = GetDeviceCaps( dc->hSelf, DESKTOPHORZRES );
+ rect.bottom = GetDeviceCaps( dc->hSelf, DESKTOPVERTRES );
}
- dc->hClipRgn = CreateRectRgn( 0, 0, width, height );
+ dc->hClipRgn = CreateRectRgnIndirect( &rect );
}
@@ -363,9 +361,9 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y )
pt.y = y;
LPtoDP( hdc, &pt, 1 );
update_dc( dc );
- ret = (get_dc_visrect( dc, &visrect ) &&
- pt.x >= visrect.left && pt.x < visrect.right &&
- pt.y >= visrect.top && pt.y < visrect.bottom);
+ ret = (!get_dc_visrect( dc, &visrect ) ||
+ (pt.x >= visrect.left && pt.x < visrect.right &&
+ pt.y >= visrect.top && pt.y < visrect.bottom));
if (ret && get_dc_region( dc )) ret = PtInRegion( get_dc_region( dc ), pt.x, pt.y );
release_dc_ptr( dc );
return ret;
@@ -387,7 +385,7 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect )
LPtoDP( hdc, (POINT *)&tmpRect, 2 );
update_dc( dc );
- ret = (get_dc_visrect( dc, &visrect ) && intersect_rect( &visrect, &visrect, &tmpRect ));
+ ret = (!get_dc_visrect( dc, &visrect ) || intersect_rect( &visrect, &visrect, &tmpRect ));
if (ret && get_dc_region( dc )) ret = RectInRegion( get_dc_region( dc ), &tmpRect );
release_dc_ptr( dc );
return ret;
More information about the wine-cvs
mailing list