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
cb865294
Commit
cb865294
authored
Dec 05, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Dec 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d: Callback infrastructure for implicit render target destruction in IWineD3DSwapChain.
parent
2946f7a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
36 deletions
+38
-36
swapchain.c
dlls/wined3d/swapchain.c
+36
-35
wined3d_interface.h
include/wine/wined3d_interface.h
+2
-1
No files found.
dlls/wined3d/swapchain.c
View file @
cb865294
...
@@ -88,41 +88,7 @@ static ULONG WINAPI IWineD3DSwapChainImpl_Release(IWineD3DSwapChain *iface) {
...
@@ -88,41 +88,7 @@ static ULONG WINAPI IWineD3DSwapChainImpl_Release(IWineD3DSwapChain *iface) {
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
refCount
);
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
refCount
);
if
(
refCount
==
0
)
{
if
(
refCount
==
0
)
{
IUnknown
*
bufferParent
;
IWineD3DSwapChain_Destroy
(
iface
,
D3DCB_DefaultDestroySurface
);
/* release the ref to the front and back buffer parents */
if
(
This
->
frontBuffer
)
{
IWineD3DSurface_SetContainer
(
This
->
frontBuffer
,
0
);
IWineD3DSurface_GetParent
(
This
->
frontBuffer
,
&
bufferParent
);
IUnknown_Release
(
bufferParent
);
/* once for the get parent */
if
(
IUnknown_Release
(
bufferParent
)
>
0
){
FIXME
(
"(%p) Something's still holding the front buffer
\n
"
,
This
);
}
}
if
(
This
->
backBuffer
)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
presentParms
.
BackBufferCount
;
i
++
)
{
IWineD3DSurface_SetContainer
(
This
->
backBuffer
[
i
],
0
);
IWineD3DSurface_GetParent
(
This
->
backBuffer
[
i
],
&
bufferParent
);
IUnknown_Release
(
bufferParent
);
/* once for the get parent */
if
(
IUnknown_Release
(
bufferParent
)
>
0
){
FIXME
(
"(%p) Something's still holding the back buffer
\n
"
,
This
);
}
}
}
/* Clean up the context */
/* check that we are the current context first */
if
(
glXGetCurrentContext
()
==
This
->
glCtx
){
glXMakeCurrent
(
This
->
display
,
None
,
NULL
);
}
glXDestroyContext
(
This
->
display
,
This
->
glCtx
);
/* IUnknown_Release(This->parent); This should only apply to the primary swapchain,
all others are created by the caller, so releasing the parent should cause
the child to be released, not the other way around!
*/
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
return
refCount
;
return
refCount
;
}
}
...
@@ -136,6 +102,40 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_GetParent(IWineD3DSwapChain *iface,
...
@@ -136,6 +102,40 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_GetParent(IWineD3DSwapChain *iface,
}
}
/*IWineD3DSwapChain parts follow: */
/*IWineD3DSwapChain parts follow: */
static
void
WINAPI
IWineD3DSwapChainImpl_Destroy
(
IWineD3DSwapChain
*
iface
,
D3DCB_DESTROYSURFACEFN
D3DCB_DestroyRenderTarget
)
{
IWineD3DSwapChainImpl
*
This
=
(
IWineD3DSwapChainImpl
*
)
iface
;
/* release the ref to the front and back buffer parents */
if
(
This
->
frontBuffer
)
{
IWineD3DSurface_SetContainer
(
This
->
frontBuffer
,
0
);
if
(
D3DCB_DestroyRenderTarget
(
This
->
frontBuffer
)
>
0
)
{
FIXME
(
"(%p) Something's still holding the front buffer
\n
"
,
This
);
}
}
if
(
This
->
backBuffer
)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
presentParms
.
BackBufferCount
;
i
++
)
{
IWineD3DSurface_SetContainer
(
This
->
backBuffer
[
i
],
0
);
if
(
D3DCB_DestroyRenderTarget
(
This
->
backBuffer
[
i
])
>
0
)
{
FIXME
(
"(%p) Something's still holding the back buffer
\n
"
,
This
);
}
}
}
/* Clean up the context */
/* check that we are the current context first */
if
(
glXGetCurrentContext
()
==
This
->
glCtx
){
glXMakeCurrent
(
This
->
display
,
None
,
NULL
);
}
glXDestroyContext
(
This
->
display
,
This
->
glCtx
);
/* IUnknown_Release(This->parent); This should only apply to the primary swapchain,
all others are created by the caller, so releasing the parent should cause
the child to be released, not the other way around!
*/
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
HRESULT
WINAPI
IWineD3DSwapChainImpl_Present
(
IWineD3DSwapChain
*
iface
,
CONST
RECT
*
pSourceRect
,
CONST
RECT
*
pDestRect
,
HWND
hDestWindowOverride
,
CONST
RGNDATA
*
pDirtyRegion
,
DWORD
dwFlags
)
{
static
HRESULT
WINAPI
IWineD3DSwapChainImpl_Present
(
IWineD3DSwapChain
*
iface
,
CONST
RECT
*
pSourceRect
,
CONST
RECT
*
pDestRect
,
HWND
hDestWindowOverride
,
CONST
RGNDATA
*
pDirtyRegion
,
DWORD
dwFlags
)
{
IWineD3DSwapChainImpl
*
This
=
(
IWineD3DSwapChainImpl
*
)
iface
;
IWineD3DSwapChainImpl
*
This
=
(
IWineD3DSwapChainImpl
*
)
iface
;
...
@@ -572,6 +572,7 @@ IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl =
...
@@ -572,6 +572,7 @@ IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl =
IWineD3DSwapChainImpl_Release
,
IWineD3DSwapChainImpl_Release
,
/* IWineD3DSwapChain */
/* IWineD3DSwapChain */
IWineD3DSwapChainImpl_GetParent
,
IWineD3DSwapChainImpl_GetParent
,
IWineD3DSwapChainImpl_Destroy
,
IWineD3DSwapChainImpl_GetDevice
,
IWineD3DSwapChainImpl_GetDevice
,
IWineD3DSwapChainImpl_Present
,
IWineD3DSwapChainImpl_Present
,
IWineD3DSwapChainImpl_GetFrontBufferData
,
IWineD3DSwapChainImpl_GetFrontBufferData
,
...
...
include/wine/wined3d_interface.h
View file @
cb865294
...
@@ -1367,6 +1367,7 @@ DECLARE_INTERFACE_(IWineD3DSwapChain,IWineD3DBase)
...
@@ -1367,6 +1367,7 @@ DECLARE_INTERFACE_(IWineD3DSwapChain,IWineD3DBase)
/*** IWineD3DBase methods ***/
/*** IWineD3DBase methods ***/
STDMETHOD
(
GetParent
)(
THIS_
IUnknown
**
pParent
)
PURE
;
STDMETHOD
(
GetParent
)(
THIS_
IUnknown
**
pParent
)
PURE
;
/*** IDirect3DSwapChain9 methods ***/
/*** IDirect3DSwapChain9 methods ***/
STDMETHOD_
(
void
,
Destroy
)(
THIS_
D3DCB_DESTROYSURFACEFN
pFn
)
PURE
;
STDMETHOD
(
GetDevice
)(
THIS_
IWineD3DDevice
**
ppDevice
)
PURE
;
STDMETHOD
(
GetDevice
)(
THIS_
IWineD3DDevice
**
ppDevice
)
PURE
;
STDMETHOD
(
Present
)(
THIS_
CONST
RECT
*
pSourceRect
,
CONST
RECT
*
pDestRect
,
HWND
hDestWindowOverride
,
CONST
RGNDATA
*
pDirtyRegion
,
DWORD
dwFlags
)
PURE
;
STDMETHOD
(
Present
)(
THIS_
CONST
RECT
*
pSourceRect
,
CONST
RECT
*
pDestRect
,
HWND
hDestWindowOverride
,
CONST
RGNDATA
*
pDirtyRegion
,
DWORD
dwFlags
)
PURE
;
STDMETHOD
(
GetFrontBufferData
)(
THIS_
IWineD3DSurface
*
pDestSurface
)
PURE
;
STDMETHOD
(
GetFrontBufferData
)(
THIS_
IWineD3DSurface
*
pDestSurface
)
PURE
;
...
@@ -1387,7 +1388,7 @@ DECLARE_INTERFACE_(IWineD3DSwapChain,IWineD3DBase)
...
@@ -1387,7 +1388,7 @@ DECLARE_INTERFACE_(IWineD3DSwapChain,IWineD3DBase)
/*** IWineD3DBase methods ***/
/*** IWineD3DBase methods ***/
#define IWineD3DSwapChain_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
#define IWineD3DSwapChain_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
/*** IWineD3DSwapChain methods ***/
/*** IWineD3DSwapChain methods ***/
#define IWineD3DSwapChain_Destroy(p,a) (p)->lpVtbl->Destroy(p,a)
#define IWineD3DSwapChain_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
#define IWineD3DSwapChain_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
#define IWineD3DSwapChain_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e)
#define IWineD3DSwapChain_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e)
#define IWineD3DSwapChain_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a)
#define IWineD3DSwapChain_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a)
...
...
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