Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3e9fe3e9
Commit
3e9fe3e9
authored
Jan 06, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use the window's client rect for clipping.
parent
6d238163
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
20 deletions
+56
-20
clipper.c
dlls/ddraw/clipper.c
+56
-20
No files found.
dlls/ddraw/clipper.c
View file @
3e9fe3e9
...
...
@@ -93,6 +93,32 @@ static HRESULT WINAPI ddraw_clipper_SetHWnd(IDirectDrawClipper *iface, DWORD fla
return
DD_OK
;
}
static
HRGN
get_window_region
(
HWND
window
)
{
POINT
origin
=
{
0
,
0
};
RECT
client_rect
;
if
(
!
GetClientRect
(
window
,
&
client_rect
))
{
ERR
(
"Failed to get client rect.
\n
"
);
return
NULL
;
}
if
(
!
ClientToScreen
(
window
,
&
origin
))
{
ERR
(
"Failed to translate origin.
\n
"
);
return
NULL
;
}
if
(
!
OffsetRect
(
&
client_rect
,
origin
.
x
,
origin
.
y
))
{
ERR
(
"Failed to translate client rect.
\n
"
);
return
NULL
;
}
return
CreateRectRgnIndirect
(
&
client_rect
);
}
/*****************************************************************************
* IDirectDrawClipper::GetClipList
*
...
...
@@ -116,6 +142,7 @@ static HRESULT WINAPI ddraw_clipper_GetClipList(IDirectDrawClipper *iface, RECT
{
struct
ddraw_clipper
*
clipper
=
impl_from_IDirectDrawClipper
(
iface
);
static
unsigned
int
once
;
HRGN
region
;
TRACE
(
"iface %p, rect %s, clip_list %p, clip_list_size %p.
\n
"
,
iface
,
wine_dbgstr_rect
(
rect
),
clip_list
,
clip_list_size
);
...
...
@@ -124,31 +151,40 @@ static HRESULT WINAPI ddraw_clipper_GetClipList(IDirectDrawClipper *iface, RECT
if
(
clipper
->
window
)
{
HDC
dc
=
GetDCEx
(
clipper
->
window
,
NULL
,
DCX_WINDOW
);
if
(
dc
)
if
(
!
(
region
=
get_window_region
(
clipper
->
window
)))
{
wined3d_mutex_unlock
();
ERR
(
"Failed to get window region.
\n
"
);
return
E_FAIL
;
}
if
(
rect
)
{
HRGN
rgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
if
(
GetRandomRgn
(
dc
,
rgn
,
SYSRGN
))
HRGN
clip_region
;
int
ret
;
if
(
!
(
clip_region
=
CreateRectRgnIndirect
(
rect
)))
{
wined3d_mutex_unlock
();
ERR
(
"Failed to create region.
\n
"
);
DeleteObject
(
region
);
return
E_FAIL
;
}
ret
=
CombineRgn
(
region
,
region
,
clip_region
,
RGN_AND
);
DeleteObject
(
clip_region
);
if
(
ret
==
ERROR
)
{
if
(
GetVersion
()
&
0x80000000
)
{
POINT
origin
;
GetDCOrgEx
(
dc
,
&
origin
);
OffsetRgn
(
rgn
,
origin
.
x
,
origin
.
y
);
}
if
(
rect
)
{
HRGN
clip_rgn
=
CreateRectRgn
(
rect
->
left
,
rect
->
top
,
rect
->
right
,
rect
->
bottom
);
CombineRgn
(
rgn
,
rgn
,
clip_rgn
,
RGN_AND
);
DeleteObject
(
clip_rgn
);
}
*
clip_list_size
=
GetRegionData
(
rgn
,
*
clip_list_size
,
clip_list
);
wined3d_mutex_unlock
();
ERR
(
"Failed to combine regions.
\n
"
);
DeleteObject
(
region
);
return
E_FAIL
;
}
DeleteObject
(
rgn
);
ReleaseDC
(
clipper
->
window
,
dc
);
}
*
clip_list_size
=
GetRegionData
(
region
,
*
clip_list_size
,
clip_list
);
DeleteObject
(
region
);
wined3d_mutex_unlock
();
return
DD_OK
;
}
...
...
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