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
476a1fa1
Commit
476a1fa1
authored
Jul 11, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Fill in the color table in Get/PutImage for 4 and 8 bpp.
parent
be74c47e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
11 deletions
+30
-11
bitblt.c
dlls/winex11.drv/bitblt.c
+30
-11
No files found.
dlls/winex11.drv/bitblt.c
View file @
476a1fa1
...
...
@@ -1614,27 +1614,47 @@ static void free_ximage_bits( struct gdi_image_bits *bits )
}
/* store the palette or color mask data in the bitmap info structure */
static
void
set_color_info
(
const
ColorShifts
*
color_shifts
,
BITMAPINFO
*
info
)
static
void
set_color_info
(
PHYSDEV
dev
,
const
ColorShifts
*
color_shifts
,
BITMAPINFO
*
info
)
{
DWORD
*
colors
=
(
DWORD
*
)((
char
*
)
info
+
info
->
bmiHeader
.
biSize
);
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
info
->
bmiHeader
.
biClrUsed
=
0
;
switch
(
info
->
bmiHeader
.
biBitCount
)
{
case
1
:
case
4
:
case
8
:
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
/* FIXME: set color palette */
{
RGBQUAD
*
rgb
=
(
RGBQUAD
*
)
colors
;
PALETTEENTRY
palette
[
256
];
UINT
i
,
count
;
info
->
bmiHeader
.
biClrUsed
=
1
<<
info
->
bmiHeader
.
biBitCount
;
count
=
X11DRV_GetSystemPaletteEntries
(
dev
,
0
,
info
->
bmiHeader
.
biClrUsed
,
palette
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
rgb
[
i
].
rgbRed
=
palette
[
i
].
peRed
;
rgb
[
i
].
rgbGreen
=
palette
[
i
].
peGreen
;
rgb
[
i
].
rgbBlue
=
palette
[
i
].
peBlue
;
rgb
[
i
].
rgbReserved
=
0
;
}
memset
(
&
rgb
[
count
],
0
,
(
info
->
bmiHeader
.
biClrUsed
-
count
)
*
sizeof
(
*
rgb
)
);
break
;
}
case
16
:
case
32
:
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
colors
[
0
]
=
color_shifts
->
logicalRed
.
max
<<
color_shifts
->
logicalRed
.
shift
;
colors
[
1
]
=
color_shifts
->
logicalGreen
.
max
<<
color_shifts
->
logicalGreen
.
shift
;
colors
[
2
]
=
color_shifts
->
logicalBlue
.
max
<<
color_shifts
->
logicalBlue
.
shift
;
if
(
colors
[
0
]
!=
0x7c00
||
colors
[
1
]
!=
0x03e0
||
colors
[
2
]
!=
0x001f
)
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
break
;
case
24
:
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
case
32
:
colors
[
0
]
=
color_shifts
->
logicalRed
.
max
<<
color_shifts
->
logicalRed
.
shift
;
colors
[
1
]
=
color_shifts
->
logicalGreen
.
max
<<
color_shifts
->
logicalGreen
.
shift
;
colors
[
2
]
=
color_shifts
->
logicalBlue
.
max
<<
color_shifts
->
logicalBlue
.
shift
;
if
(
colors
[
0
]
!=
0xff0000
||
colors
[
1
]
!=
0x00ff00
||
colors
[
2
]
!=
0x0000ff
)
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
break
;
}
}
...
...
@@ -1931,7 +1951,7 @@ update_format:
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biBitCount
=
format
->
bits_per_pixel
;
if
(
info
->
bmiHeader
.
biHeight
>
0
)
info
->
bmiHeader
.
biHeight
=
-
info
->
bmiHeader
.
biHeight
;
set_color_info
(
physdev
->
color_shifts
,
info
);
set_color_info
(
dev
,
physdev
->
color_shifts
,
info
);
return
ERROR_BAD_FORMAT
;
}
...
...
@@ -2035,9 +2055,8 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
info
->
bmiHeader
.
biSizeImage
=
height
*
image
->
bytes_per_line
;
info
->
bmiHeader
.
biXPelsPerMeter
=
0
;
info
->
bmiHeader
.
biYPelsPerMeter
=
0
;
info
->
bmiHeader
.
biClrUsed
=
0
;
info
->
bmiHeader
.
biClrImportant
=
0
;
set_color_info
(
color_shifts
,
info
);
set_color_info
(
dev
,
color_shifts
,
info
);
src_bits
.
ptr
=
image
->
data
;
src_bits
.
is_copy
=
TRUE
;
...
...
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