Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
2e693d00
Commit
2e693d00
authored
Oct 17, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Store the HDC list directly in the GDI handle table.
parent
cf3cafdc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
57 deletions
+41
-57
gdi_private.h
dlls/gdi32/gdi_private.h
+2
-9
gdiobj.c
dlls/gdi32/gdiobj.c
+39
-48
No files found.
dlls/gdi32/gdi_private.h
View file @
2e693d00
...
...
@@ -57,18 +57,11 @@ struct gdi_obj_funcs
BOOL
(
*
pDeleteObject
)(
HGDIOBJ
handle
);
};
struct
hdc_list
{
HDC
hdc
;
struct
hdc_list
*
next
;
};
typedef
struct
tagGDIOBJHDR
{
WORD
system
:
1
;
/* system object flag */
WORD
deleted
:
1
;
/* whether DeleteObject has been called on this object */
DWORD
selcount
;
/* number of times the object is selected in a DC */
struct
hdc_list
*
hdcs
;
}
GDIOBJHDR
;
typedef
struct
tagGdiFont
GdiFont
;
...
...
@@ -325,8 +318,8 @@ extern void GDI_ReleaseObj( HGDIOBJ ) DECLSPEC_HIDDEN;
extern
void
GDI_CheckNotLock
(
void
)
DECLSPEC_HIDDEN
;
extern
HGDIOBJ
GDI_inc_ref_count
(
HGDIOBJ
handle
)
DECLSPEC_HIDDEN
;
extern
BOOL
GDI_dec_ref_count
(
HGDIOBJ
handle
)
DECLSPEC_HIDDEN
;
extern
BOOL
GDI_hdc_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
DECLSPEC_HIDDEN
;
extern
BOOL
GDI_hdc_not_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
DECLSPEC_HIDDEN
;
extern
void
GDI_hdc_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
DECLSPEC_HIDDEN
;
extern
void
GDI_hdc_not_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
DECLSPEC_HIDDEN
;
/* metafile.c */
extern
HMETAFILE
MF_Create_HMETAFILE
(
METAHEADER
*
mh
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/gdiobj.c
View file @
2e693d00
...
...
@@ -41,10 +41,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdi);
#define FIRST_GDI_HANDLE 16
#define MAX_GDI_HANDLES 16384
struct
hdc_list
{
HDC
hdc
;
struct
hdc_list
*
next
;
};
struct
gdi_handle_entry
{
GDIOBJHDR
*
obj
;
/* pointer to the object-specific data */
const
struct
gdi_obj_funcs
*
funcs
;
/* type-specific functions */
struct
hdc_list
*
hdcs
;
/* list of HDCs interested in this object */
WORD
type
;
/* object type (one of the OBJ_* constants) */
};
...
...
@@ -683,7 +690,6 @@ HGDIOBJ alloc_gdi_handle( GDIOBJHDR *obj, WORD type, const struct gdi_obj_funcs
obj
->
system
=
0
;
obj
->
deleted
=
0
;
obj
->
selcount
=
0
;
obj
->
hdcs
=
NULL
;
EnterCriticalSection
(
&
gdi_section
);
for
(
i
=
next_gdi_handle
+
1
;
i
<
MAX_GDI_HANDLES
;
i
++
)
...
...
@@ -700,6 +706,7 @@ HGDIOBJ alloc_gdi_handle( GDIOBJHDR *obj, WORD type, const struct gdi_obj_funcs
entry
=
&
gdi_handles
[
i
];
entry
->
obj
=
obj
;
entry
->
funcs
=
funcs
;
entry
->
hdcs
=
NULL
;
entry
->
type
=
type
;
next_gdi_handle
=
i
;
ret
=
entry_to_handle
(
entry
);
...
...
@@ -819,11 +826,11 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj )
return
TRUE
;
}
while
((
hdcs_head
=
entry
->
obj
->
hdcs
)
!=
NULL
)
while
((
hdcs_head
=
entry
->
hdcs
)
!=
NULL
)
{
DC
*
dc
=
get_dc_ptr
(
hdcs_head
->
hdc
);
entry
->
obj
->
hdcs
=
hdcs_head
->
next
;
entry
->
hdcs
=
hdcs_head
->
next
;
TRACE
(
"hdc %p has interest in %p
\n
"
,
hdcs_head
->
hdc
,
obj
);
if
(
dc
)
...
...
@@ -861,70 +868,54 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj )
*
* Call this if the dc requires DeleteObject notification
*/
BOOL
GDI_hdc_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
void
GDI_hdc_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
{
GDIOBJHDR
*
header
;
struct
hdc_list
*
*
p
phdc
;
struct
gdi_handle_entry
*
entry
;
struct
hdc_list
*
phdc
;
TRACE
(
"obj %p hdc %p
\n
"
,
obj
,
hdc
);
if
(
!
(
header
=
GDI_GetObjPtr
(
obj
,
0
)))
return
FALSE
;
if
(
header
->
system
)
EnterCriticalSection
(
&
gdi_section
);
if
((
entry
=
handle_entry
(
obj
))
&&
!
entry
->
obj
->
system
)
{
GDI_ReleaseObj
(
obj
);
return
FALSE
;
}
for
(
pphdc
=
&
header
->
hdcs
;
*
pphdc
;
pphdc
=
&
(
*
pphdc
)
->
next
)
if
((
*
pphdc
)
->
hdc
==
hdc
)
break
;
for
(
phdc
=
entry
->
hdcs
;
phdc
;
phdc
=
phdc
->
next
)
if
(
phdc
->
hdc
==
hdc
)
break
;
if
(
!*
pphdc
)
{
*
pphdc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
**
pphdc
));
(
*
pphdc
)
->
hdc
=
hdc
;
(
*
pphdc
)
->
next
=
NULL
;
if
(
!
phdc
)
{
phdc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
phdc
));
phdc
->
hdc
=
hdc
;
phdc
->
next
=
entry
->
hdcs
;
entry
->
hdcs
=
phdc
;
}
}
GDI_ReleaseObj
(
obj
);
return
TRUE
;
LeaveCriticalSection
(
&
gdi_section
);
}
/***********************************************************************
* GDI_hdc_not_using_object
*
*/
BOOL
GDI_hdc_not_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
void
GDI_hdc_not_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
{
GDIOBJHDR
*
header
;
struct
hdc_list
*
phdc
,
**
prev
;
struct
gdi_handle_entry
*
entry
;
struct
hdc_list
*
*
pphdc
;
TRACE
(
"obj %p hdc %p
\n
"
,
obj
,
hdc
);
if
(
!
(
header
=
GDI_GetObjPtr
(
obj
,
0
)))
return
FALSE
;
if
(
header
->
system
)
EnterCriticalSection
(
&
gdi_section
);
if
((
entry
=
handle_entry
(
obj
))
&&
!
entry
->
obj
->
system
)
{
GDI_ReleaseObj
(
obj
);
return
FALSE
;
for
(
pphdc
=
&
entry
->
hdcs
;
*
pphdc
;
pphdc
=
&
(
*
pphdc
)
->
next
)
if
((
*
pphdc
)
->
hdc
==
hdc
)
{
struct
hdc_list
*
phdc
=
*
pphdc
;
*
pphdc
=
phdc
->
next
;
HeapFree
(
GetProcessHeap
(),
0
,
phdc
);
break
;
}
}
phdc
=
header
->
hdcs
;
prev
=
&
header
->
hdcs
;
while
(
phdc
)
{
if
(
phdc
->
hdc
==
hdc
)
{
*
prev
=
phdc
->
next
;
HeapFree
(
GetProcessHeap
(),
0
,
phdc
);
phdc
=
*
prev
;
}
else
{
prev
=
&
phdc
->
next
;
phdc
=
phdc
->
next
;
}
}
GDI_ReleaseObj
(
obj
);
return
TRUE
;
LeaveCriticalSection
(
&
gdi_section
);
}
/***********************************************************************
...
...
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