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
aa34b2fb
Commit
aa34b2fb
authored
Jun 28, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Jun 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Construct the EGA palette from the default palette.
parent
8669fa73
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
29 deletions
+46
-29
dib.c
dlls/gdi32/dib.c
+6
-27
bitmap.c
dlls/gdi32/tests/bitmap.c
+40
-2
No files found.
dlls/gdi32/dib.c
View file @
aa34b2fb
...
...
@@ -415,32 +415,6 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col
return
result
;
}
/* FIXME the following two structs should be combined with __sysPalTemplate in
objects/color.c - this should happen after de-X11-ing both of these
files.
NB. RGBQUAD and PALETTEENTRY have different orderings of red, green
and blue - sigh */
static
const
RGBQUAD
EGAColorsQuads
[
16
]
=
{
/* rgbBlue, rgbGreen, rgbRed, rgbReserved */
{
0x00
,
0x00
,
0x00
,
0x00
},
{
0x00
,
0x00
,
0x80
,
0x00
},
{
0x00
,
0x80
,
0x00
,
0x00
},
{
0x00
,
0x80
,
0x80
,
0x00
},
{
0x80
,
0x00
,
0x00
,
0x00
},
{
0x80
,
0x00
,
0x80
,
0x00
},
{
0x80
,
0x80
,
0x00
,
0x00
},
{
0x80
,
0x80
,
0x80
,
0x00
},
{
0xc0
,
0xc0
,
0xc0
,
0x00
},
{
0x00
,
0x00
,
0xff
,
0x00
},
{
0x00
,
0xff
,
0x00
,
0x00
},
{
0x00
,
0xff
,
0xff
,
0x00
},
{
0xff
,
0x00
,
0x00
,
0x00
},
{
0xff
,
0x00
,
0xff
,
0x00
},
{
0xff
,
0xff
,
0x00
,
0x00
},
{
0xff
,
0xff
,
0xff
,
0x00
}
};
static
const
RGBQUAD
DefLogPaletteQuads
[
20
]
=
{
/* Copy of Default Logical Palette */
/* rgbBlue, rgbGreen, rgbRed, rgbReserved */
{
0x00
,
0x00
,
0x00
,
0x00
},
...
...
@@ -635,7 +609,12 @@ INT WINAPI GetDIBits(
break
;
case
4
:
memcpy
(
rgbQuads
,
EGAColorsQuads
,
sizeof
(
EGAColorsQuads
));
/* The EGA palette is the first and last 8 colours of the default palette
with the innermost pair swapped */
memcpy
(
rgbQuads
,
DefLogPaletteQuads
,
7
*
sizeof
(
RGBQUAD
));
memcpy
(
rgbQuads
+
7
,
DefLogPaletteQuads
+
12
,
1
*
sizeof
(
RGBQUAD
));
memcpy
(
rgbQuads
+
8
,
DefLogPaletteQuads
+
7
,
1
*
sizeof
(
RGBQUAD
));
memcpy
(
rgbQuads
+
9
,
DefLogPaletteQuads
+
13
,
7
*
sizeof
(
RGBQUAD
));
break
;
case
8
:
...
...
dlls/gdi32/tests/bitmap.c
View file @
aa34b2fb
...
...
@@ -1534,7 +1534,7 @@ static void test_GetDIBits(void)
BYTE
buf
[
1024
];
char
bi_buf
[
sizeof
(
BITMAPINFOHEADER
)
+
sizeof
(
RGBQUAD
)
*
256
];
BITMAPINFO
*
bi
=
(
BITMAPINFO
*
)
bi_buf
;
PALETTEENTRY
pal_ents
[
32
];
PALETTEENTRY
pal_ents
[
20
];
hdc
=
GetDC
(
0
);
...
...
@@ -1723,6 +1723,44 @@ todo_wine
for
(
i
=
2
;
i
<
256
;
i
++
)
ok
(((
WORD
*
)
bi
->
bmiColors
)[
i
]
==
0xAAAA
,
"Color %d is %d
\n
"
,
i
,
((
WORD
*
)
bi
->
bmiColors
)[
i
]);
/* retrieve 4-bit DIB data */
memset
(
bi
,
0
,
sizeof
(
*
bi
));
bi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
bi
->
bmiHeader
.
biWidth
=
bm
.
bmWidth
;
bi
->
bmiHeader
.
biHeight
=
bm
.
bmHeight
;
bi
->
bmiHeader
.
biPlanes
=
1
;
bi
->
bmiHeader
.
biBitCount
=
4
;
bi
->
bmiHeader
.
biCompression
=
BI_RGB
;
bi
->
bmiHeader
.
biSizeImage
=
0
;
memset
(
bi
->
bmiColors
,
0xAA
,
sizeof
(
RGBQUAD
)
*
256
);
memset
(
buf
,
0xAA
,
sizeof
(
buf
));
SetLastError
(
0xdeadbeef
);
lines
=
GetDIBits
(
hdc
,
hbmp
,
0
,
bm
.
bmHeight
,
buf
,
bi
,
DIB_RGB_COLORS
);
ok
(
lines
==
bm
.
bmHeight
,
"GetDIBits copied %d lines of %d, error %u
\n
"
,
lines
,
bm
.
bmHeight
,
GetLastError
());
GetPaletteEntries
(
GetStockObject
(
DEFAULT_PALETTE
),
0
,
20
,
pal_ents
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
RGBQUAD
expect
;
int
entry
=
i
<
8
?
i
:
i
+
4
;
if
(
entry
==
7
)
entry
=
12
;
else
if
(
entry
==
12
)
entry
=
7
;
expect
.
rgbRed
=
pal_ents
[
entry
].
peRed
;
expect
.
rgbGreen
=
pal_ents
[
entry
].
peGreen
;
expect
.
rgbBlue
=
pal_ents
[
entry
].
peBlue
;
expect
.
rgbReserved
=
0
;
ok
(
!
memcmp
(
bi
->
bmiColors
+
i
,
&
expect
,
sizeof
(
expect
)),
"expected bmiColors[%d] %x %x %x %x - got %x %x %x %x
\n
"
,
i
,
expect
.
rgbRed
,
expect
.
rgbGreen
,
expect
.
rgbBlue
,
expect
.
rgbReserved
,
bi
->
bmiColors
[
i
].
rgbRed
,
bi
->
bmiColors
[
i
].
rgbGreen
,
bi
->
bmiColors
[
i
].
rgbBlue
,
bi
->
bmiColors
[
i
].
rgbReserved
);
}
/* retrieve 8-bit DIB data */
memset
(
bi
,
0
,
sizeof
(
*
bi
));
bi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
...
...
@@ -1739,7 +1777,7 @@ todo_wine
ok
(
lines
==
bm
.
bmHeight
,
"GetDIBits copied %d lines of %d, error %u
\n
"
,
lines
,
bm
.
bmHeight
,
GetLastError
());
GetPaletteEntries
(
GetStockObject
(
DEFAULT_PALETTE
),
0
,
32
,
pal_ents
);
GetPaletteEntries
(
GetStockObject
(
DEFAULT_PALETTE
),
0
,
20
,
pal_ents
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
...
...
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