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
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
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
37 deletions
+51
-37
clipper.c
dlls/ddraw/clipper.c
+38
-17
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+3
-5
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+3
-5
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+3
-5
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+3
-5
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
;
}
}
else
{
if
(
!
(
region
=
clipper
->
region
))
{
wined3d_mutex_unlock
();
WARN
(
"No clip list set.
\n
"
);
return
DDERR_NOCLIPLIST
;
}
}
if
(
rect
)
{
HRGN
clip_region
;
int
ret
;
if
(
!
(
clip_region
=
CreateRectRgnIndirect
(
rect
)))
{
wined3d_mutex_unlock
();
ERR
(
"Failed to create region.
\n
"
);
if
(
clipper
->
window
)
DeleteObject
(
region
);
return
E_FAIL
;
}
ret
=
CombineRgn
(
region
,
region
,
clip_region
,
RGN_AND
);
DeleteObject
(
clip_region
);
if
(
ret
==
ERROR
)
if
(
CombineRgn
(
clip_region
,
region
,
clip_region
,
RGN_AND
)
==
ERROR
)
{
wined3d_mutex_unlock
();
ERR
(
"Failed to combine regions.
\n
"
);
DeleteObject
(
clip_region
);
if
(
clipper
->
window
)
DeleteObject
(
region
);
return
E_FAIL
;
}
region
=
clip_region
;
}
*
clip_list_size
=
GetRegionData
(
region
,
*
clip_list_size
,
clip_list
);
if
(
rect
||
clipper
->
window
)
DeleteObject
(
region
);
wined3d_mutex_unlock
();
return
DD_OK
;
}
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
;
wined3d_mutex_unlock
();
return
DDERR_NOCLIPLIST
;
}
/*****************************************************************************
...
...
@@ -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,10 +324,6 @@ 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
);
}
...
...
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,10 +331,6 @@ 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
);
}
...
...
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,10 +626,6 @@ 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
);
}
...
...
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,10 +619,6 @@ 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
);
}
...
...
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