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
3c07f7a6
Commit
3c07f7a6
authored
Apr 11, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Get rid of the implicit swapchain refcounting hacks.
parent
4e56a4fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
25 deletions
+11
-25
d3d9_private.h
dlls/d3d9/d3d9_private.h
+0
-3
device.c
dlls/d3d9/device.c
+5
-11
swapchain.c
dlls/d3d9/swapchain.c
+6
-11
No files found.
dlls/d3d9/d3d9_private.h
View file @
3c07f7a6
...
...
@@ -222,9 +222,6 @@ typedef struct IDirect3DSwapChain9Impl
/* Parent reference */
LPDIRECT3DDEVICE9EX
parentDevice
;
/* Flags an implicit swap chain */
BOOL
isImplicit
;
}
IDirect3DSwapChain9Impl
;
HRESULT
swapchain_init
(
IDirect3DSwapChain9Impl
*
swapchain
,
IDirect3DDevice9Impl
*
device
,
...
...
dlls/d3d9/device.c
View file @
3c07f7a6
...
...
@@ -183,14 +183,9 @@ static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, U
static
ULONG
WINAPI
D3D9CB_DestroySwapChain
(
IWineD3DSwapChain
*
swapchain
)
{
IDirect3DSwapChain9Impl
*
parent
;
TRACE
(
"swapchain %p.
\n
"
,
swapchain
);
parent
=
IWineD3DSwapChain_GetParent
(
swapchain
);
parent
->
isImplicit
=
FALSE
;
IDirect3DSwapChain9_AddRef
((
IDirect3DSwapChain9
*
)
parent
);
return
IDirect3DSwapChain9_Release
((
IDirect3DSwapChain9
*
)
parent
);
return
IWineD3DSwapChain_Release
(
swapchain
);
}
/* IDirect3D IUnknown parts follow: */
...
...
@@ -3174,8 +3169,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar
WINED3DPRESENT_PARAMETERS
*
present_parameters
,
IWineD3DSwapChain
**
swapchain
)
{
struct
IDirect3DDevice9Impl
*
This
=
device_from_device_parent
(
iface
);
IDirect3DSwapChain9Impl
*
d3d_swapchain
;
D3DPRESENT_PARAMETERS
local_parameters
;
IDirect3DSwapChain9
*
d3d_swapchain
;
HRESULT
hr
;
TRACE
(
"iface %p, present_parameters %p, swapchain %p
\n
"
,
iface
,
present_parameters
,
swapchain
);
...
...
@@ -3197,7 +3192,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar
local_parameters
.
PresentationInterval
=
present_parameters
->
PresentationInterval
;
hr
=
IDirect3DDevice9Impl_CreateAdditionalSwapChain
((
IDirect3DDevice9Ex
*
)
This
,
&
local_parameters
,
(
IDirect3DSwapChain9
**
)
&
d3d_swapchain
);
&
local_parameters
,
&
d3d_swapchain
);
if
(
FAILED
(
hr
))
{
ERR
(
"(%p) CreateAdditionalSwapChain failed, returning %#x
\n
"
,
iface
,
hr
);
...
...
@@ -3205,9 +3200,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar
return
hr
;
}
*
swapchain
=
d3d_swapchain
->
wineD3DSwapChain
;
d3d_swapchain
->
isImplicit
=
TRUE
;
/* Implicit swap chains are created with an refcount of 0 */
*
swapchain
=
((
IDirect3DSwapChain9Impl
*
)
d3d_swapchain
)
->
wineD3DSwapChain
;
IWineD3DSwapChain_AddRef
(
*
swapchain
);
IDirect3DSwapChain9_Release
((
IDirect3DSwapChain9
*
)
d3d_swapchain
);
/* Copy back the presentation parameters */
...
...
dlls/d3d9/swapchain.c
View file @
3c07f7a6
...
...
@@ -55,12 +55,9 @@ static ULONG WINAPI IDirect3DSwapChain9Impl_AddRef(LPDIRECT3DSWAPCHAIN9 iface) {
if
(
This
->
parentDevice
)
IDirect3DDevice9Ex_AddRef
(
This
->
parentDevice
);
if
(
!
This
->
isImplicit
)
{
wined3d_mutex_lock
();
IWineD3DSwapChain_AddRef
(
This
->
wineD3DSwapChain
);
wined3d_mutex_unlock
();
}
wined3d_mutex_lock
();
IWineD3DSwapChain_AddRef
(
This
->
wineD3DSwapChain
);
wined3d_mutex_unlock
();
}
return
ref
;
...
...
@@ -75,11 +72,9 @@ static ULONG WINAPI IDirect3DSwapChain9Impl_Release(LPDIRECT3DSWAPCHAIN9 iface)
if
(
ref
==
0
)
{
IDirect3DDevice9Ex
*
parentDevice
=
This
->
parentDevice
;
if
(
!
This
->
isImplicit
)
{
wined3d_mutex_lock
();
IWineD3DSwapChain_Destroy
(
This
->
wineD3DSwapChain
);
wined3d_mutex_unlock
();
}
wined3d_mutex_lock
();
IWineD3DSwapChain_Release
(
This
->
wineD3DSwapChain
);
wined3d_mutex_unlock
();
/* Release the device last, as it may cause the device to be destroyed. */
if
(
parentDevice
)
IDirect3DDevice9Ex_Release
(
parentDevice
);
...
...
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