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
05318581
Commit
05318581
authored
Dec 18, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Dec 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Handle surface container in d3d8.
parent
73b5fb05
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
37 deletions
+12
-37
d3d8_private.h
dlls/d3d8/d3d8_private.h
+3
-0
device.c
dlls/d3d8/device.c
+1
-0
directx.c
dlls/d3d8/directx.c
+2
-0
surface.c
dlls/d3d8/surface.c
+4
-35
device.c
dlls/d3d8/tests/device.c
+2
-2
No files found.
dlls/d3d8/d3d8_private.h
View file @
05318581
...
...
@@ -253,6 +253,9 @@ struct IDirect3DSurface8Impl
/* Parent reference */
LPDIRECT3DDEVICE8
parentDevice
;
/* The surface container */
IUnknown
*
container
;
/* If set forward refcounting to this object */
IUnknown
*
forwardReference
;
...
...
dlls/d3d8/device.c
View file @
05318581
...
...
@@ -1624,6 +1624,7 @@ HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT
if
(
SUCCEEDED
(
res
))
{
*
ppSurface
=
d3dSurface
->
wineD3DSurface
;
d3dSurface
->
container
=
pSuperior
;
IUnknown_Release
(
d3dSurface
->
parentDevice
);
d3dSurface
->
parentDevice
=
NULL
;
d3dSurface
->
forwardReference
=
pSuperior
;
...
...
dlls/d3d8/directx.c
View file @
05318581
...
...
@@ -200,6 +200,7 @@ HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior,
if
(
SUCCEEDED
(
res
))
{
*
ppSurface
=
d3dSurface
->
wineD3DSurface
;
d3dSurface
->
container
=
device
;
d3dSurface
->
isImplicit
=
TRUE
;
/* Implicit surfaces are created with an refcount of 0 */
IUnknown_Release
((
IUnknown
*
)
d3dSurface
);
...
...
@@ -299,6 +300,7 @@ HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSup
(
D3DFORMAT
)
Format
,
MultiSample
,
(
IDirect3DSurface8
**
)
&
d3dSurface
);
if
(
SUCCEEDED
(
res
))
{
*
ppSurface
=
d3dSurface
->
wineD3DSurface
;
d3dSurface
->
container
=
device
;
d3dSurface
->
isImplicit
=
TRUE
;
/* Implicit surfaces are created with an refcount of 0 */
IUnknown_Release
((
IUnknown
*
)
d3dSurface
);
...
...
dlls/d3d8/surface.c
View file @
05318581
...
...
@@ -113,45 +113,14 @@ static HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 i
static
HRESULT
WINAPI
IDirect3DSurface8Impl_GetContainer
(
LPDIRECT3DSURFACE8
iface
,
REFIID
riid
,
void
**
ppContainer
)
{
IDirect3DSurface8Impl
*
This
=
(
IDirect3DSurface8Impl
*
)
iface
;
HRESULT
res
;
IUnknown
*
IWineContainer
=
NULL
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
/* The container returned from IWineD3DSurface_GetContainer is either an IWineD3DDevice,
one of the subclasses of IWineD3DBaseTexture or an IWineD3DSwapChain */
/* Get the IUnknown container. */
res
=
IWineD3DSurface_GetContainer
(
This
->
wineD3DSurface
,
&
IID_IUnknown
,
(
void
**
)
&
IWineContainer
);
if
(
res
==
D3D_OK
&&
IWineContainer
!=
NULL
)
{
/* Now find out what kind of container it is (so that we can get its parent)*/
IUnknown
*
IUnknownParent
=
NULL
;
IUnknown
*
myContainer
=
NULL
;
if
(
D3D_OK
==
IUnknown_QueryInterface
(
IWineContainer
,
&
IID_IWineD3DDevice
,
(
void
**
)
&
myContainer
))
{
IWineD3DDevice_GetParent
((
IWineD3DDevice
*
)
IWineContainer
,
&
IUnknownParent
);
IUnknown_Release
(
myContainer
);
}
else
if
(
D3D_OK
==
IUnknown_QueryInterface
(
IWineContainer
,
&
IID_IWineD3DBaseTexture
,
(
void
**
)
&
myContainer
))
{
IWineD3DBaseTexture_GetParent
((
IWineD3DBaseTexture
*
)
IWineContainer
,
&
IUnknownParent
);
IUnknown_Release
(
myContainer
);
}
else
if
(
D3D_OK
==
IUnknown_QueryInterface
(
IWineContainer
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
myContainer
))
{
IWineD3DSwapChain_GetParent
((
IWineD3DSwapChain
*
)
IWineContainer
,
&
IUnknownParent
);
IUnknown_Release
(
myContainer
);
}
else
{
FIXME
(
"Container is of unknown interface
\n
"
);
}
/* Tidy up.. */
IUnknown_Release
((
IWineD3DDevice
*
)
IWineContainer
);
/* Now, query the interface of the parent for the riid */
if
(
IUnknownParent
!=
NULL
)
{
res
=
IUnknown_QueryInterface
(
IUnknownParent
,
riid
,
ppContainer
);
/* Tidy up.. */
IUnknown_Release
(
IUnknownParent
);
}
}
if
(
!
This
->
container
)
return
E_NOINTERFACE
;
res
=
IUnknown_QueryInterface
(
This
->
container
,
riid
,
ppContainer
);
TRACE
(
"(%p) : returning %p
\n
"
,
This
,
*
ppContainer
);
TRACE
(
"(%p) : returning %p
\n
"
,
This
,
*
ppContainer
);
return
res
;
}
...
...
dlls/d3d8/tests/device.c
View file @
05318581
...
...
@@ -332,7 +332,7 @@ static void test_refcount(void)
CHECK_CALL
(
hr
,
"GetRenderTarget"
,
pDevice
,
++
refcount
);
if
(
pRenderTarget
)
{
todo_wine
CHECK_SURFACE_CONTAINER
(
pRenderTarget
,
IID_IDirect3DDevice8
,
pDevice
);
CHECK_SURFACE_CONTAINER
(
pRenderTarget
,
IID_IDirect3DDevice8
,
pDevice
);
CHECK_REFCOUNT
(
pRenderTarget
,
1
);
CHECK_ADDREF_REFCOUNT
(
pRenderTarget
,
2
);
...
...
@@ -496,7 +496,7 @@ static void test_refcount(void)
CHECK_REFCOUNT
(
pSwapChain
,
1
);
if
(
pBackBuffer
)
{
todo_wine
CHECK_SURFACE_CONTAINER
(
pBackBuffer
,
IID_IDirect3DDevice8
,
pDevice
);
CHECK_SURFACE_CONTAINER
(
pBackBuffer
,
IID_IDirect3DDevice8
,
pDevice
);
CHECK_REFCOUNT
(
pBackBuffer
,
1
);
CHECK_RELEASE_REFCOUNT
(
pBackBuffer
,
0
);
CHECK_REFCOUNT
(
pDevice
,
--
refcount
);
...
...
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