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
55ce85ad
Commit
55ce85ad
authored
Aug 31, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge the wined3d_surface_flip() implementations.
parent
b587b853
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
39 deletions
+19
-39
surface.c
dlls/wined3d/surface.c
+19
-38
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-1
No files found.
dlls/wined3d/surface.c
View file @
55ce85ad
...
...
@@ -1057,31 +1057,6 @@ static HRESULT surface_getdc(struct wined3d_surface *surface)
return
hr
;
}
static
HRESULT
surface_flip
(
struct
wined3d_surface
*
surface
,
struct
wined3d_surface
*
override
)
{
TRACE
(
"surface %p, override %p.
\n
"
,
surface
,
override
);
/* Flipping is only supported on render targets and overlays. */
if
(
!
(
surface
->
resource
.
usage
&
(
WINED3DUSAGE_RENDERTARGET
|
WINED3DUSAGE_OVERLAY
)))
{
WARN
(
"Tried to flip a non-render target, non-overlay surface.
\n
"
);
return
WINEDDERR_NOTFLIPPABLE
;
}
if
(
surface
->
resource
.
usage
&
WINED3DUSAGE_OVERLAY
)
{
flip_surface
(
surface
,
override
);
/* Update the overlay if it is visible */
if
(
surface
->
overlay_dest
)
return
surface
->
surface_ops
->
surface_draw_overlay
(
surface
);
else
return
WINED3D_OK
;
}
return
WINED3D_OK
;
}
static
BOOL
surface_is_full_rect
(
const
struct
wined3d_surface
*
surface
,
const
RECT
*
r
)
{
if
((
r
->
left
&&
r
->
right
)
||
abs
(
r
->
right
-
r
->
left
)
!=
surface
->
resource
.
width
)
...
...
@@ -1884,7 +1859,6 @@ static const struct wined3d_surface_ops surface_ops =
surface_map
,
surface_unmap
,
surface_getdc
,
surface_flip
,
};
/*****************************************************************************
...
...
@@ -2060,13 +2034,6 @@ static HRESULT gdi_surface_getdc(struct wined3d_surface *surface)
return
hr
;
}
static
HRESULT
gdi_surface_flip
(
struct
wined3d_surface
*
surface
,
struct
wined3d_surface
*
override
)
{
TRACE
(
"surface %p, override %p.
\n
"
,
surface
,
override
);
return
WINED3D_OK
;
}
static
const
struct
wined3d_surface_ops
gdi_surface_ops
=
{
gdi_surface_private_setup
,
...
...
@@ -2077,7 +2044,6 @@ static const struct wined3d_surface_ops gdi_surface_ops =
gdi_surface_map
,
gdi_surface_unmap
,
gdi_surface_getdc
,
gdi_surface_flip
,
};
void
surface_set_texture_name
(
struct
wined3d_surface
*
surface
,
GLuint
new_name
,
BOOL
srgb
)
...
...
@@ -3779,10 +3745,11 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
HRESULT
CDECL
wined3d_surface_flip
(
struct
wined3d_surface
*
surface
,
struct
wined3d_surface
*
override
,
DWORD
flags
)
{
struct
wined3d_swapchain
*
swapchain
;
HRESULT
hr
;
TRACE
(
"surface %p, override %p, flags %#x.
\n
"
,
surface
,
override
,
flags
);
/* FIXME: This will also prevent overlay flips, since overlays aren't on
* a swapchain either. */
if
(
surface
->
container
.
type
!=
WINED3D_CONTAINER_SWAPCHAIN
)
{
ERR
(
"Flipped surface is not on a swapchain.
\n
"
);
...
...
@@ -3790,9 +3757,23 @@ HRESULT CDECL wined3d_surface_flip(struct wined3d_surface *surface, struct wined
}
swapchain
=
surface
->
container
.
u
.
swapchain
;
hr
=
surface
->
surface_ops
->
surface_flip
(
surface
,
override
);
if
(
FAILED
(
hr
))
return
hr
;
/* Flipping is only supported on render targets and overlays. */
if
(
!
(
surface
->
resource
.
usage
&
(
WINED3DUSAGE_RENDERTARGET
|
WINED3DUSAGE_OVERLAY
)))
{
WARN
(
"Tried to flip a non-render target, non-overlay surface.
\n
"
);
return
WINEDDERR_NOTFLIPPABLE
;
}
if
(
surface
->
resource
.
usage
&
WINED3DUSAGE_OVERLAY
)
{
flip_surface
(
surface
,
override
);
/* Update the overlay if it is visible */
if
(
surface
->
overlay_dest
)
return
surface
->
surface_ops
->
surface_draw_overlay
(
surface
);
else
return
WINED3D_OK
;
}
/* Just overwrite the swapchain presentation interval. This is ok because
* only ddraw apps can call Flip, and only d3d8 and d3d9 applications
...
...
dlls/wined3d/wined3d_private.h
View file @
55ce85ad
...
...
@@ -1997,7 +1997,6 @@ struct wined3d_surface_ops
void
(
*
surface_map
)(
struct
wined3d_surface
*
surface
,
const
RECT
*
rect
,
DWORD
flags
);
void
(
*
surface_unmap
)(
struct
wined3d_surface
*
surface
);
HRESULT
(
*
surface_getdc
)(
struct
wined3d_surface
*
surface
);
HRESULT
(
*
surface_flip
)(
struct
wined3d_surface
*
surface
,
struct
wined3d_surface
*
override
);
};
struct
wined3d_surface
...
...
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