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
1e3c47ea
Commit
1e3c47ea
authored
Feb 05, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Get rid of DC_GetDCPtr in the palette functions.
parent
608b2a94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
21 deletions
+18
-21
palette.c
dlls/gdi32/palette.c
+18
-21
No files found.
dlls/gdi32/palette.c
View file @
1e3c47ea
...
...
@@ -515,11 +515,11 @@ UINT WINAPI GetSystemPaletteEntries(
TRACE
(
"hdc=%p,start=%i,count=%i
\n
"
,
hdc
,
start
,
count
);
if
((
dc
=
DC_GetDCP
tr
(
hdc
)))
if
((
dc
=
get_dc_p
tr
(
hdc
)))
{
if
(
dc
->
funcs
->
pGetSystemPaletteEntries
)
ret
=
dc
->
funcs
->
pGetSystemPaletteEntries
(
dc
->
physDev
,
start
,
count
,
entries
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
}
return
ret
;
}
...
...
@@ -584,18 +584,18 @@ COLORREF WINAPI GetNearestColor(
COLORREF
nearest
;
DC
*
dc
;
if
(
!
(
dc
=
DC_GetDCP
tr
(
hdc
)))
return
CLR_INVALID
;
if
(
!
(
dc
=
get_dc_p
tr
(
hdc
)))
return
CLR_INVALID
;
if
(
dc
->
funcs
->
pGetNearestColor
)
{
nearest
=
dc
->
funcs
->
pGetNearestColor
(
dc
->
physDev
,
color
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
nearest
;
}
if
(
!
(
GetDeviceCaps
(
hdc
,
RASTERCAPS
)
&
RC_PALETTE
))
{
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
color
;
}
...
...
@@ -618,14 +618,14 @@ COLORREF WINAPI GetNearestColor(
WARN
(
"RGB(%x) : idx %d is out of bounds, assuming NULL
\n
"
,
color
,
index
);
if
(
!
GetPaletteEntries
(
hpal
,
0
,
1
,
&
entry
))
{
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
CLR_INVALID
;
}
}
color
=
RGB
(
entry
.
peRed
,
entry
.
peGreen
,
entry
.
peBlue
);
}
nearest
=
color
&
0x00ffffff
;
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
TRACE
(
"(%06x): returning %06x
\n
"
,
color
,
nearest
);
return
nearest
;
...
...
@@ -662,11 +662,9 @@ static BOOL PALETTE_UnrealizeObject( HGDIOBJ handle, void *obj )
palette
->
funcs
=
NULL
;
}
if
(
hLastRealizedPalette
==
handle
)
{
if
(
InterlockedCompareExchangePointer
(
(
void
**
)
&
hLastRealizedPalette
,
0
,
handle
)
==
handle
)
TRACE
(
"unrealizing palette %p
\n
"
,
handle
);
hLastRealizedPalette
=
0
;
}
return
TRUE
;
}
...
...
@@ -696,7 +694,7 @@ HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg)
WARN
(
"invalid selected palette %p
\n
"
,
hpal
);
return
0
;
}
if
(
!
(
dc
=
DC_GetDCP
tr
(
hdc
)))
return
0
;
if
(
!
(
dc
=
get_dc_p
tr
(
hdc
)))
return
0
;
ret
=
dc
->
hPalette
;
if
(
dc
->
funcs
->
pSelectPalette
)
hpal
=
dc
->
funcs
->
pSelectPalette
(
dc
->
physDev
,
hpal
,
FALSE
);
if
(
hpal
)
...
...
@@ -705,7 +703,7 @@ HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg)
if
(
!
wBkg
)
hPrimaryPalette
=
hpal
;
}
else
ret
=
0
;
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
@@ -716,7 +714,7 @@ HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg)
UINT
WINAPI
GDIRealizePalette
(
HDC
hdc
)
{
UINT
realized
=
0
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
0
;
...
...
@@ -727,7 +725,7 @@ UINT WINAPI GDIRealizePalette( HDC hdc )
if
(
dc
->
funcs
->
pRealizeDefaultPalette
)
realized
=
dc
->
funcs
->
pRealizeDefaultPalette
(
dc
->
physDev
);
}
else
if
(
dc
->
hPalette
!=
hLastRealizedPalette
)
else
if
(
InterlockedExchangePointer
(
(
void
**
)
&
hLastRealizedPalette
,
dc
->
hPalette
)
!=
dc
->
hPalette
)
{
if
(
dc
->
funcs
->
pRealizePalette
)
{
...
...
@@ -740,11 +738,10 @@ UINT WINAPI GDIRealizePalette( HDC hdc )
GDI_ReleaseObj
(
dc
->
hPalette
);
}
}
hLastRealizedPalette
=
dc
->
hPalette
;
}
else
TRACE
(
" skipping (hLastRealizedPalette = %p)
\n
"
,
hLastRealizedPalette
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
TRACE
(
" realized %i colors.
\n
"
,
realized
);
return
realized
;
}
...
...
@@ -760,10 +757,10 @@ UINT16 WINAPI RealizeDefaultPalette16( HDC16 hdc )
TRACE
(
"%04x
\n
"
,
hdc
);
if
(
!
(
dc
=
DC_GetDCP
tr
(
HDC_32
(
hdc
)
)))
return
0
;
if
(
!
(
dc
=
get_dc_p
tr
(
HDC_32
(
hdc
)
)))
return
0
;
if
(
dc
->
funcs
->
pRealizeDefaultPalette
)
ret
=
dc
->
funcs
->
pRealizeDefaultPalette
(
dc
->
physDev
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
@@ -772,11 +769,11 @@ UINT16 WINAPI RealizeDefaultPalette16( HDC16 hdc )
*/
BOOL16
WINAPI
IsDCCurrentPalette16
(
HDC16
hDC
)
{
DC
*
dc
=
DC_GetDCP
tr
(
HDC_32
(
hDC
)
);
DC
*
dc
=
get_dc_p
tr
(
HDC_32
(
hDC
)
);
if
(
dc
)
{
BOOL
bRet
=
dc
->
hPalette
==
hPrimaryPalette
;
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
bRet
;
}
return
FALSE
;
...
...
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