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
53339232
Commit
53339232
authored
Jun 08, 2008
by
Michael Karcher
Committed by
Alexandre Julliard
Jun 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Respect DIB_PAL_COLORS in every case.
parent
b73b2eca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
16 deletions
+59
-16
dib.c
dlls/gdi32/dib.c
+17
-16
bitmap.c
dlls/gdi32/tests/bitmap.c
+42
-0
No files found.
dlls/gdi32/dib.c
View file @
53339232
...
...
@@ -701,7 +701,11 @@ INT WINAPI GetDIBits(
}
}
else
{
if
(
bpp
>=
bmp
->
bitmap
.
bmBitsPixel
)
{
if
(
coloruse
==
DIB_PAL_COLORS
)
{
for
(
i
=
0
;
i
<
(
1
<<
bpp
);
i
++
)
((
WORD
*
)
colorPtr
)[
i
]
=
(
WORD
)
i
;
}
else
if
(
bpp
>=
bmp
->
bitmap
.
bmBitsPixel
)
{
/* Generate the color map from the selected palette */
PALETTEENTRY
palEntry
[
256
];
...
...
@@ -713,22 +717,19 @@ INT WINAPI GetDIBits(
return
0
;
}
for
(
i
=
0
;
i
<
(
1
<<
bmp
->
bitmap
.
bmBitsPixel
);
i
++
)
{
if
(
coloruse
==
DIB_RGB_COLORS
)
{
if
(
core_header
)
{
rgbTriples
[
i
].
rgbtRed
=
palEntry
[
i
].
peRed
;
rgbTriples
[
i
].
rgbtGreen
=
palEntry
[
i
].
peGreen
;
rgbTriples
[
i
].
rgbtBlue
=
palEntry
[
i
].
peBlue
;
}
else
{
rgbQuads
[
i
].
rgbRed
=
palEntry
[
i
].
peRed
;
rgbQuads
[
i
].
rgbGreen
=
palEntry
[
i
].
peGreen
;
rgbQuads
[
i
].
rgbBlue
=
palEntry
[
i
].
peBlue
;
rgbQuads
[
i
].
rgbReserved
=
0
;
}
if
(
core_header
)
{
rgbTriples
[
i
].
rgbtRed
=
palEntry
[
i
].
peRed
;
rgbTriples
[
i
].
rgbtGreen
=
palEntry
[
i
].
peGreen
;
rgbTriples
[
i
].
rgbtBlue
=
palEntry
[
i
].
peBlue
;
}
else
{
rgbQuads
[
i
].
rgbRed
=
palEntry
[
i
].
peRed
;
rgbQuads
[
i
].
rgbGreen
=
palEntry
[
i
].
peGreen
;
rgbQuads
[
i
].
rgbBlue
=
palEntry
[
i
].
peBlue
;
rgbQuads
[
i
].
rgbReserved
=
0
;
}
else
((
WORD
*
)
colorPtr
)[
i
]
=
(
WORD
)
i
;
}
}
else
{
switch
(
bpp
)
{
...
...
dlls/gdi32/tests/bitmap.c
View file @
53339232
...
...
@@ -1315,6 +1315,28 @@ static void test_GetDIBits_selected_DDB(BOOL monochrome)
}
ok
(
equalContents
,
"GetDIBits with DDB selected in DC: Got different DIB bits
\n
"
);
/* Test the palette */
equalContents
=
TRUE
;
if
(
info2
->
bmiHeader
.
biBitCount
<=
8
)
{
WORD
*
colors
=
(
WORD
*
)
info2
->
bmiColors
;
/* Get the palette indices */
res
=
GetDIBits
(
dc
,
ddb
,
0
,
0
,
NULL
,
info2
,
DIB_PAL_COLORS
);
ok
(
res
,
"GetDIBits failed
\n
"
);
for
(
i
=
0
;
i
<
1
<<
info
->
bmiHeader
.
biSizeImage
;
i
++
)
{
if
(
colors
[
i
]
!=
i
)
{
equalContents
=
FALSE
;
break
;
}
}
}
ok
(
equalContents
,
"GetDIBits with DDB selected in DC: non 1:1 palette indices
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
bits2
);
HeapFree
(
GetProcessHeap
(),
0
,
bits
);
DeleteDC
(
dc
);
...
...
@@ -1496,6 +1518,16 @@ todo_wine
todo_wine
ok
(
!
memcmp
(
buf
,
dib_bits_1
,
sizeof
(
dib_bits_1
)),
"DIB bits don't match
\n
"
);
/* Test the palette indices */
memset
(
bi
->
bmiColors
,
0xAA
,
sizeof
(
RGBQUAD
)
*
256
);
SetLastError
(
0xdeadbeef
);
lines
=
GetDIBits
(
hdc
,
hbmp
,
0
,
0
,
NULL
,
bi
,
DIB_PAL_COLORS
);
ok
(((
WORD
*
)
bi
->
bmiColors
)[
0
]
==
0
,
"Color 0 is %d
\n
"
,
((
WORD
*
)
bi
->
bmiColors
)[
0
]);
ok
(((
WORD
*
)
bi
->
bmiColors
)[
1
]
==
1
,
"Color 1 is %d
\n
"
,
((
WORD
*
)
bi
->
bmiColors
)[
1
]);
for
(
i
=
2
;
i
<
256
;
i
++
)
ok
(((
WORD
*
)
bi
->
bmiColors
)[
i
]
==
0xAAAA
,
"Color %d is %d
\n
"
,
i
,
((
WORD
*
)
bi
->
bmiColors
)[
1
]);
/* retrieve 24-bit DIB data */
memset
(
bi
,
0
,
sizeof
(
*
bi
));
bi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
...
...
@@ -1596,6 +1628,16 @@ todo_wine
todo_wine
ok
(
!
memcmp
(
buf
,
dib_bits_1
,
sizeof
(
dib_bits_1
)),
"DIB bits don't match
\n
"
);
/* Test the palette indices */
memset
(
bi
->
bmiColors
,
0xAA
,
sizeof
(
RGBQUAD
)
*
256
);
SetLastError
(
0xdeadbeef
);
lines
=
GetDIBits
(
hdc
,
hbmp
,
0
,
0
,
NULL
,
bi
,
DIB_PAL_COLORS
);
ok
(((
WORD
*
)
bi
->
bmiColors
)[
0
]
==
0
,
"Color 0 is %d
\n
"
,
((
WORD
*
)
bi
->
bmiColors
)[
0
]);
ok
(((
WORD
*
)
bi
->
bmiColors
)[
1
]
==
1
,
"Color 1 is %d
\n
"
,
((
WORD
*
)
bi
->
bmiColors
)[
1
]);
for
(
i
=
2
;
i
<
256
;
i
++
)
ok
(((
WORD
*
)
bi
->
bmiColors
)[
i
]
==
0xAAAA
,
"Color %d is %d
\n
"
,
i
,
((
WORD
*
)
bi
->
bmiColors
)[
i
]);
/* retrieve 24-bit DIB data */
memset
(
bi
,
0
,
sizeof
(
*
bi
));
bi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
...
...
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