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
ce09d363
Commit
ce09d363
authored
Dec 05, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Properly flip through the swap chain in ddraw_surface7_Flip().
parent
7524258a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
34 deletions
+51
-34
surface.c
dlls/ddraw/surface.c
+31
-14
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+5
-5
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+5
-5
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+5
-5
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+5
-5
No files found.
dlls/ddraw/surface.c
View file @
ce09d363
...
...
@@ -1209,27 +1209,44 @@ static HRESULT WINAPI ddraw_surface7_Flip(IDirectDrawSurface7 *iface, IDirectDra
return
DDERR_NOTFLIPPABLE
;
}
}
if
(
rt
==
dst_impl
->
wined3d_surface
)
wined3d_device_set_render_target
(
dst_impl
->
ddraw
->
wined3d_device
,
0
,
src_impl
->
wined3d_surface
,
FALSE
);
wined3d_resource_set_parent
(
wined3d_surface_get_resource
(
src_impl
->
wined3d_surface
),
dst_impl
);
dst_impl
->
wined3d_surface
=
src_impl
->
wined3d_surface
;
wined3d_resource_set_parent
(
wined3d_texture_get_resource
(
src_impl
->
wined3d_texture
),
wined3d_texture_get_parent
(
dst_impl
->
wined3d_texture
));
dst_impl
->
wined3d_texture
=
src_impl
->
wined3d_texture
;
}
else
{
if
(
FAILED
(
hr
=
ddraw_surface7_GetAttachedSurface
(
iface
,
&
caps
,
&
current
))
)
for
(
current
=
iface
;;
)
{
ERR
(
"Can't find a flip target
\n
"
);
wined3d_mutex_unlock
();
return
DDERR_NOTFLIPPABLE
;
/* Unchecked */
if
(
FAILED
(
hr
=
ddraw_surface7_GetAttachedSurface
(
current
,
&
caps
,
&
current
)))
{
ERR
(
"Can't find a flip target
\n
"
);
wined3d_mutex_unlock
();
return
DDERR_NOTFLIPPABLE
;
/* Unchecked */
}
ddraw_surface7_Release
(
current
);
if
(
current
==
iface
)
{
dst_impl
=
impl_from_IDirectDrawSurface7
(
iface
);
break
;
}
src_impl
=
impl_from_IDirectDrawSurface7
(
current
);
if
(
rt
==
dst_impl
->
wined3d_surface
)
wined3d_device_set_render_target
(
dst_impl
->
ddraw
->
wined3d_device
,
0
,
src_impl
->
wined3d_surface
,
FALSE
);
wined3d_resource_set_parent
(
wined3d_surface_get_resource
(
src_impl
->
wined3d_surface
),
dst_impl
);
dst_impl
->
wined3d_surface
=
src_impl
->
wined3d_surface
;
wined3d_resource_set_parent
(
wined3d_texture_get_resource
(
src_impl
->
wined3d_texture
),
wined3d_texture_get_parent
(
dst_impl
->
wined3d_texture
));
dst_impl
->
wined3d_texture
=
src_impl
->
wined3d_texture
;
dst_impl
=
src_impl
;
}
src_impl
=
impl_from_IDirectDrawSurface7
(
current
);
ddraw_surface7_Release
(
current
);
}
if
(
rt
==
dst_impl
->
wined3d_surface
)
wined3d_device_set_render_target
(
dst_impl
->
ddraw
->
wined3d_device
,
0
,
src_impl
->
wined3d_surface
,
FALSE
);
wined3d_resource_set_parent
(
wined3d_surface_get_resource
(
src_impl
->
wined3d_surface
),
dst_impl
);
dst_impl
->
wined3d_surface
=
src_impl
->
wined3d_surface
;
wined3d_resource_set_parent
(
wined3d_texture_get_resource
(
src_impl
->
wined3d_texture
),
wined3d_texture_get_parent
(
dst_impl
->
wined3d_texture
));
dst_impl
->
wined3d_texture
=
src_impl
->
wined3d_texture
;
/* We don't have to worry about potential texture bindings, since
* flippable surfaces can never be textures. */
if
(
rt
==
src_impl
->
wined3d_surface
)
...
...
dlls/ddraw/tests/ddraw1.c
View file @
ce09d363
...
...
@@ -3803,10 +3803,10 @@ static void test_flip(void)
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
/* The testbot seems to just copy the contents of one surface to all the
* others, instead of properly flipping. */
todo_wine
ok
(
compare_color
(
color
,
0x0000ff00
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x000000ff
,
1
)),
ok
(
compare_color
(
color
,
0x0000ff00
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x000000ff
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x000000ff
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
compare_color
(
color
,
0x000000ff
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
U5
(
fx
).
dwFillColor
=
0xffff0000
;
hr
=
IDirectDrawSurface_Blt
(
backbuffer3
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
ok
(
SUCCEEDED
(
hr
),
"Failed to fill surface, hr %#x.
\n
"
,
hr
);
...
...
@@ -3814,10 +3814,10 @@ static void test_flip(void)
hr
=
IDirectDrawSurface_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
SUCCEEDED
(
hr
),
"Failed to flip, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x000000ff
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x00ff0000
,
1
)),
ok
(
compare_color
(
color
,
0x000000ff
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x00ff0000
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
U5
(
fx
).
dwFillColor
=
0xff00ff00
;
hr
=
IDirectDrawSurface_Blt
(
backbuffer3
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
ok
(
SUCCEEDED
(
hr
),
"Failed to fill surface, hr %#x.
\n
"
,
hr
);
...
...
@@ -3825,7 +3825,7 @@ static void test_flip(void)
hr
=
IDirectDrawSurface_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
SUCCEEDED
(
hr
),
"Failed to flip, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x0000ff00
,
1
)),
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x0000ff00
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
ok
(
compare_color
(
color
,
0x0000ff00
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
...
...
dlls/ddraw/tests/ddraw2.c
View file @
ce09d363
...
...
@@ -4484,10 +4484,10 @@ static void test_flip(void)
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
/* The testbot seems to just copy the contents of one surface to all the
* others, instead of properly flipping. */
todo_wine
ok
(
compare_color
(
color
,
0x0000ff00
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x000000ff
,
1
)),
ok
(
compare_color
(
color
,
0x0000ff00
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x000000ff
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x000000ff
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
compare_color
(
color
,
0x000000ff
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
U5
(
fx
).
dwFillColor
=
0xffff0000
;
hr
=
IDirectDrawSurface_Blt
(
backbuffer3
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
ok
(
SUCCEEDED
(
hr
),
"Failed to fill surface, hr %#x.
\n
"
,
hr
);
...
...
@@ -4495,10 +4495,10 @@ static void test_flip(void)
hr
=
IDirectDrawSurface_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
SUCCEEDED
(
hr
),
"Failed to flip, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x000000ff
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x00ff0000
,
1
)),
ok
(
compare_color
(
color
,
0x000000ff
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x00ff0000
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
U5
(
fx
).
dwFillColor
=
0xff00ff00
;
hr
=
IDirectDrawSurface_Blt
(
backbuffer3
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
ok
(
SUCCEEDED
(
hr
),
"Failed to fill surface, hr %#x.
\n
"
,
hr
);
...
...
@@ -4506,7 +4506,7 @@ static void test_flip(void)
hr
=
IDirectDrawSurface_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
SUCCEEDED
(
hr
),
"Failed to flip, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x0000ff00
,
1
)),
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x0000ff00
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
ok
(
compare_color
(
color
,
0x0000ff00
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
...
...
dlls/ddraw/tests/ddraw4.c
View file @
ce09d363
...
...
@@ -5088,10 +5088,10 @@ static void test_flip(void)
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
/* The testbot seems to just copy the contents of one surface to all the
* others, instead of properly flipping. */
todo_wine
ok
(
compare_color
(
color
,
0x0000ff00
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x000000ff
,
1
)),
ok
(
compare_color
(
color
,
0x0000ff00
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x000000ff
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x000000ff
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
compare_color
(
color
,
0x000000ff
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
U5
(
fx
).
dwFillColor
=
0xffff0000
;
hr
=
IDirectDrawSurface4_Blt
(
backbuffer3
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
ok
(
SUCCEEDED
(
hr
),
"Failed to fill surface, hr %#x.
\n
"
,
hr
);
...
...
@@ -5099,10 +5099,10 @@ static void test_flip(void)
hr
=
IDirectDrawSurface4_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
SUCCEEDED
(
hr
),
"Failed to flip, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x000000ff
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x00ff0000
,
1
)),
ok
(
compare_color
(
color
,
0x000000ff
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x00ff0000
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
U5
(
fx
).
dwFillColor
=
0xff00ff00
;
hr
=
IDirectDrawSurface4_Blt
(
backbuffer3
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
ok
(
SUCCEEDED
(
hr
),
"Failed to fill surface, hr %#x.
\n
"
,
hr
);
...
...
@@ -5110,7 +5110,7 @@ static void test_flip(void)
hr
=
IDirectDrawSurface4_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
SUCCEEDED
(
hr
),
"Failed to flip, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x0000ff00
,
1
)),
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x0000ff00
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
ok
(
compare_color
(
color
,
0x0000ff00
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
ce09d363
...
...
@@ -4975,10 +4975,10 @@ static void test_flip(void)
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
/* The testbot seems to just copy the contents of one surface to all the
* others, instead of properly flipping. */
todo_wine
ok
(
compare_color
(
color
,
0x0000ff00
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x000000ff
,
1
)),
ok
(
compare_color
(
color
,
0x0000ff00
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x000000ff
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x000000ff
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
compare_color
(
color
,
0x000000ff
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
U5
(
fx
).
dwFillColor
=
0xffff0000
;
hr
=
IDirectDrawSurface7_Blt
(
backbuffer3
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
ok
(
SUCCEEDED
(
hr
),
"Failed to fill surface, hr %#x.
\n
"
,
hr
);
...
...
@@ -4986,10 +4986,10 @@ static void test_flip(void)
hr
=
IDirectDrawSurface7_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
SUCCEEDED
(
hr
),
"Failed to flip, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x000000ff
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x00ff0000
,
1
)),
ok
(
compare_color
(
color
,
0x000000ff
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x00ff0000
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
compare_color
(
color
,
0x00ff0000
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
U5
(
fx
).
dwFillColor
=
0xff00ff00
;
hr
=
IDirectDrawSurface7_Blt
(
backbuffer3
,
NULL
,
NULL
,
NULL
,
DDBLT_COLORFILL
|
DDBLT_WAIT
,
&
fx
);
ok
(
SUCCEEDED
(
hr
),
"Failed to fill surface, hr %#x.
\n
"
,
hr
);
...
...
@@ -4997,7 +4997,7 @@ static void test_flip(void)
hr
=
IDirectDrawSurface7_Flip
(
primary
,
NULL
,
DDFLIP_WAIT
);
ok
(
SUCCEEDED
(
hr
),
"Failed to flip, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
backbuffer1
,
320
,
240
);
todo_wine
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x0000ff00
,
1
)),
ok
(
compare_color
(
color
,
0x00ff0000
,
1
)
||
broken
(
sysmem_primary
&&
compare_color
(
color
,
0x0000ff00
,
1
)),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_surface_color
(
backbuffer2
,
320
,
240
);
ok
(
compare_color
(
color
,
0x0000ff00
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
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