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
8fd7d3a2
Commit
8fd7d3a2
authored
Sep 04, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Just return the swapchain from wined3d_device_get_swapchain().
parent
ac5c420c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
113 deletions
+42
-113
device.c
dlls/d3d9/device.c
+4
-4
ddraw.c
dlls/ddraw/ddraw.c
+4
-4
factory.c
dlls/dxgi/factory.c
+4
-5
device.c
dlls/wined3d/device.c
+26
-93
stateblock.c
dlls/wined3d/stateblock.c
+1
-4
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-1
wined3d.h
include/wine/wined3d.h
+2
-2
No files found.
dlls/d3d9/device.c
View file @
8fd7d3a2
...
...
@@ -506,24 +506,24 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_GetSwapChain(IDirect3DDevice
UINT
swapchain_idx
,
IDirect3DSwapChain9
**
swapchain
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
wined3d_swapchain
*
wined3d_swapchain
=
NULL
;
struct
wined3d_swapchain
*
wined3d_swapchain
;
struct
d3d9_swapchain
*
swapchain_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, swapchain_idx %u, swapchain %p.
\n
"
,
iface
,
swapchain_idx
,
swapchain
);
wined3d_mutex_lock
();
hr
=
wined3d_device_get_swapchain
(
device
->
wined3d_device
,
swapchain_idx
,
&
wined3d_swapchain
);
if
(
SUCCEEDED
(
hr
)
&&
wined3d_swapchain
)
if
((
wined3d_swapchain
=
wined3d_device_get_swapchain
(
device
->
wined3d_device
,
swapchain_idx
)))
{
swapchain_impl
=
wined3d_swapchain_get_parent
(
wined3d_swapchain
);
*
swapchain
=
&
swapchain_impl
->
IDirect3DSwapChain9_iface
;
IDirect3DSwapChain9_AddRef
(
*
swapchain
);
wined3d_swapchain_decref
(
wined3d_swapchain
)
;
hr
=
D3D_OK
;
}
else
{
*
swapchain
=
NULL
;
hr
=
D3DERR_INVALIDCALL
;
}
wined3d_mutex_unlock
();
...
...
dlls/ddraw/ddraw.c
View file @
8fd7d3a2
...
...
@@ -695,13 +695,13 @@ static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, BOOL win
return
hr
;
}
if
(
FAILED
(
hr
=
wined3d_device_get_swapchain
(
ddraw
->
wined3d_device
,
0
,
&
ddraw
->
wined3d_swapchain
)))
if
(
!
(
ddraw
->
wined3d_swapchain
=
wined3d_device_get_swapchain
(
ddraw
->
wined3d_device
,
0
)))
{
ERR
(
"Failed to get swapchain, hr %#x.
\n
"
,
hr
);
ddraw
->
wined3d_swapchain
=
NULL
;
return
hr
;
ERR
(
"Failed to get swapchain.
\n
"
);
return
DDERR_INVALIDPARAMS
;
}
wined3d_swapchain_incref
(
ddraw
->
wined3d_swapchain
);
ddraw_set_swapchain_window
(
ddraw
,
window
);
return
DD_OK
;
...
...
dlls/dxgi/factory.c
View file @
8fd7d3a2
...
...
@@ -229,16 +229,15 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IWineDXGIFactory *
return
hr
;
}
hr
=
wined3d_device_get_swapchain
(
wined3d_device
,
0
,
&
wined3d_swapchain
);
wined3d_swapchain
=
wined3d_device_get_swapchain
(
wined3d_device
,
0
);
wined3d_device_decref
(
wined3d_device
);
if
(
FAILED
(
hr
)
)
if
(
!
wined3d_swapchain
)
{
WARN
(
"Failed to get swapchain
, returning %#x
\n
"
,
hr
);
return
hr
;
WARN
(
"Failed to get swapchain
.
\n
"
);
return
E_FAIL
;
}
*
swapchain
=
wined3d_swapchain_get_parent
(
wined3d_swapchain
);
wined3d_swapchain_decref
(
wined3d_swapchain
);
/* FIXME? The swapchain is created with refcount 1 by the wined3d device,
* but the wined3d device can't hold a real reference. */
...
...
dlls/wined3d/device.c
View file @
8fd7d3a2
This diff is collapsed.
Click to expand it.
dlls/wined3d/stateblock.c
View file @
8fd7d3a2
...
...
@@ -1296,8 +1296,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
}
/* check the return values, because the GetBackBuffer call isn't valid for ddraw */
hr
=
wined3d_device_get_swapchain
(
device
,
0
,
&
swapchain
);
if
(
SUCCEEDED
(
hr
)
&&
swapchain
)
if
((
swapchain
=
wined3d_device_get_swapchain
(
device
,
0
)))
{
hr
=
wined3d_swapchain_get_back_buffer
(
swapchain
,
0
,
WINED3D_BACKBUFFER_TYPE_MONO
,
&
backbuffer
);
if
(
SUCCEEDED
(
hr
)
&&
backbuffer
)
...
...
@@ -1321,8 +1320,6 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
state
->
viewport
.
height
=
swapchain
->
desc
.
backbuffer_height
;
state
->
viewport
.
min_z
=
0
.
0
f
;
state
->
viewport
.
max_z
=
1
.
0
f
;
wined3d_swapchain_decref
(
swapchain
);
}
TRACE
(
"Done.
\n
"
);
...
...
dlls/wined3d/wined3d.spec
View file @
8fd7d3a2
...
...
@@ -83,7 +83,7 @@
@ cdecl wined3d_device_get_stream_source(ptr long ptr ptr ptr)
@ cdecl wined3d_device_get_stream_source_freq(ptr long ptr)
@ cdecl wined3d_device_get_surface_from_dc(ptr ptr ptr)
@ cdecl wined3d_device_get_swapchain(ptr long
ptr
)
@ cdecl wined3d_device_get_swapchain(ptr long)
@ cdecl wined3d_device_get_swapchain_count(ptr)
@ cdecl wined3d_device_get_texture(ptr long ptr)
@ cdecl wined3d_device_get_texture_stage_state(ptr long long ptr)
...
...
include/wine/wined3d.h
View file @
8fd7d3a2
...
...
@@ -2157,8 +2157,8 @@ HRESULT __cdecl wined3d_device_get_stream_source_freq(const struct wined3d_devic
UINT
stream_idx
,
UINT
*
divider
);
HRESULT
__cdecl
wined3d_device_get_surface_from_dc
(
const
struct
wined3d_device
*
device
,
HDC
dc
,
struct
wined3d_surface
**
surface
);
HRESULT
__cdecl
wined3d_device_get_swapchain
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
struct
wined3d_swapchain
**
swapchain
);
struct
wined3d_swapchain
*
__cdecl
wined3d_device_get_swapchain
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
);
UINT
__cdecl
wined3d_device_get_swapchain_count
(
const
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_get_texture
(
const
struct
wined3d_device
*
device
,
UINT
stage
,
struct
wined3d_texture
**
texture
);
...
...
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