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
99a25831
Commit
99a25831
authored
Sep 17, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Replace remaining instance of DC_GetDCUpdate by get_dc_ptr+update_dc.
parent
baa8d225
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
56 deletions
+32
-56
dc.c
dlls/gdi32/dc.c
+21
-47
font.c
dlls/gdi32/font.c
+5
-4
opengl.c
dlls/gdi32/opengl.c
+6
-5
No files found.
dlls/gdi32/dc.c
View file @
99a25831
...
...
@@ -177,32 +177,6 @@ DC *DC_GetDCPtr( HDC hdc )
return
dc
;
}
/***********************************************************************
* DC_GetDCUpdate
*
* Retrieve a DC ptr while making sure the visRgn is updated.
* This function may call up to USER so the GDI lock should _not_
* be held when calling it.
*/
DC
*
DC_GetDCUpdate
(
HDC
hdc
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
NULL
;
while
(
InterlockedExchange
(
&
dc
->
dirty
,
0
))
{
DCHOOKPROC
proc
=
dc
->
hookThunk
;
if
(
proc
)
{
DWORD_PTR
data
=
dc
->
dwHookData
;
DC_ReleaseDCPtr
(
dc
);
proc
(
hdc
,
DCHC_INVALIDVISRGN
,
data
,
0
);
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
break
;
/* otherwise restart the loop in case it became dirty again in the meantime */
}
}
return
dc
;
}
/***********************************************************************
* DC_ReleaseDCPtr
...
...
@@ -488,20 +462,21 @@ void WINAPI SetDCState( HDC hdc, HDC hdcs )
{
DC
*
dc
,
*
dcs
;
if
(
!
(
dc
=
DC_GetDCUpdate
(
hdc
)))
return
;
if
(
!
(
dcs
=
DC_GetDCP
tr
(
hdcs
)))
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
return
;
if
(
!
(
dcs
=
get_dc_p
tr
(
hdcs
)))
{
DC_ReleaseDCP
tr
(
dc
);
return
;
release_dc_p
tr
(
dc
);
return
;
}
if
(
!
dcs
->
flags
&
DC_SAVED
)
{
DC_ReleaseDCP
tr
(
dc
);
DC_ReleaseDCP
tr
(
dcs
);
return
;
release_dc_p
tr
(
dc
);
release_dc_p
tr
(
dcs
);
return
;
}
TRACE
(
"%p %p
\n
"
,
hdc
,
hdcs
);
update_dc
(
dc
);
dc
->
flags
=
dcs
->
flags
&
~
DC_SAVED
;
dc
->
layout
=
dcs
->
layout
;
dc
->
hDevice
=
dcs
->
hDevice
;
...
...
@@ -569,8 +544,8 @@ void WINAPI SetDCState( HDC hdc, HDC hdcs )
SetBkColor
(
hdc
,
dcs
->
backgroundColor
);
SetTextColor
(
hdc
,
dcs
->
textColor
);
GDISelectPalette
(
hdc
,
dcs
->
hPalette
,
FALSE
);
DC_ReleaseDCPtr
(
dcs
);
DC_ReleaseDCPtr
(
dc
);
release_dc_ptr
(
dc
);
release_dc_ptr
(
dcs
);
}
...
...
@@ -653,22 +628,23 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level )
BOOL
success
;
TRACE
(
"%p %d
\n
"
,
hdc
,
level
);
dc
=
DC_GetDCUpdate
(
hdc
);
if
(
!
dc
)
return
FALSE
;
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
return
FALSE
;
if
(
abs
(
level
)
>
dc
->
saveLevel
||
level
==
0
)
{
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
FALSE
;
}
update_dc
(
dc
);
if
(
dc
->
funcs
->
pRestoreDC
)
{
success
=
dc
->
funcs
->
pRestoreDC
(
dc
->
physDev
,
level
);
if
(
level
<
0
)
level
=
dc
->
saveLevel
+
level
+
1
;
if
(
success
)
dc
->
saveLevel
=
level
-
1
;
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
success
;
}
...
...
@@ -677,10 +653,10 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level )
while
(
dc
->
saveLevel
>=
level
)
{
HDC
hdcs
=
dc
->
saved_dc
;
if
(
!
(
dcs
=
DC_GetDCP
tr
(
hdcs
)))
if
(
!
(
dcs
=
get_dc_p
tr
(
hdcs
)))
{
DC_ReleaseDCPtr
(
dc
)
;
return
FALSE
;
success
=
FALSE
;
break
;
}
dc
->
saved_dc
=
dcs
->
saved_dc
;
dcs
->
saved_dc
=
0
;
...
...
@@ -692,12 +668,10 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level )
* returning FALSE but still destroying the saved DC state */
success
=
FALSE
;
}
DC_ReleaseDCPtr
(
dcs
);
DC_ReleaseDCPtr
(
dc
);
release_dc_ptr
(
dcs
);
DeleteDC
(
hdcs
);
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
return
FALSE
;
}
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
success
;
}
...
...
dlls/gdi32/font.c
View file @
99a25831
...
...
@@ -1879,7 +1879,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
BOOL
done_extents
=
FALSE
;
INT
width
=
0
,
xwidth
=
0
,
ywidth
=
0
;
DWORD
type
;
DC
*
dc
=
DC_GetDCUpdate
(
hdc
);
DC
*
dc
=
get_dc_ptr
(
hdc
);
INT
breakRem
;
if
(
!
dc
)
return
FALSE
;
...
...
@@ -1891,15 +1891,16 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
if
(
!
dc
->
funcs
->
pExtTextOut
&&
!
PATH_IsPathOpen
(
dc
->
path
))
{
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
update_dc
(
dc
);
type
=
GetObjectType
(
hdc
);
if
(
type
==
OBJ_METADC
||
type
==
OBJ_ENHMETADC
)
{
ret
=
dc
->
funcs
->
pExtTextOut
(
dc
->
physDev
,
x
,
y
,
flags
,
lprect
,
str
,
count
,
lpDx
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
@@ -2198,7 +2199,7 @@ done:
if
(
reordered_str
!=
str
)
HeapFree
(
GetProcessHeap
(),
0
,
reordered_str
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
if
(
ret
&&
(
lf
.
lfUnderline
||
lf
.
lfStrikeOut
))
{
...
...
dlls/gdi32/opengl.c
View file @
99a25831
...
...
@@ -55,8 +55,8 @@ static DC* OPENGL_GetDefaultDC(void)
{
if
(
!
default_hdc
)
default_hdc
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
return
DC_GetDCP
tr
(
default_hdc
);
return
get_dc_p
tr
(
default_hdc
);
}
/***********************************************************************
...
...
@@ -169,16 +169,17 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
if
(
hglrc
==
NULL
)
dc
=
OPENGL_GetDefaultDC
();
else
dc
=
DC_GetDCUpdate
(
hdc
);
dc
=
get_dc_ptr
(
hdc
);
TRACE
(
"hdc: (%p), hglrc: (%p)
\n
"
,
hdc
,
hglrc
);
if
(
!
dc
)
return
FALSE
;
update_dc
(
dc
);
if
(
!
dc
->
funcs
->
pwglMakeCurrent
)
FIXME
(
" :stub
\n
"
);
else
ret
=
dc
->
funcs
->
pwglMakeCurrent
(
dc
->
physDev
,
hglrc
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
@@ -294,7 +295,7 @@ PROC WINAPI wglGetProcAddress(LPCSTR func)
if
(
!
dc
->
funcs
->
pwglGetProcAddress
)
FIXME
(
" :stub
\n
"
);
else
ret
=
dc
->
funcs
->
pwglGetProcAddress
(
func
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
/* At the moment we implement one WGL extension which requires a HDC. When we
* are looking up this call and when the Extension is available (that is the case
...
...
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