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
8cc8552a
Commit
8cc8552a
authored
Jul 22, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Jul 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a helper to fill out the colour table from the current palette.
parent
6ce6f890
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
+25
-12
dib.c
dlls/gdi32/dib.c
+25
-12
No files found.
dlls/gdi32/dib.c
View file @
8cc8552a
...
...
@@ -209,6 +209,30 @@ static BOOL bitmapinfo_from_user_bitmapinfo( BITMAPINFO *dst, const BITMAPINFO *
return
TRUE
;
}
static
int
fill_color_table_from_palette
(
BITMAPINFO
*
info
,
DC
*
dc
)
{
PALETTEENTRY
palEntry
[
256
];
int
i
,
colors
=
(
info
->
bmiHeader
.
biBitCount
>
8
)
?
0
:
1
<<
info
->
bmiHeader
.
biBitCount
;
if
(
info
->
bmiHeader
.
biClrUsed
)
colors
=
info
->
bmiHeader
.
biClrUsed
;
if
(
!
colors
)
return
0
;
memset
(
palEntry
,
0
,
sizeof
(
palEntry
)
);
if
(
!
GetPaletteEntries
(
dc
->
hPalette
,
0
,
colors
,
palEntry
))
return
0
;
for
(
i
=
0
;
i
<
colors
;
i
++
)
{
info
->
bmiColors
[
i
].
rgbRed
=
palEntry
[
i
].
peRed
;
info
->
bmiColors
[
i
].
rgbGreen
=
palEntry
[
i
].
peGreen
;
info
->
bmiColors
[
i
].
rgbBlue
=
palEntry
[
i
].
peBlue
;
info
->
bmiColors
[
i
].
rgbReserved
=
0
;
}
return
colors
;
}
/* nulldrv fallback implementation using SetDIBits/StretchBlt */
INT
nulldrv_StretchDIBits
(
PHYSDEV
dev
,
INT
xDst
,
INT
yDst
,
INT
widthDst
,
INT
heightDst
,
INT
xSrc
,
INT
ySrc
,
INT
widthSrc
,
INT
heightSrc
,
const
void
*
bits
,
...
...
@@ -715,22 +739,11 @@ INT WINAPI GetDIBits(
case we'll fix up the indices after the format conversion. */
else
if
(
(
bpp
>
1
&&
bpp
==
bmp
->
bitmap
.
bmBitsPixel
)
||
coloruse
==
DIB_PAL_COLORS
)
{
PALETTEENTRY
palEntry
[
256
];
memset
(
palEntry
,
0
,
sizeof
(
palEntry
)
);
if
(
!
GetPaletteEntries
(
dc
->
hPalette
,
0
,
colors
,
palEntry
))
if
(
!
fill_color_table_from_palette
(
dst_info
,
dc
))
{
lines
=
0
;
goto
done
;
}
for
(
i
=
0
;
i
<
colors
;
i
++
)
{
dst_info
->
bmiColors
[
i
].
rgbRed
=
palEntry
[
i
].
peRed
;
dst_info
->
bmiColors
[
i
].
rgbGreen
=
palEntry
[
i
].
peGreen
;
dst_info
->
bmiColors
[
i
].
rgbBlue
=
palEntry
[
i
].
peBlue
;
dst_info
->
bmiColors
[
i
].
rgbReserved
=
0
;
}
}
else
fill_default_color_table
(
dst_info
);
...
...
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