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
8d9fb633
Commit
8d9fb633
authored
Dec 17, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 17, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x11drv: ScrollDC should not clip output if a clipping rect is not specified.
Add a ScrollDC test with NULL clipping rect. Add another set of ScrollDC tests written by Rein Klazes.
parent
8b709879
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
win.c
dlls/user/tests/win.c
+55
-0
scroll.c
dlls/x11drv/scroll.c
+7
-2
No files found.
dlls/user/tests/win.c
View file @
8d9fb633
...
...
@@ -2923,6 +2923,60 @@ static void test_scroll(void)
DestroyWindow
(
hwnd
);
}
static
void
test_scrolldc
(
HWND
parent
)
{
HDC
hdc
;
HRGN
exprgn
,
tmprgn
,
hrgn
;
RECT
rc
,
rc2
,
rcu
,
cliprc
;
HWND
hwnd1
;
COLORREF
colr
;
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
hwnd1
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
25
,
50
,
100
,
100
,
parent
,
0
,
0
,
NULL
);
ShowWindow
(
parent
,
SW_SHOW
);
UpdateWindow
(
parent
);
GetClientRect
(
hwnd1
,
&
rc
);
hdc
=
GetDC
(
hwnd1
);
/* paint the upper half of the window black */
rc2
=
rc
;
rc2
.
bottom
=
(
rc
.
top
+
rc
.
bottom
)
/
2
;
FillRect
(
hdc
,
&
rc2
,
GetStockObject
(
BLACK_BRUSH
));
/* clip region is the lower half */
cliprc
=
rc
;
cliprc
.
top
=
(
rc
.
top
+
rc
.
bottom
)
/
2
;
/* test whether scrolled pixels are properly clipped */
colr
=
GetPixel
(
hdc
,
(
rc
.
left
+
rc
.
right
)
/
2
,
(
rc
.
top
+
rc
.
bottom
)
/
2
-
1
);
ok
(
colr
==
0
,
"pixel should be black, color is %08lx
\n
"
,
colr
);
/* this scroll should not cause any visible changes */
ScrollDC
(
hdc
,
5
,
-
20
,
&
rc
,
&
cliprc
,
hrgn
,
&
rcu
);
colr
=
GetPixel
(
hdc
,
(
rc
.
left
+
rc
.
right
)
/
2
,
(
rc
.
top
+
rc
.
bottom
)
/
2
-
1
);
ok
(
colr
==
0
,
"pixel should be black, color is %08lx
\n
"
,
colr
);
ScrollDC
(
hdc
,
20
,
-
20
,
&
rc
,
NULL
,
hrgn
,
&
rcu
);
/*FillRgn(hdc, hrgn, GetStockObject(WHITE_BRUSH));*/
trace
(
"update rect: %ld,%ld - %ld,%ld
\n
"
,
rcu
.
left
,
rcu
.
top
,
rcu
.
right
,
rcu
.
bottom
);
if
(
winetest_debug
>
0
)
dump_region
(
hrgn
);
SetRect
(
&
rc2
,
0
,
0
,
100
,
100
);
ok
(
EqualRect
(
&
rcu
,
&
rc2
),
"rects do not match (%ld,%ld-%ld,%ld) / (%ld,%ld-%ld,%ld)
\n
"
,
rcu
.
left
,
rcu
.
top
,
rcu
.
right
,
rcu
.
bottom
,
rc2
.
left
,
rc2
.
top
,
rc2
.
right
,
rc2
.
bottom
);
exprgn
=
CreateRectRgn
(
0
,
0
,
20
,
80
);
tmprgn
=
CreateRectRgn
(
0
,
80
,
100
,
100
);
CombineRgn
(
exprgn
,
exprgn
,
tmprgn
,
RGN_OR
);
if
(
winetest_debug
>
0
)
dump_region
(
exprgn
);
ok
(
EqualRgn
(
exprgn
,
hrgn
),
"wrong update region
\n
"
);
/* clean up */
DeleteObject
(
hrgn
);
DeleteObject
(
exprgn
);
DeleteObject
(
tmprgn
);
DestroyWindow
(
hwnd1
);
}
static
void
test_params
(
void
)
{
HWND
hwnd
;
...
...
@@ -3533,6 +3587,7 @@ START_TEST(win)
test_validatergn
(
hwndMain
);
test_nccalcscroll
(
hwndMain
);
test_scrollvalidate
(
hwndMain
);
test_scrolldc
(
hwndMain
);
test_scroll
();
test_IsWindowUnicode
();
test_vis_rgn
(
hwndMain
);
...
...
dlls/x11drv/scroll.c
View file @
8d9fb633
...
...
@@ -110,7 +110,11 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll,
/* Then clip again to get the source rectangle that will remain in the
* clipping rect */
rcSrc
=
rcClip
;
IntersectRect
(
&
rcSrc
,
&
rcSrc
,
&
rcClip
);
if
(
lprcClip
)
{
OffsetRect
(
&
rcSrc
,
-
dx
,
-
dy
);
IntersectRect
(
&
rcSrc
,
&
rcSrc
,
&
rcClip
);
}
/* now convert to device coordinates */
LPtoDP
(
hdc
,
(
LPPOINT
)
&
rcSrc
,
2
);
TRACE
(
"source rect: %s
\n
"
,
wine_dbgstr_rect
(
&
rcSrc
));
...
...
@@ -141,7 +145,7 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll,
TRACE
(
"destination rect: %s
\n
"
,
wine_dbgstr_rect
(
&
rect
));
BitBlt
(
hdc
,
rect
.
left
,
rect
.
top
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
hdc
,
rect
.
left
-
dx
,
rect
.
top
-
dy
,
SRCCOPY
);
}
/* compute the update areas. This is the combined clip rectangle
...
...
@@ -181,6 +185,7 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll,
if
(
!
hrgnUpdate
)
DeleteObject
(
hrgn
);
}
/* restore original clipping region */
SelectClipRgn
(
hdc
,
clipRgn
);
DeleteObject
(
visrgn
);
DeleteObject
(
DstRgn
);
...
...
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