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
bcc21c9b
Commit
bcc21c9b
authored
Sep 01, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Fix SetDIBitsToDevice coordinate mapping for negative values.
parent
e1ca5c38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
bitmap.c
dlls/gdi32/tests/bitmap.c
+41
-0
dib.c
dlls/winex11.drv/dib.c
+8
-1
No files found.
dlls/gdi32/tests/bitmap.c
View file @
bcc21c9b
...
...
@@ -4364,6 +4364,15 @@ static void test_SetDIBitsToDevice(void)
for
(
i
=
0
;
i
<
64
;
i
++
)
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
ret
=
SetDIBitsToDevice
(
hdc
,
5
,
-
7
,
8
,
16
,
-
2
,
-
4
,
0
,
12
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
12
,
"got %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
64
;
i
++
)
if
(
i
==
31
||
i
==
39
||
i
==
47
||
i
==
55
||
i
==
63
)
ok
(
dib_bits
[
i
]
==
inverted_data
[
i
+
1
],
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
else
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
info
->
bmiHeader
.
biHeight
=
-
5
;
ret
=
SetDIBitsToDevice
(
hdc
,
0
,
0
,
8
,
8
,
0
,
0
,
1
,
2
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
2
,
"got %d
\n
"
,
ret
);
...
...
@@ -4420,6 +4429,15 @@ static void test_SetDIBitsToDevice(void)
for
(
i
=
56
;
i
<
64
;
i
++
)
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
ret
=
SetDIBitsToDevice
(
hdc
,
5
,
-
7
,
8
,
16
,
-
1
,
-
8
,
0
,
12
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
12
,
"got %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
64
;
i
++
)
if
(
i
==
6
||
i
==
7
)
ok
(
dib_bits
[
i
]
==
data
[
i
+
82
],
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
else
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
info
->
bmiHeader
.
biHeight
=
-
5
;
ret
=
SetDIBitsToDevice
(
hdc
,
0
,
0
,
8
,
8
,
0
,
0
,
1
,
2
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
2
,
"got %d
\n
"
,
ret
);
...
...
@@ -4464,6 +4482,29 @@ static void test_SetDIBitsToDevice(void)
for
(
i
=
56
;
i
<
64
;
i
++
)
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
ret
=
SetDIBitsToDevice
(
hdc
,
4
,
4
,
8
,
8
,
0
,
-
4
,
1
,
12
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
3
,
"got %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
64
;
i
++
)
if
((
i
>=
36
&&
i
<=
39
)
||
(
i
>=
44
&&
i
<=
47
)
||
(
i
>=
52
&&
i
<=
55
))
ok
(
dib_bits
[
i
]
==
inverted_data
[
i
+
68
],
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
else
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
ret
=
SetDIBitsToDevice
(
hdc
,
4
,
4
,
8
,
8
,
-
30
,
-
30
,
1
,
12
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
64
;
i
++
)
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
ret
=
SetDIBitsToDevice
(
hdc
,
5
,
-
5
,
8
,
16
,
-
2
,
-
4
,
4
,
12
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
64
;
i
++
)
if
(
i
==
7
||
i
==
15
||
i
==
23
)
ok
(
dib_bits
[
i
]
==
inverted_data
[
i
+
97
],
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
else
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
info
->
bmiHeader
.
biHeight
=
5
;
ret
=
SetDIBitsToDevice
(
hdc
,
0
,
0
,
8
,
8
,
0
,
0
,
1
,
2
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
2
,
"got %d
\n
"
,
ret
);
...
...
dlls/winex11.drv/dib.c
View file @
bcc21c9b
...
...
@@ -3764,14 +3764,21 @@ INT X11DRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx, DWORD
}
else
{
if
(
ySrc
>=
startscan
+
lines
)
return
lines
;
if
(
ySrc
>=
startscan
+
lines
)
return
0
;
pt
.
y
+=
ySrc
+
cy
-
(
startscan
+
lines
);
cy
=
startscan
+
lines
-
ySrc
;
ySrc
=
0
;
if
(
cy
>
lines
)
cy
=
lines
;
}
if
(
xSrc
>=
info
->
bmiHeader
.
biWidth
)
return
lines
;
if
(
xSrc
+
cx
<=
0
)
return
lines
;
if
(
xSrc
+
cx
>=
info
->
bmiHeader
.
biWidth
)
cx
=
info
->
bmiHeader
.
biWidth
-
xSrc
;
if
(
xSrc
<
0
)
{
pt
.
x
-=
xSrc
;
cx
+=
xSrc
;
xSrc
=
0
;
}
if
(
!
cx
||
!
cy
)
return
lines
;
/* Update the pixmap from the DIB section */
...
...
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