Alexandre Julliard : gdi32: Add explicit fields for the DC flags.
Alexandre Julliard
julliard at winehq.org
Tue Apr 10 13:52:33 CDT 2012
Module: wine
Branch: master
Commit: 2776a979315a6217217e332615d10ca11b954a83
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2776a979315a6217217e332615d10ca11b954a83
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Apr 10 13:36:45 2012 +0200
gdi32: Add explicit fields for the DC flags.
---
dlls/gdi32/dc.c | 6 +++---
dlls/gdi32/gdi_private.h | 7 +++----
dlls/gdi32/path.c | 6 +++---
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index aee02c4..478100d 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -1347,7 +1347,7 @@ UINT WINAPI SetBoundsRect(HDC hdc, const RECT* rect, UINT flags)
if ((flags & DCB_ENABLE) && (flags & DCB_DISABLE)) return 0;
if (!(dc = get_dc_ptr( hdc ))) return 0;
- ret = ((dc->flags & DC_BOUNDS_ENABLE) ? DCB_ENABLE : DCB_DISABLE) |
+ ret = (dc->bounds_enabled ? DCB_ENABLE : DCB_DISABLE) |
(is_rect_empty( &dc->BoundsRect ) ? DCB_RESET : DCB_SET);
if (flags & DCB_RESET)
@@ -1376,8 +1376,8 @@ UINT WINAPI SetBoundsRect(HDC hdc, const RECT* rect, UINT flags)
}
}
- if (flags & DCB_ENABLE) dc->flags |= DC_BOUNDS_ENABLE;
- if (flags & DCB_DISABLE) dc->flags &= ~DC_BOUNDS_ENABLE;
+ if (flags & DCB_ENABLE) dc->bounds_enabled = TRUE;
+ if (flags & DCB_DISABLE) dc->bounds_enabled = FALSE;
release_dc_ptr( dc );
return ret;
diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h
index 2053553..5728a53 100644
--- a/dlls/gdi32/gdi_private.h
+++ b/dlls/gdi32/gdi_private.h
@@ -89,6 +89,9 @@ typedef struct tagDC
DWORD_PTR dwHookData;
DCHOOKPROC hookProc; /* DC hook */
+ BOOL bounds_enabled:1; /* bounds tracking is enabled */
+ BOOL path_open:1; /* path is currently open (only for saved DCs) */
+
INT wndOrgX; /* Window origin */
INT wndOrgY;
INT wndExtX; /* Window extent */
@@ -149,10 +152,6 @@ typedef struct tagDC
RECT BoundsRect; /* Current bounding rect */
} DC;
- /* DC flags */
-#define DC_PATH_OPEN 0x0001 /* DC path is open (only set on saved DCs) */
-#define DC_BOUNDS_ENABLE 0x0008 /* Bounding rectangle tracking is enabled */
-
/* Certain functions will do no further processing if the driver returns this.
Used by mfdrv for example. */
#define GDI_NO_MORE_WORK 2
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index 52f103d..058a48a 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -867,7 +867,7 @@ BOOL PATH_SavePath( DC *dst, DC *src )
else if ((physdev = find_path_physdev( src )))
{
if (!(dst->path = copy_gdi_path( physdev->path ))) return FALSE;
- dst->flags |= DC_PATH_OPEN;
+ dst->path_open = TRUE;
}
else dst->path = NULL;
return TRUE;
@@ -877,7 +877,7 @@ BOOL PATH_RestorePath( DC *dst, DC *src )
{
struct path_physdev *physdev = find_path_physdev( dst );
- if (src->path && (src->flags & DC_PATH_OPEN))
+ if (src->path && src->path_open)
{
if (!physdev)
{
@@ -887,7 +887,7 @@ BOOL PATH_RestorePath( DC *dst, DC *src )
else free_gdi_path( physdev->path );
physdev->path = src->path;
- src->flags &= ~DC_PATH_OPEN;
+ src->path_open = FALSE;
src->path = NULL;
}
else if (physdev)
More information about the wine-cvs
mailing list