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
cb9cc2cc
Commit
cb9cc2cc
authored
May 30, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
May 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Get rid of IDirect3DSurface9Impl.
parent
d4c5c03c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
54 deletions
+41
-54
d3d9_private.h
dlls/d3d9/d3d9_private.h
+9
-21
device.c
dlls/d3d9/device.c
+24
-25
surface.c
dlls/d3d9/surface.c
+0
-0
swapchain.c
dlls/d3d9/swapchain.c
+2
-2
texture.c
dlls/d3d9/texture.c
+6
-6
No files found.
dlls/d3d9/d3d9_private.h
View file @
cb9cc2cc
...
...
@@ -187,33 +187,21 @@ struct d3d9_swapchain
HRESULT
d3d9_swapchain_create
(
struct
d3d9_device
*
device
,
D3DPRESENT_PARAMETERS
*
present_parameters
,
struct
d3d9_swapchain
**
swapchain
)
DECLSPEC_HIDDEN
;
/* ----------------- */
/* IDirect3DSurface9 */
/* ----------------- */
/*****************************************************************************
* IDirect3DSurface9 implementation structure
*/
typedef
struct
IDirect3DSurface9Impl
struct
d3d9_surface
{
IDirect3DSurface9
IDirect3DSurface9_iface
;
LONG
ref
;
LONG
ref
count
;
struct
wined3d_surface
*
wined3d_surface
;
IDirect3DDevice9Ex
*
parentDevice
;
/* The surface container */
IUnknown
*
container
;
/* If set forward refcounting to this object */
IUnknown
*
forwardReference
;
BOOL
getdc_supported
;
}
IDirect3DSurface9Impl
;
IDirect3DDevice9Ex
*
parent_device
;
IUnknown
*
container
;
IUnknown
*
forwardReference
;
BOOL
getdc_supported
;
};
HRESULT
surface_init
(
IDirect3DSurface9Impl
*
surface
,
struct
d3d9_device
*
device
,
HRESULT
surface_init
(
struct
d3d9_surface
*
surface
,
struct
d3d9_device
*
device
,
UINT
width
,
UINT
height
,
D3DFORMAT
format
,
BOOL
lockable
,
BOOL
discard
,
UINT
level
,
DWORD
usage
,
D3DPOOL
pool
,
D3DMULTISAMPLE_TYPE
multisample_type
,
DWORD
multisample_quality
)
DECLSPEC_HIDDEN
;
IDirect3DSurface9Impl
*
unsafe_impl_from_IDirect3DSurface9
(
IDirect3DSurface9
*
iface
)
DECLSPEC_HIDDEN
;
struct
d3d9_surface
*
unsafe_impl_from_IDirect3DSurface9
(
IDirect3DSurface9
*
iface
)
DECLSPEC_HIDDEN
;
/* ---------------------- */
/* IDirect3DVertexBuffer9 */
...
...
dlls/d3d9/device.c
View file @
cb9cc2cc
...
...
@@ -391,7 +391,7 @@ static HRESULT WINAPI d3d9_device_SetCursorProperties(IDirect3DDevice9Ex *iface,
UINT
hotspot_x
,
UINT
hotspot_y
,
IDirect3DSurface9
*
bitmap
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
bitmap_impl
=
unsafe_impl_from_IDirect3DSurface9
(
bitmap
);
struct
d3d9_surface
*
bitmap_impl
=
unsafe_impl_from_IDirect3DSurface9
(
bitmap
);
HRESULT
hr
;
TRACE
(
"iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.
\n
"
,
...
...
@@ -501,7 +501,7 @@ static HRESULT CDECL reset_enum_callback(struct wined3d_resource *resource)
wined3d_resource_get_desc
(
resource
,
&
desc
);
if
(
desc
.
pool
==
WINED3D_POOL_DEFAULT
)
{
IDirect3DSurface9Impl
*
surface
;
struct
d3d9_surface
*
surface
;
if
(
desc
.
resource_type
!=
WINED3D_RTYPE_SURFACE
)
{
...
...
@@ -510,7 +510,7 @@ static HRESULT CDECL reset_enum_callback(struct wined3d_resource *resource)
}
surface
=
wined3d_resource_get_parent
(
resource
);
if
(
surface
->
ref
)
if
(
surface
->
ref
count
)
{
WARN
(
"Surface %p (resource %p) in pool D3DPOOL_DEFAULT blocks the Reset call.
\n
"
,
surface
,
resource
);
return
D3DERR_INVALIDCALL
;
...
...
@@ -589,7 +589,7 @@ static HRESULT WINAPI d3d9_device_GetBackBuffer(IDirect3DDevice9Ex *iface, UINT
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
wined3d_surface
*
wined3d_surface
=
NULL
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, swapchain %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.
\n
"
,
...
...
@@ -706,7 +706,7 @@ static HRESULT WINAPI d3d9_device_CreateTexture(IDirect3DDevice9Ex *iface,
if
(
set_mem
)
{
struct
wined3d_resource
*
resource
;
IDirect3DSurface9Impl
*
surface
;
struct
d3d9_surface
*
surface
;
resource
=
wined3d_texture_get_sub_resource
(
object
->
wined3d_texture
,
0
);
surface
=
wined3d_resource_get_parent
(
resource
);
...
...
@@ -865,7 +865,7 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width
D3DFORMAT
format
,
BOOL
lockable
,
BOOL
discard
,
UINT
level
,
IDirect3DSurface9
**
surface
,
UINT
usage
,
D3DPOOL
pool
,
D3DMULTISAMPLE_TYPE
multisample_type
,
DWORD
multisample_quality
)
{
IDirect3DSurface9Impl
*
object
;
struct
d3d9_surface
*
object
;
HRESULT
hr
;
TRACE
(
"device %p, width %u, height %u, format %#x, lockable %#x, discard %#x, level %u, surface %p.
\n
"
...
...
@@ -873,8 +873,7 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width
device
,
width
,
height
,
format
,
lockable
,
discard
,
level
,
surface
,
usage
,
pool
,
multisample_type
,
multisample_quality
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DSurface9Impl
));
if
(
!
object
)
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
{
FIXME
(
"Failed to allocate surface memory.
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
...
...
@@ -943,8 +942,8 @@ static HRESULT WINAPI d3d9_device_UpdateSurface(IDirect3DDevice9Ex *iface,
IDirect3DSurface9
*
dst_surface
,
const
POINT
*
dst_point
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
src
=
unsafe_impl_from_IDirect3DSurface9
(
src_surface
);
IDirect3DSurface9Impl
*
dst
=
unsafe_impl_from_IDirect3DSurface9
(
dst_surface
);
struct
d3d9_surface
*
src
=
unsafe_impl_from_IDirect3DSurface9
(
src_surface
);
struct
d3d9_surface
*
dst
=
unsafe_impl_from_IDirect3DSurface9
(
dst_surface
);
HRESULT
hr
;
TRACE
(
"iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_point %p.
\n
"
,
...
...
@@ -981,8 +980,8 @@ static HRESULT WINAPI d3d9_device_UpdateTexture(IDirect3DDevice9Ex *iface,
static
HRESULT
WINAPI
d3d9_device_GetRenderTargetData
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DSurface9
*
render_target
,
IDirect3DSurface9
*
dst_surface
)
{
IDirect3DSurface9Impl
*
rt_impl
=
unsafe_impl_from_IDirect3DSurface9
(
render_target
);
IDirect3DSurface9Impl
*
dst_impl
=
unsafe_impl_from_IDirect3DSurface9
(
dst_surface
);
struct
d3d9_surface
*
rt_impl
=
unsafe_impl_from_IDirect3DSurface9
(
render_target
);
struct
d3d9_surface
*
dst_impl
=
unsafe_impl_from_IDirect3DSurface9
(
dst_surface
);
HRESULT
hr
;
TRACE
(
"iface %p, render_target %p, dst_surface %p.
\n
"
,
iface
,
render_target
,
dst_surface
);
...
...
@@ -998,7 +997,7 @@ static HRESULT WINAPI d3d9_device_GetFrontBufferData(IDirect3DDevice9Ex *iface,
UINT
swapchain
,
IDirect3DSurface9
*
dst_surface
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
dst_impl
=
unsafe_impl_from_IDirect3DSurface9
(
dst_surface
);
struct
d3d9_surface
*
dst_impl
=
unsafe_impl_from_IDirect3DSurface9
(
dst_surface
);
HRESULT
hr
;
TRACE
(
"iface %p, swapchain %u, dst_surface %p.
\n
"
,
iface
,
swapchain
,
dst_surface
);
...
...
@@ -1014,8 +1013,8 @@ static HRESULT WINAPI d3d9_device_StretchRect(IDirect3DDevice9Ex *iface, IDirect
const
RECT
*
src_rect
,
IDirect3DSurface9
*
dst_surface
,
const
RECT
*
dst_rect
,
D3DTEXTUREFILTERTYPE
filter
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
src
=
unsafe_impl_from_IDirect3DSurface9
(
src_surface
);
IDirect3DSurface9Impl
*
dst
=
unsafe_impl_from_IDirect3DSurface9
(
dst_surface
);
struct
d3d9_surface
*
src
=
unsafe_impl_from_IDirect3DSurface9
(
src_surface
);
struct
d3d9_surface
*
dst
=
unsafe_impl_from_IDirect3DSurface9
(
dst_surface
);
HRESULT
hr
=
D3DERR_INVALIDCALL
;
struct
wined3d_resource_desc
src_desc
,
dst_desc
;
struct
wined3d_resource
*
wined3d_resource
;
...
...
@@ -1085,7 +1084,7 @@ static HRESULT WINAPI d3d9_device_ColorFill(IDirect3DDevice9Ex *iface,
((
color
>>
24
)
&
0xff
)
/
255
.
0
f
,
};
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
surface_impl
=
unsafe_impl_from_IDirect3DSurface9
(
surface
);
struct
d3d9_surface
*
surface_impl
=
unsafe_impl_from_IDirect3DSurface9
(
surface
);
struct
wined3d_resource
*
wined3d_resource
;
struct
wined3d_resource_desc
desc
;
HRESULT
hr
;
...
...
@@ -1141,7 +1140,7 @@ static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurface(IDirect3DDevice9Ex
static
HRESULT
WINAPI
d3d9_device_SetRenderTarget
(
IDirect3DDevice9Ex
*
iface
,
DWORD
idx
,
IDirect3DSurface9
*
surface
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
surface_impl
=
unsafe_impl_from_IDirect3DSurface9
(
surface
);
struct
d3d9_surface
*
surface_impl
=
unsafe_impl_from_IDirect3DSurface9
(
surface
);
HRESULT
hr
;
TRACE
(
"iface %p, idx %u, surface %p.
\n
"
,
iface
,
idx
,
surface
);
...
...
@@ -1164,7 +1163,7 @@ static HRESULT WINAPI d3d9_device_GetRenderTarget(IDirect3DDevice9Ex *iface, DWO
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
wined3d_surface
*
wined3d_surface
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, idx %u, surface %p.
\n
"
,
iface
,
idx
,
surface
);
...
...
@@ -1201,7 +1200,7 @@ static HRESULT WINAPI d3d9_device_GetRenderTarget(IDirect3DDevice9Ex *iface, DWO
static
HRESULT
WINAPI
d3d9_device_SetDepthStencilSurface
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DSurface9
*
depth_stencil
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
ds_impl
=
unsafe_impl_from_IDirect3DSurface9
(
depth_stencil
);
struct
d3d9_surface
*
ds_impl
=
unsafe_impl_from_IDirect3DSurface9
(
depth_stencil
);
HRESULT
hr
;
TRACE
(
"iface %p, depth_stencil %p.
\n
"
,
iface
,
depth_stencil
);
...
...
@@ -1217,7 +1216,7 @@ static HRESULT WINAPI d3d9_device_GetDepthStencilSurface(IDirect3DDevice9Ex *ifa
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
wined3d_surface
*
wined3d_surface
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, depth_stencil %p.
\n
"
,
iface
,
depth_stencil
);
...
...
@@ -3095,7 +3094,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent *
enum
wined3d_pool
pool
,
UINT
level
,
enum
wined3d_cubemap_face
face
,
struct
wined3d_surface
**
surface
)
{
struct
d3d9_device
*
device
=
device_from_device_parent
(
device_parent
);
IDirect3DSurface9Impl
*
d3d_surface
;
struct
d3d9_surface
*
d3d_surface
;
BOOL
lockable
=
TRUE
;
HRESULT
hr
;
...
...
@@ -3119,8 +3118,8 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent *
wined3d_surface_incref
(
*
surface
);
d3d_surface
->
container
=
container_parent
;
IDirect3DDevice9Ex_Release
(
d3d_surface
->
parent
D
evice
);
d3d_surface
->
parent
D
evice
=
NULL
;
IDirect3DDevice9Ex_Release
(
d3d_surface
->
parent
_d
evice
);
d3d_surface
->
parent
_d
evice
=
NULL
;
IDirect3DSurface9_Release
(
&
d3d_surface
->
IDirect3DSurface9_iface
);
d3d_surface
->
forwardReference
=
container_parent
;
...
...
@@ -3134,7 +3133,7 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par
struct
wined3d_surface
**
surface
)
{
struct
d3d9_device
*
device
=
device_from_device_parent
(
device_parent
);
IDirect3DSurface9Impl
*
d3d_surface
;
struct
d3d9_surface
*
d3d_surface
;
HRESULT
hr
;
TRACE
(
"device_parent %p, container_parent %p, width %u, height %u, format %#x, multisample_type %#x,
\n
"
...
...
@@ -3166,7 +3165,7 @@ static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_pa
DWORD
multisample_quality
,
BOOL
discard
,
struct
wined3d_surface
**
surface
)
{
struct
d3d9_device
*
device
=
device_from_device_parent
(
device_parent
);
IDirect3DSurface9Impl
*
d3d_surface
;
struct
d3d9_surface
*
d3d_surface
;
HRESULT
hr
;
TRACE
(
"device_parent %p, width %u, height %u, format %#x, multisample_type %#x,
\n
"
...
...
dlls/d3d9/surface.c
View file @
cb9cc2cc
This diff is collapsed.
Click to expand it.
dlls/d3d9/swapchain.c
View file @
cb9cc2cc
...
...
@@ -113,7 +113,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_swapchain_Present(IDirect3DSwapChai
static
HRESULT
WINAPI
d3d9_swapchain_GetFrontBufferData
(
IDirect3DSwapChain9
*
iface
,
IDirect3DSurface9
*
surface
)
{
struct
d3d9_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain9
(
iface
);
IDirect3DSurface9Impl
*
dst
=
unsafe_impl_from_IDirect3DSurface9
(
surface
);
struct
d3d9_surface
*
dst
=
unsafe_impl_from_IDirect3DSurface9
(
surface
);
HRESULT
hr
;
TRACE
(
"iface %p, surface %p.
\n
"
,
iface
,
surface
);
...
...
@@ -130,7 +130,7 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9 *iface,
{
struct
d3d9_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain9
(
iface
);
struct
wined3d_surface
*
wined3d_surface
=
NULL
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.
\n
"
,
...
...
dlls/d3d9/texture.c
View file @
cb9cc2cc
...
...
@@ -326,7 +326,7 @@ static HRESULT WINAPI d3d9_texture_2d_GetSurfaceLevel(IDirect3DTexture9 *iface,
{
struct
d3d9_texture
*
texture
=
impl_from_IDirect3DTexture9
(
iface
);
struct
wined3d_resource
*
sub_resource
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
TRACE
(
"iface %p, level %u, surface %p.
\n
"
,
iface
,
level
,
surface
);
...
...
@@ -350,7 +350,7 @@ static HRESULT WINAPI d3d9_texture_2d_LockRect(IDirect3DTexture9 *iface,
{
struct
d3d9_texture
*
texture
=
impl_from_IDirect3DTexture9
(
iface
);
struct
wined3d_resource
*
sub_resource
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, level %u, locked_rect %p, rect %p, flags %#x.
\n
"
,
...
...
@@ -373,7 +373,7 @@ static HRESULT WINAPI d3d9_texture_2d_UnlockRect(IDirect3DTexture9 *iface, UINT
{
struct
d3d9_texture
*
texture
=
impl_from_IDirect3DTexture9
(
iface
);
struct
wined3d_resource
*
sub_resource
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, level %u.
\n
"
,
iface
,
level
);
...
...
@@ -748,7 +748,7 @@ static HRESULT WINAPI d3d9_texture_cube_GetCubeMapSurface(IDirect3DCubeTexture9
{
struct
d3d9_texture
*
texture
=
impl_from_IDirect3DCubeTexture9
(
iface
);
struct
wined3d_resource
*
sub_resource
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
UINT
sub_resource_idx
;
DWORD
level_count
;
...
...
@@ -783,7 +783,7 @@ static HRESULT WINAPI d3d9_texture_cube_LockRect(IDirect3DCubeTexture9 *iface,
{
struct
d3d9_texture
*
texture
=
impl_from_IDirect3DCubeTexture9
(
iface
);
struct
wined3d_resource
*
sub_resource
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
UINT
sub_resource_idx
;
HRESULT
hr
;
...
...
@@ -809,7 +809,7 @@ static HRESULT WINAPI d3d9_texture_cube_UnlockRect(IDirect3DCubeTexture9 *iface,
{
struct
d3d9_texture
*
texture
=
impl_from_IDirect3DCubeTexture9
(
iface
);
struct
wined3d_resource
*
sub_resource
;
IDirect3DSurface9Impl
*
surface_impl
;
struct
d3d9_surface
*
surface_impl
;
UINT
sub_resource_idx
;
HRESULT
hr
;
...
...
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