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
587f492f
Commit
587f492f
authored
Oct 13, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add support for arbitrary DIB bitfields for 16-bpp conversions.
parent
b084e52b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
156 additions
and
61 deletions
+156
-61
primitives.c
dlls/gdi32/dibdrv/primitives.c
+144
-18
bitmap.c
dlls/gdi32/tests/bitmap.c
+12
-43
No files found.
dlls/gdi32/dibdrv/primitives.c
View file @
587f492f
This diff is collapsed.
Click to expand it.
dlls/gdi32/tests/bitmap.c
View file @
587f492f
...
...
@@ -821,7 +821,7 @@ static void test_dib_formats(void)
HBITMAP
hdib
,
hbmp
;
HDC
hdc
,
memdc
;
UINT
ret
;
BOOL
expect_ok
,
todo
;
BOOL
expect_ok
;
bi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)
);
hdc
=
GetDC
(
0
);
...
...
@@ -846,7 +846,6 @@ static void test_dib_formats(void)
case
32
:
expect_ok
=
(
compr
==
BI_RGB
||
compr
==
BI_BITFIELDS
);
break
;
default:
expect_ok
=
FALSE
;
break
;
}
todo
=
(
compr
==
BI_BITFIELDS
)
&&
bpp
==
16
;
/* wine doesn't like strange bitfields */
memset
(
bi
,
0
,
sizeof
(
bi
->
bmiHeader
)
);
bi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
...
...
@@ -897,36 +896,21 @@ static void test_dib_formats(void)
bi
->
bmiHeader
.
biSizeImage
=
0
;
ret
=
SetDIBits
(
hdc
,
hbmp
,
0
,
1
,
data
,
bi
,
DIB_RGB_COLORS
);
if
(
expect_ok
)
{
if
(
todo
)
todo_wine
ok
(
ret
,
"SetDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
ret
,
"SetDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
}
ok
(
ret
,
"SetDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
!
ret
||
broken
((
bpp
==
4
&&
compr
==
BI_RLE4
)
||
(
bpp
==
8
&&
compr
==
BI_RLE8
)),
/* nt4 */
"SetDIBits succeeded for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
ret
=
SetDIBitsToDevice
(
memdc
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
1
,
data
,
bi
,
DIB_RGB_COLORS
);
if
(
expect_ok
)
{
if
(
todo
)
todo_wine
ok
(
ret
,
"SetDIBitsToDevice failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
ret
,
"SetDIBitsToDevice failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
}
ok
(
ret
,
"SetDIBitsToDevice failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
!
ret
||
broken
((
bpp
==
4
&&
compr
==
BI_RLE4
)
||
(
bpp
==
8
&&
compr
==
BI_RLE8
)),
/* nt4 */
"SetDIBitsToDevice succeeded for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
ret
=
StretchDIBits
(
memdc
,
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
,
data
,
bi
,
DIB_RGB_COLORS
,
SRCCOPY
);
if
(
expect_ok
)
{
if
(
todo
)
todo_wine
ok
(
ret
,
"StretchDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
ret
,
"StretchDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
}
ok
(
ret
,
"StretchDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
!
ret
||
broken
((
bpp
==
4
&&
compr
==
BI_RLE4
)
||
(
bpp
==
8
&&
compr
==
BI_RLE8
)),
/* nt4 */
...
...
@@ -953,32 +937,17 @@ static void test_dib_formats(void)
ret
=
SetDIBits
(
hdc
,
hbmp
,
0
,
1
,
data
,
bi
,
DIB_RGB_COLORS
);
if
(
expect_ok
)
{
if
(
todo
)
todo_wine
ok
(
ret
,
"SetDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
ret
,
"SetDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
}
ok
(
ret
,
"SetDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
!
ret
,
"SetDIBits succeeded for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
ret
=
SetDIBitsToDevice
(
memdc
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
1
,
data
,
bi
,
DIB_RGB_COLORS
);
if
(
expect_ok
)
{
if
(
todo
)
todo_wine
ok
(
ret
,
"SetDIBitsToDevice failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
ret
,
"SetDIBitsToDevice failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
}
ok
(
ret
,
"SetDIBitsToDevice failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
!
ret
,
"SetDIBitsToDevice succeeded for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
ret
=
StretchDIBits
(
memdc
,
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
,
data
,
bi
,
DIB_RGB_COLORS
,
SRCCOPY
);
if
(
expect_ok
)
{
if
(
todo
)
todo_wine
ok
(
ret
,
"StretchDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
ret
,
"StretchDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
}
ok
(
ret
,
"StretchDIBits failed for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
else
ok
(
!
ret
,
"StretchDIBits succeeded for %u/%u/%u
\n
"
,
bpp
,
planes
,
compr
);
...
...
@@ -1007,15 +976,15 @@ static void test_dib_formats(void)
hdib
=
CreateDIBSection
(
hdc
,
bi
,
DIB_RGB_COLORS
,
&
bits
,
NULL
,
0
);
ok
(
hdib
==
NULL
,
"CreateDIBSection succeeded with null bitfields
\n
"
);
ret
=
SetDIBits
(
hdc
,
hbmp
,
0
,
1
,
data
,
bi
,
DIB_RGB_COLORS
);
ok
(
!
ret
,
"SetDIBits succeeded with null bitfields
\n
"
);
todo_wine
ok
(
!
ret
,
"SetDIBits succeeded with null bitfields
\n
"
);
/* other functions don't check */
hdib
=
CreateDIBitmap
(
hdc
,
&
bi
->
bmiHeader
,
0
,
bits
,
bi
,
DIB_RGB_COLORS
);
ok
(
hdib
!=
NULL
,
"CreateDIBitmap failed with null bitfields
\n
"
);
DeleteObject
(
hdib
);
ret
=
SetDIBitsToDevice
(
memdc
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
1
,
data
,
bi
,
DIB_RGB_COLORS
);
todo_wine
ok
(
ret
,
"SetDIBitsToDevice failed with null bitfields
\n
"
);
ok
(
ret
,
"SetDIBitsToDevice failed with null bitfields
\n
"
);
ret
=
StretchDIBits
(
memdc
,
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
,
data
,
bi
,
DIB_RGB_COLORS
,
SRCCOPY
);
todo_wine
ok
(
ret
,
"StretchDIBits failed with null bitfields
\n
"
);
ok
(
ret
,
"StretchDIBits failed with null bitfields
\n
"
);
ret
=
GetDIBits
(
hdc
,
hbmp
,
0
,
2
,
data
,
bi
,
DIB_RGB_COLORS
);
ok
(
ret
,
"GetDIBits failed with null bitfields
\n
"
);
bi
->
bmiHeader
.
biPlanes
=
1
;
...
...
@@ -1035,7 +1004,7 @@ static void test_dib_formats(void)
hdib
=
CreateDIBSection
(
hdc
,
bi
,
DIB_RGB_COLORS
,
&
bits
,
NULL
,
0
);
ok
(
hdib
==
NULL
,
"CreateDIBSection succeeded with null bitfields
\n
"
);
ret
=
SetDIBits
(
hdc
,
hbmp
,
0
,
1
,
data
,
bi
,
DIB_RGB_COLORS
);
ok
(
!
ret
,
"SetDIBits succeeded with null bitfields
\n
"
);
todo_wine
ok
(
!
ret
,
"SetDIBits succeeded with null bitfields
\n
"
);
/* garbage is ok though */
*
(
DWORD
*
)
&
bi
->
bmiColors
[
0
]
=
0x55
;
...
...
@@ -1045,7 +1014,7 @@ static void test_dib_formats(void)
ok
(
hdib
!=
NULL
,
"CreateDIBSection failed with bad bitfields
\n
"
);
if
(
hdib
)
DeleteObject
(
hdib
);
ret
=
SetDIBits
(
hdc
,
hbmp
,
0
,
1
,
data
,
bi
,
DIB_RGB_COLORS
);
todo_wine
ok
(
ret
,
"SetDIBits failed with bad bitfields
\n
"
);
ok
(
ret
,
"SetDIBits failed with bad bitfields
\n
"
);
bi
->
bmiHeader
.
biWidth
=
-
2
;
bi
->
bmiHeader
.
biHeight
=
2
;
...
...
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