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
d1d48d31
Commit
d1d48d31
authored
Aug 18, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: The "forwardReference" field in struct d3d9_surface is always a texture, if set.
parent
c8ec6918
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
43 deletions
+25
-43
d3d9_private.h
dlls/d3d9/d3d9_private.h
+3
-3
device.c
dlls/d3d9/device.c
+1
-11
surface.c
dlls/d3d9/surface.c
+21
-29
No files found.
dlls/d3d9/d3d9_private.h
View file @
d1d48d31
...
...
@@ -216,12 +216,12 @@ struct d3d9_surface
struct
wined3d_surface
*
wined3d_surface
;
IDirect3DDevice9Ex
*
parent_device
;
IUnknown
*
container
;
IUnknown
*
forwardReferenc
e
;
struct
d3d9_texture
*
textur
e
;
BOOL
getdc_supported
;
};
void
surface_init
(
struct
d3d9_surface
*
surface
,
struct
wined3d_surface
*
wined3d_surface
,
struct
d3d9_device
*
devi
ce
,
const
struct
wined3d_parent_ops
**
parent_ops
)
DECLSPEC_HIDDEN
;
void
surface_init
(
struct
d3d9_surface
*
surface
,
IUnknown
*
container_parent
,
struct
wined3d_surface
*
wined3d_surfa
ce
,
const
struct
wined3d_parent_ops
**
parent_ops
)
DECLSPEC_HIDDEN
;
struct
d3d9_surface
*
unsafe_impl_from_IDirect3DSurface9
(
IDirect3DSurface9
*
iface
)
DECLSPEC_HIDDEN
;
struct
d3d9_vertexbuffer
...
...
dlls/d3d9/device.c
View file @
d1d48d31
...
...
@@ -1026,7 +1026,6 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width
sub_resource
=
wined3d_texture_get_sub_resource
(
texture
,
0
);
surface_impl
=
wined3d_resource_get_parent
(
sub_resource
);
surface_impl
->
forwardReference
=
NULL
;
surface_impl
->
parent_device
=
&
device
->
IDirect3DDevice9Ex_iface
;
*
surface
=
&
surface_impl
->
IDirect3DSurface9_iface
;
IDirect3DSurface9_AddRef
(
*
surface
);
...
...
@@ -3461,7 +3460,6 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
void
*
container_parent
,
struct
wined3d_surface
*
surface
,
void
**
parent
,
const
struct
wined3d_parent_ops
**
parent_ops
)
{
struct
d3d9_device
*
device
=
device_from_device_parent
(
device_parent
);
struct
d3d9_surface
*
d3d_surface
;
TRACE
(
"device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p.
\n
"
,
...
...
@@ -3470,17 +3468,10 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
if
(
!
(
d3d_surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
d3d_surface
))))
return
E_OUTOFMEMORY
;
surface_init
(
d3d_surface
,
surface
,
devi
ce
,
parent_ops
);
surface_init
(
d3d_surface
,
container_parent
,
surfa
ce
,
parent_ops
);
*
parent
=
d3d_surface
;
TRACE
(
"Created surface %p.
\n
"
,
d3d_surface
);
d3d_surface
->
container
=
container_parent
;
IDirect3DDevice9Ex_Release
(
d3d_surface
->
parent_device
);
d3d_surface
->
parent_device
=
NULL
;
IDirect3DSurface9_Release
(
&
d3d_surface
->
IDirect3DSurface9_iface
);
d3d_surface
->
forwardReference
=
container_parent
;
return
D3D_OK
;
}
...
...
@@ -3532,7 +3523,6 @@ static HRESULT CDECL device_parent_create_swapchain_surface(struct wined3d_devic
wined3d_texture_decref
(
texture
);
d3d_surface
=
wined3d_surface_get_parent
(
*
surface
);
d3d_surface
->
forwardReference
=
NULL
;
d3d_surface
->
parent_device
=
&
device
->
IDirect3DDevice9Ex_iface
;
return
hr
;
...
...
dlls/d3d9/surface.c
View file @
d1d48d31
...
...
@@ -55,10 +55,10 @@ static ULONG WINAPI d3d9_surface_AddRef(IDirect3DSurface9 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
if
(
surface
->
forwardReferenc
e
)
if
(
surface
->
textur
e
)
{
TRACE
(
"Forwarding to %p.
\n
"
,
surface
->
forwardReferenc
e
);
return
I
Unknown_AddRef
(
surface
->
forwardReferen
ce
);
TRACE
(
"Forwarding to %p.
\n
"
,
surface
->
textur
e
);
return
I
Direct3DBaseTexture9_AddRef
(
&
surface
->
texture
->
IDirect3DBaseTexture9_ifa
ce
);
}
refcount
=
InterlockedIncrement
(
&
surface
->
resource
.
refcount
);
...
...
@@ -83,10 +83,10 @@ static ULONG WINAPI d3d9_surface_Release(IDirect3DSurface9 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
if
(
surface
->
forwardReferenc
e
)
if
(
surface
->
textur
e
)
{
TRACE
(
"Forwarding to %p.
\n
"
,
surface
->
forwardReferenc
e
);
return
I
Unknown_Release
(
surface
->
forwardReferen
ce
);
TRACE
(
"Forwarding to %p.
\n
"
,
surface
->
textur
e
);
return
I
Direct3DBaseTexture9_Release
(
&
surface
->
texture
->
IDirect3DBaseTexture9_ifa
ce
);
}
refcount
=
InterlockedDecrement
(
&
surface
->
resource
.
refcount
);
...
...
@@ -114,22 +114,8 @@ static HRESULT WINAPI d3d9_surface_GetDevice(IDirect3DSurface9 *iface, IDirect3D
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
if
(
surface
->
forwardReference
)
{
IDirect3DResource9
*
resource
;
HRESULT
hr
;
hr
=
IUnknown_QueryInterface
(
surface
->
forwardReference
,
&
IID_IDirect3DResource9
,
(
void
**
)
&
resource
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DResource9_GetDevice
(
resource
,
device
);
IDirect3DResource9_Release
(
resource
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
}
return
hr
;
}
if
(
surface
->
texture
)
return
IDirect3DBaseTexture9_GetDevice
(
&
surface
->
texture
->
IDirect3DBaseTexture9_iface
,
device
);
*
device
=
(
IDirect3DDevice9
*
)
surface
->
parent_device
;
IDirect3DDevice9_AddRef
(
*
device
);
...
...
@@ -355,13 +341,24 @@ static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops =
surface_wined3d_object_destroyed
,
};
void
surface_init
(
struct
d3d9_surface
*
surface
,
struct
wined3d_surface
*
wined3d_surface
,
struct
d3d9_device
*
devi
ce
,
const
struct
wined3d_parent_ops
**
parent_ops
)
void
surface_init
(
struct
d3d9_surface
*
surface
,
IUnknown
*
container_parent
,
struct
wined3d_surface
*
wined3d_surfa
ce
,
const
struct
wined3d_parent_ops
**
parent_ops
)
{
struct
wined3d_resource_desc
desc
;
IDirect3DBaseTexture9
*
texture
;
surface
->
IDirect3DSurface9_iface
.
lpVtbl
=
&
d3d9_surface_vtbl
;
d3d9_resource_init
(
&
surface
->
resource
);
surface
->
resource
.
refcount
=
0
;
surface
->
wined3d_surface
=
wined3d_surface
;
surface
->
container
=
container_parent
;
if
(
container_parent
&&
SUCCEEDED
(
IUnknown_QueryInterface
(
container_parent
,
&
IID_IDirect3DBaseTexture9
,
(
void
**
)
&
texture
)))
{
surface
->
texture
=
unsafe_impl_from_IDirect3DBaseTexture9
(
texture
);
IDirect3DBaseTexture9_Release
(
texture
);
}
wined3d_resource_get_desc
(
wined3d_surface_get_resource
(
wined3d_surface
),
&
desc
);
switch
(
d3dformat_from_wined3dformat
(
desc
.
format
))
...
...
@@ -380,11 +377,6 @@ void surface_init(struct d3d9_surface *surface, struct wined3d_surface *wined3d_
break
;
}
wined3d_surface_incref
(
wined3d_surface
);
surface
->
wined3d_surface
=
wined3d_surface
;
surface
->
parent_device
=
&
device
->
IDirect3DDevice9Ex_iface
;
IDirect3DDevice9Ex_AddRef
(
surface
->
parent_device
);
*
parent_ops
=
&
d3d9_surface_wined3d_parent_ops
;
}
...
...
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