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
f17e7148
Commit
f17e7148
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: Implement IDirectDrawClipper::SetClipList().
parent
3e9fe3e9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
59 deletions
+73
-59
clipper.c
dlls/ddraw/clipper.c
+52
-31
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+5
-7
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+5
-7
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+5
-7
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+5
-7
No files found.
dlls/ddraw/clipper.c
View file @
f17e7148
...
...
@@ -69,7 +69,11 @@ static ULONG WINAPI ddraw_clipper_Release(IDirectDrawClipper *iface)
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
clipper
,
refcount
);
if
(
!
refcount
)
{
if
(
clipper
->
region
)
DeleteObject
(
clipper
->
region
);
HeapFree
(
GetProcessHeap
(),
0
,
clipper
);
}
return
refcount
;
}
...
...
@@ -141,7 +145,6 @@ static HRESULT WINAPI ddraw_clipper_GetClipList(IDirectDrawClipper *iface, RECT
RGNDATA
*
clip_list
,
DWORD
*
clip_list_size
)
{
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
"
,
...
...
@@ -157,47 +160,49 @@ static HRESULT WINAPI ddraw_clipper_GetClipList(IDirectDrawClipper *iface, RECT
ERR
(
"Failed to get window region.
\n
"
);
return
E_FAIL
;
}
if
(
rect
)
}
else
{
if
(
!
(
region
=
clipper
->
region
))
{
HRGN
clip_region
;
int
ret
;
wined3d_mutex_unlock
();
WARN
(
"No clip list set.
\n
"
);
return
DDERR_NOCLIPLIST
;
}
}
if
(
!
(
clip_region
=
CreateRectRgnIndirect
(
rect
)))
{
wined3d_mutex_unlock
();
ERR
(
"Failed to create region.
\n
"
);
if
(
rect
)
{
HRGN
clip_region
;
if
(
!
(
clip_region
=
CreateRectRgnIndirect
(
rect
)))
{
wined3d_mutex_unlock
();
ERR
(
"Failed to create region.
\n
"
);
if
(
clipper
->
window
)
DeleteObject
(
region
);
return
E_FAIL
;
}
return
E_FAIL
;
}
ret
=
CombineRgn
(
region
,
region
,
clip_region
,
RGN_AND
);
if
(
CombineRgn
(
clip_region
,
region
,
clip_region
,
RGN_AND
)
==
ERROR
)
{
wined3d_mutex_unlock
();
ERR
(
"Failed to combine regions.
\n
"
);
DeleteObject
(
clip_region
);
if
(
ret
==
ERROR
)
{
wined3d_mutex_unlock
();
ERR
(
"Failed to combine regions.
\n
"
);
if
(
clipper
->
window
)
DeleteObject
(
region
);
return
E_FAIL
;
}
return
E_FAIL
;
}
*
clip_list_size
=
GetRegionData
(
region
,
*
clip_list_size
,
clip_list
);
DeleteObject
(
region
);
wined3d_mutex_unlock
();
return
DD_OK
;
region
=
clip_region
;
}
if
(
!
once
++
)
FIXME
(
"clipper %p, rect %s, clip_list %p, clip_list_size %p stub!
\n
"
,
clipper
,
wine_dbgstr_rect
(
rect
),
clip_list
,
clip_list_size
);
if
(
clip_list_size
)
*
clip_list_size
=
0
;
*
clip_list_size
=
GetRegionData
(
region
,
*
clip_list_size
,
clip_list
);
if
(
rect
||
clipper
->
window
)
DeleteObject
(
region
);
wined3d_mutex_unlock
();
return
DD
ERR_NOCLIPLIST
;
return
DD
_OK
;
}
/*****************************************************************************
...
...
@@ -218,10 +223,26 @@ static HRESULT WINAPI ddraw_clipper_SetClipList(IDirectDrawClipper *iface, RGNDA
{
struct
ddraw_clipper
*
clipper
=
impl_from_IDirectDrawClipper
(
iface
);
FIXME
(
"iface %p, region %p, flags %#x stub!
\n
"
,
iface
,
region
,
flags
);
TRACE
(
"iface %p, region %p, flags %#x.
\n
"
,
iface
,
region
,
flags
);
wined3d_mutex_lock
();
if
(
clipper
->
window
)
{
wined3d_mutex_unlock
();
return
DDERR_CLIPPERISUSINGHWND
;
}
if
(
clipper
->
region
)
DeleteObject
(
clipper
->
region
);
if
(
!
(
clipper
->
region
=
ExtCreateRegion
(
NULL
,
0
,
region
)))
{
wined3d_mutex_unlock
();
ERR
(
"Failed to create creation.
\n
"
);
return
E_FAIL
;
}
wined3d_mutex_unlock
();
return
DD_OK
;
}
...
...
dlls/ddraw/ddraw_private.h
View file @
f17e7148
...
...
@@ -361,6 +361,7 @@ struct ddraw_clipper
IDirectDrawClipper
IDirectDrawClipper_iface
;
LONG
ref
;
HWND
window
;
HRGN
region
;
BOOL
initialized
;
};
...
...
dlls/ddraw/tests/ddraw1.c
View file @
f17e7148
...
...
@@ -210,6 +210,8 @@ static void test_clipper_blt(void)
hr
=
IDirectDraw_CreateClipper
(
ddraw
,
0
,
&
clipper
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create clipper, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_GetClipList
(
clipper
,
NULL
,
NULL
,
&
ret
);
ok
(
hr
==
DDERR_NOCLIPLIST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_SetHWnd
(
clipper
,
0
,
window
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set clipper window, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_GetClipList
(
clipper
,
NULL
,
NULL
,
&
ret
);
...
...
@@ -314,7 +316,7 @@ static void test_clipper_blt(void)
U5
(
fx
).
dwFillColor
=
0xff0000ff
;
hr
=
IDirectDrawSurface_Blt
(
dst_surface
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to clear destination surface, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear destination surface, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
for
(
j
=
0
;
j
<
4
;
++
j
)
...
...
@@ -322,12 +324,8 @@ static void test_clipper_blt(void)
x
=
80
*
((
2
*
j
)
+
1
);
y
=
60
*
((
2
*
i
)
+
1
);
color
=
get_surface_color
(
dst_surface
,
x
,
y
);
if
((
i
<
2
&&
j
<
2
)
||
(
i
>=
2
&&
j
>=
2
))
todo_wine
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
else
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
}
}
...
...
dlls/ddraw/tests/ddraw2.c
View file @
f17e7148
...
...
@@ -217,6 +217,8 @@ static void test_clipper_blt(void)
hr
=
IDirectDraw2_CreateClipper
(
ddraw
,
0
,
&
clipper
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create clipper, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_GetClipList
(
clipper
,
NULL
,
NULL
,
&
ret
);
ok
(
hr
==
DDERR_NOCLIPLIST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_SetHWnd
(
clipper
,
0
,
window
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set clipper window, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_GetClipList
(
clipper
,
NULL
,
NULL
,
&
ret
);
...
...
@@ -321,7 +323,7 @@ static void test_clipper_blt(void)
U5
(
fx
).
dwFillColor
=
0xff0000ff
;
hr
=
IDirectDrawSurface_Blt
(
dst_surface
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to clear destination surface, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear destination surface, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
for
(
j
=
0
;
j
<
4
;
++
j
)
...
...
@@ -329,12 +331,8 @@ static void test_clipper_blt(void)
x
=
80
*
((
2
*
j
)
+
1
);
y
=
60
*
((
2
*
i
)
+
1
);
color
=
get_surface_color
(
dst_surface
,
x
,
y
);
if
((
i
<
2
&&
j
<
2
)
||
(
i
>=
2
&&
j
>=
2
))
todo_wine
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
else
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
}
}
...
...
dlls/ddraw/tests/ddraw4.c
View file @
f17e7148
...
...
@@ -513,6 +513,8 @@ static void test_clipper_blt(void)
hr
=
IDirectDraw4_CreateClipper
(
ddraw
,
0
,
&
clipper
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create clipper, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_GetClipList
(
clipper
,
NULL
,
NULL
,
&
ret
);
ok
(
hr
==
DDERR_NOCLIPLIST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_SetHWnd
(
clipper
,
0
,
window
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set clipper window, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_GetClipList
(
clipper
,
NULL
,
NULL
,
&
ret
);
...
...
@@ -616,7 +618,7 @@ static void test_clipper_blt(void)
U5
(
fx
).
dwFillColor
=
0xff0000ff
;
hr
=
IDirectDrawSurface4_Blt
(
dst_surface
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to clear destination surface, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear destination surface, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
for
(
j
=
0
;
j
<
4
;
++
j
)
...
...
@@ -624,12 +626,8 @@ static void test_clipper_blt(void)
x
=
80
*
((
2
*
j
)
+
1
);
y
=
60
*
((
2
*
i
)
+
1
);
color
=
get_surface_color
(
dst_surface
,
x
,
y
);
if
((
i
<
2
&&
j
<
2
)
||
(
i
>=
2
&&
j
>=
2
))
todo_wine
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
else
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
}
}
...
...
dlls/ddraw/tests/ddraw7.c
View file @
f17e7148
...
...
@@ -506,6 +506,8 @@ static void test_clipper_blt(void)
hr
=
IDirectDraw7_CreateClipper
(
ddraw
,
0
,
&
clipper
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create clipper, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_GetClipList
(
clipper
,
NULL
,
NULL
,
&
ret
);
ok
(
hr
==
DDERR_NOCLIPLIST
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_SetHWnd
(
clipper
,
0
,
window
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set clipper window, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawClipper_GetClipList
(
clipper
,
NULL
,
NULL
,
&
ret
);
...
...
@@ -609,7 +611,7 @@ static void test_clipper_blt(void)
U5
(
fx
).
dwFillColor
=
0xff0000ff
;
hr
=
IDirectDrawSurface7_Blt
(
dst_surface
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Failed to clear destination surface, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear destination surface, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
for
(
j
=
0
;
j
<
4
;
++
j
)
...
...
@@ -617,12 +619,8 @@ static void test_clipper_blt(void)
x
=
80
*
((
2
*
j
)
+
1
);
y
=
60
*
((
2
*
i
)
+
1
);
color
=
get_surface_color
(
dst_surface
,
x
,
y
);
if
((
i
<
2
&&
j
<
2
)
||
(
i
>=
2
&&
j
>=
2
))
todo_wine
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
else
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
ok
(
compare_color
(
color
,
expected2
[
i
*
4
+
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected2
[
i
*
4
+
j
],
x
,
y
,
color
);
}
}
...
...
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