Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5e6461b6
Commit
5e6461b6
authored
Mar 25, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explicitly store the stack of saved DCs in the DC structure instead of
using the 16-bit hNext field in the object header.
parent
0afa832f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
24 deletions
+16
-24
dc.c
dlls/gdi/dc.c
+12
-9
gdi_private.h
dlls/gdi/gdi_private.h
+1
-0
gdiobj.c
dlls/gdi/gdiobj.c
+3
-14
gdi.h
include/gdi.h
+0
-1
No files found.
dlls/gdi/dc.c
View file @
5e6461b6
...
...
@@ -64,6 +64,7 @@ DC *DC_AllocDC( const DC_FUNCTIONS *funcs, WORD magic )
dc
->
funcs
=
funcs
;
dc
->
physDev
=
NULL
;
dc
->
saveLevel
=
0
;
dc
->
saved_dc
=
0
;
dc
->
dwHookData
=
0
;
dc
->
hookProc
=
NULL
;
dc
->
hookThunk
=
NULL
;
...
...
@@ -335,6 +336,7 @@ HDC WINAPI GetDCState( HDC hdc )
newdc
->
hSelf
=
(
HDC
)
handle
;
newdc
->
saveLevel
=
0
;
newdc
->
saved_dc
=
0
;
PATH_InitGdiPath
(
&
newdc
->
path
);
...
...
@@ -506,8 +508,8 @@ INT WINAPI SaveDC( HDC hdc )
return
0
;
}
dcs
->
header
.
hNext
=
dc
->
header
.
hNext
;
dc
->
header
.
hNext
=
HDC_16
(
hdcs
)
;
dcs
->
saved_dc
=
dc
->
saved_dc
;
dc
->
saved_dc
=
hdcs
;
TRACE
(
"(%p): returning %d
\n
"
,
hdc
,
dc
->
saveLevel
+
1
);
ret
=
++
dc
->
saveLevel
;
GDI_ReleaseObj
(
hdcs
);
...
...
@@ -550,13 +552,14 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level )
success
=
TRUE
;
while
(
dc
->
saveLevel
>=
level
)
{
HDC
hdcs
=
HDC_32
(
dc
->
header
.
hNext
)
;
HDC
hdcs
=
dc
->
saved_dc
;
if
(
!
(
dcs
=
DC_GetDCPtr
(
hdcs
)))
{
GDI_ReleaseObj
(
hdc
);
return
FALSE
;
}
dc
->
header
.
hNext
=
dcs
->
header
.
hNext
;
dc
->
saved_dc
=
dcs
->
saved_dc
;
dcs
->
saved_dc
=
0
;
if
(
--
dc
->
saveLevel
<
level
)
{
SetDCState
(
hdc
,
hdcs
);
...
...
@@ -768,11 +771,11 @@ BOOL WINAPI DeleteDC( HDC hdc )
while
(
dc
->
saveLevel
)
{
DC
*
dcs
;
HDC
hdcs
=
HDC_32
(
dc
->
header
.
hNext
)
;
if
(
!
(
dcs
=
DC_GetDCPtr
(
hdcs
)))
break
;
dc
->
header
.
hNext
=
dcs
->
header
.
hNext
;
dc
->
saveLevel
--
;
DC
*
dcs
;
HDC
hdcs
=
dc
->
saved_dc
;
if
(
!
(
dcs
=
DC_GetDCPtr
(
hdcs
)))
break
;
dc
->
saved_dc
=
dcs
->
saved_dc
;
dc
->
saveLevel
--
;
if
(
dcs
->
hClipRgn
)
DeleteObject
(
dcs
->
hClipRgn
);
if
(
dcs
->
hVisRgn
)
DeleteObject
(
dcs
->
hVisRgn
);
PATH_DestroyGdiPath
(
&
dcs
->
path
);
...
...
dlls/gdi/gdi_private.h
View file @
5e6461b6
...
...
@@ -209,6 +209,7 @@ typedef struct tagDC
const
struct
tagDC_FUNCS
*
funcs
;
/* DC function table */
PHYSDEV
physDev
;
/* Physical device (driver-specific) */
INT
saveLevel
;
HDC
saved_dc
;
DWORD
dwHookData
;
FARPROC16
hookProc
;
/* the original SEGPTR ... */
DCHOOKPROC
hookThunk
;
/* ... and the thunk to call it */
...
...
dlls/gdi/gdiobj.c
View file @
5e6461b6
...
...
@@ -723,7 +723,8 @@ void *GDI_AllocObject( WORD size, WORD magic, HGDIOBJ *handle, const struct gdi_
_EnterSysLevel
(
&
GDI_level
);
switch
(
magic
)
{
default:
case
PEN_MAGIC
:
case
BRUSH_MAGIC
:
if
(
GDI_HeapSel
)
{
if
(
!
(
hlocal
=
LOCAL_Alloc
(
GDI_HeapSel
,
LMEM_MOVEABLE
,
size
)))
goto
error
;
...
...
@@ -733,23 +734,11 @@ void *GDI_AllocObject( WORD size, WORD magic, HGDIOBJ *handle, const struct gdi_
break
;
}
/* fall through */
case
DC_MAGIC
:
case
DISABLED_DC_MAGIC
:
case
META_DC_MAGIC
:
case
METAFILE_MAGIC
:
case
METAFILE_DC_MAGIC
:
case
ENHMETAFILE_MAGIC
:
case
ENHMETAFILE_DC_MAGIC
:
case
MEMORY_DC_MAGIC
:
case
BITMAP_MAGIC
:
case
PALETTE_MAGIC
:
case
FONT_MAGIC
:
case
REGION_MAGIC
:
default:
if
(
!
(
obj
=
alloc_large_heap
(
size
,
handle
)))
goto
error
;
break
;
}
obj
->
hNext
=
0
;
obj
->
wMagic
=
magic
|
OBJECT_NOSYSTEM
;
obj
->
dwCount
=
0
;
obj
->
funcs
=
funcs
;
...
...
include/gdi.h
View file @
5e6461b6
...
...
@@ -59,7 +59,6 @@ struct hdc_list;
typedef
struct
tagGDIOBJHDR
{
HANDLE16
hNext
;
WORD
wMagic
;
DWORD
dwCount
;
const
struct
gdi_obj_funcs
*
funcs
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment