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
0d0d4f39
Commit
0d0d4f39
authored
Mar 01, 2011
by
John Edmonds
Committed by
Alexandre Julliard
Mar 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Fixes GetDIBits for top-down destination bitmaps.
parent
374db924
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
dib.c
dlls/gdi32/dib.c
+10
-4
bitmap.c
dlls/gdi32/tests/bitmap.c
+4
-4
No files found.
dlls/gdi32/dib.c
View file @
0d0d4f39
...
...
@@ -874,7 +874,7 @@ INT WINAPI GetDIBits(
unsigned
int
srcwidth
=
bmp
->
dib
->
dsBm
.
bmWidth
;
int
srcwidthb
=
bmp
->
dib
->
dsBm
.
bmWidthBytes
;
unsigned
int
dstwidth
=
width
;
unsigned
int
dstwidthb
=
DIB_GetDIBWidthBytes
(
width
,
bpp
);
int
dstwidthb
=
DIB_GetDIBWidthBytes
(
width
,
bpp
);
LPBYTE
dbits
=
bits
,
sbits
=
(
LPBYTE
)
bmp
->
dib
->
dsBm
.
bmBits
+
(
startscan
*
srcwidthb
);
unsigned
int
x
,
y
,
width
,
widthb
;
...
...
@@ -888,6 +888,12 @@ INT WINAPI GetDIBits(
sbits
+=
(
srcwidthb
*
(
int
)(
abs
(
bmp
->
dib
->
dsBmih
.
biHeight
)
-
2
*
startscan
-
1
));
srcwidthb
=
-
srcwidthb
;
}
/*Same for the destination.*/
if
(
height
<
0
)
{
dbits
=
(
LPBYTE
)
bits
+
(
dstwidthb
*
(
lines
-
1
));
dstwidthb
=
-
dstwidthb
;
}
switch
(
bpp
)
{
case
15
:
...
...
@@ -902,7 +908,7 @@ INT WINAPI GetDIBits(
case
16
:
/* 16 bpp srcDIB -> 16 bpp dstDIB */
{
widthb
=
min
(
abs
(
srcwidthb
),
dstwidthb
);
widthb
=
min
(
abs
(
srcwidthb
),
abs
(
dstwidthb
)
);
/* FIXME: BI_BITFIELDS not supported yet */
for
(
y
=
0
;
y
<
lines
;
y
++
,
dbits
+=
dstwidthb
,
sbits
+=
srcwidthb
)
memcpy
(
dbits
,
sbits
,
widthb
);
...
...
@@ -980,7 +986,7 @@ INT WINAPI GetDIBits(
case
24
:
/* 24 bpp srcDIB -> 24 bpp dstDIB */
{
widthb
=
min
(
abs
(
srcwidthb
),
dstwidthb
);
widthb
=
min
(
abs
(
srcwidthb
),
abs
(
dstwidthb
)
);
for
(
y
=
0
;
y
<
lines
;
y
++
,
dbits
+=
dstwidthb
,
sbits
+=
srcwidthb
)
memcpy
(
dbits
,
sbits
,
widthb
);
}
...
...
@@ -1056,7 +1062,7 @@ INT WINAPI GetDIBits(
case
32
:
/* 32 bpp srcDIB -> 32 bpp dstDIB */
{
widthb
=
min
(
abs
(
srcwidthb
),
dstwidthb
);
widthb
=
min
(
abs
(
srcwidthb
),
abs
(
dstwidthb
)
);
/* FIXME: BI_BITFIELDS not supported yet */
for
(
y
=
0
;
y
<
lines
;
y
++
,
dbits
+=
dstwidthb
,
sbits
+=
srcwidthb
)
{
memcpy
(
dbits
,
sbits
,
widthb
);
...
...
dlls/gdi32/tests/bitmap.c
View file @
0d0d4f39
...
...
@@ -3057,12 +3057,12 @@ static void test_GetDIBits_top_down(int bpp)
/*Check both scanlines.*/
statusCode
=
GetDIBits
(
hdc
,
bmptb
,
0
,
2
,
pictureOut
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
todo_wine
ok
((
char
)
pictureOut
[
0
]
==
0
,
"Top-down -> top-down: first scanline should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
todo_wine
ok
((
char
)
pictureOut
[
1
]
==
2
,
"Top-down -> top-down: second scanline should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
ok
((
char
)
pictureOut
[
0
]
==
0
,
"Top-down -> top-down: first scanline should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
ok
((
char
)
pictureOut
[
1
]
==
2
,
"Top-down -> top-down: second scanline should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
statusCode
=
GetDIBits
(
hdc
,
bmpbt
,
0
,
2
,
pictureOut
,
&
bi
,
DIB_RGB_COLORS
);
ok
(
statusCode
,
"Failed to call GetDIBits. Status code: %d.
\n
"
,
statusCode
);
todo_wine
ok
((
char
)
pictureOut
[
0
]
==
2
,
"Bottom up -> top-down: first scanline should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
todo_wine
ok
((
char
)
pictureOut
[
1
]
==
0
,
"Bottom up -> top-down: second scanline should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
ok
((
char
)
pictureOut
[
0
]
==
2
,
"Bottom up -> top-down: first scanline should be 2 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
ok
((
char
)
pictureOut
[
1
]
==
0
,
"Bottom up -> top-down: second scanline should be 0 but was %d.
\n
"
,
(
char
)
pictureOut
[
0
]);
DeleteObject
(
bmpbt
);
DeleteObject
(
bmptb
);
...
...
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