Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a7530e78
Commit
a7530e78
authored
Jul 07, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Use unsafe_impl_from_IDirect3DSurface9 for app provided ifaces.
parent
640234c5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
17 deletions
+29
-17
d3d9_private.h
dlls/d3d9/d3d9_private.h
+1
-0
device.c
dlls/d3d9/device.c
+13
-14
surface.c
dlls/d3d9/surface.c
+10
-0
swapchain.c
dlls/d3d9/swapchain.c
+5
-3
No files found.
dlls/d3d9/d3d9_private.h
View file @
a7530e78
...
...
@@ -241,6 +241,7 @@ typedef struct IDirect3DSurface9Impl
HRESULT
surface_init
(
IDirect3DSurface9Impl
*
surface
,
IDirect3DDevice9Impl
*
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
;
/* ---------------------- */
/* IDirect3DVertexBuffer9 */
...
...
dlls/d3d9/device.c
View file @
a7530e78
...
...
@@ -400,7 +400,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetCursorProperties(IDirect3DDevice9E
UINT
XHotSpot
,
UINT
YHotSpot
,
IDirect3DSurface9
*
pCursorBitmap
)
{
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
pSurface
=
(
IDirect3DSurface9Impl
*
)
pCursorBitmap
;
IDirect3DSurface9Impl
*
pSurface
=
unsafe_impl_from_IDirect3DSurface9
(
pCursorBitmap
)
;
HRESULT
hr
;
TRACE
(
"iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.
\n
"
,
...
...
@@ -970,15 +970,16 @@ static HRESULT WINAPI IDirect3DDevice9Impl_UpdateSurface(IDirect3DDevice9Ex *ifa
IDirect3DSurface9
*
pDestinationSurface
,
const
POINT
*
pDestPoint
)
{
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
src
=
unsafe_impl_from_IDirect3DSurface9
(
pSourceSurface
);
IDirect3DSurface9Impl
*
dst
=
unsafe_impl_from_IDirect3DSurface9
(
pDestinationSurface
);
HRESULT
hr
;
TRACE
(
"iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_point %p.
\n
"
,
iface
,
pSourceSurface
,
pSourceRect
,
pDestinationSurface
,
pDestPoint
);
wined3d_mutex_lock
();
hr
=
wined3d_device_update_surface
(
This
->
wined3d_device
,
((
IDirect3DSurface9Impl
*
)
pSourceSurface
)
->
wined3d_surface
,
pSourceRect
,
((
IDirect3DSurface9Impl
*
)
pDestinationSurface
)
->
wined3d_surface
,
pDestPoint
);
hr
=
wined3d_device_update_surface
(
This
->
wined3d_device
,
src
->
wined3d_surface
,
pSourceRect
,
dst
->
wined3d_surface
,
pDestPoint
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -1004,8 +1005,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_UpdateTexture(IDirect3DDevice9Ex *ifa
static
HRESULT
WINAPI
IDirect3DDevice9Impl_GetRenderTargetData
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DSurface9
*
pRenderTarget
,
IDirect3DSurface9
*
pDestSurface
)
{
IDirect3DSurface9Impl
*
renderTarget
=
(
IDirect3DSurface9Impl
*
)
pRenderTarget
;
IDirect3DSurface9Impl
*
destSurface
=
(
IDirect3DSurface9Impl
*
)
pDestSurface
;
IDirect3DSurface9Impl
*
renderTarget
=
unsafe_impl_from_IDirect3DSurface9
(
pRenderTarget
)
;
IDirect3DSurface9Impl
*
destSurface
=
unsafe_impl_from_IDirect3DSurface9
(
pDestSurface
)
;
HRESULT
hr
;
TRACE
(
"iface %p, render_target %p, dst_surface %p.
\n
"
,
iface
,
pRenderTarget
,
pDestSurface
);
...
...
@@ -1022,7 +1023,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(IDirect3DDevice9Ex
UINT
iSwapChain
,
IDirect3DSurface9
*
pDestSurface
)
{
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
destSurface
=
(
IDirect3DSurface9Impl
*
)
pDestSurface
;
IDirect3DSurface9Impl
*
destSurface
=
unsafe_impl_from_IDirect3DSurface9
(
pDestSurface
)
;
HRESULT
hr
;
TRACE
(
"iface %p, swapchain %u, dst_surface %p.
\n
"
,
iface
,
iSwapChain
,
pDestSurface
);
...
...
@@ -1037,8 +1038,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(IDirect3DDevice9Ex
static
HRESULT
WINAPI
IDirect3DDevice9Impl_StretchRect
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DSurface9
*
pSourceSurface
,
const
RECT
*
pSourceRect
,
IDirect3DSurface9
*
pDestSurface
,
const
RECT
*
pDestRect
,
D3DTEXTUREFILTERTYPE
Filter
)
{
IDirect3DSurface9Impl
*
src
=
(
IDirect3DSurface9Impl
*
)
pSourceSurface
;
IDirect3DSurface9Impl
*
dst
=
(
IDirect3DSurface9Impl
*
)
pDestSurface
;
IDirect3DSurface9Impl
*
src
=
unsafe_impl_from_IDirect3DSurface9
(
pSourceSurface
)
;
IDirect3DSurface9Impl
*
dst
=
unsafe_impl_from_IDirect3DSurface9
(
pDestSurface
)
;
HRESULT
hr
;
TRACE
(
"iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_rect %p, filter %#x.
\n
"
,
...
...
@@ -1062,7 +1063,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(IDirect3DDevice9Ex *iface,
((
color
>>
24
)
&
0xff
)
/
255
.
0
f
,
};
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
surface
=
(
IDirect3DSurface9Impl
*
)
pSurface
;
IDirect3DSurface9Impl
*
surface
=
unsafe_impl_from_IDirect3DSurface9
(
pSurface
)
;
struct
wined3d_resource
*
wined3d_resource
;
struct
wined3d_resource_desc
desc
;
HRESULT
hr
;
...
...
@@ -1124,7 +1125,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(IDirect3DDevice9Ex *i
DWORD
RenderTargetIndex
,
IDirect3DSurface9
*
pRenderTarget
)
{
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
pSurface
=
(
IDirect3DSurface9Impl
*
)
pRenderTarget
;
IDirect3DSurface9Impl
*
pSurface
=
unsafe_impl_from_IDirect3DSurface9
(
pRenderTarget
)
;
HRESULT
hr
;
TRACE
(
"iface %p, idx %u, surface %p.
\n
"
,
iface
,
RenderTargetIndex
,
pRenderTarget
);
...
...
@@ -1190,13 +1191,11 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetDepthStencilSurface(IDirect3DDevic
IDirect3DSurface9
*
pZStencilSurface
)
{
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSurface9Impl
*
pSurface
;
IDirect3DSurface9Impl
*
pSurface
=
unsafe_impl_from_IDirect3DSurface9
(
pZStencilSurface
)
;
HRESULT
hr
;
TRACE
(
"iface %p, depth_stencil %p.
\n
"
,
iface
,
pZStencilSurface
);
pSurface
=
(
IDirect3DSurface9Impl
*
)
pZStencilSurface
;
wined3d_mutex_lock
();
hr
=
wined3d_device_set_depth_stencil
(
This
->
wined3d_device
,
pSurface
?
pSurface
->
wined3d_surface
:
NULL
);
wined3d_mutex_unlock
();
...
...
dlls/d3d9/surface.c
View file @
a7530e78
...
...
@@ -20,6 +20,7 @@
*/
#include "config.h"
#include <assert.h>
#include "d3d9_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d9
);
...
...
@@ -423,3 +424,12 @@ HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *devic
return
D3D_OK
;
}
IDirect3DSurface9Impl
*
unsafe_impl_from_IDirect3DSurface9
(
IDirect3DSurface9
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
Direct3DSurface9_Vtbl
);
return
impl_from_IDirect3DSurface9
(
iface
);
}
dlls/d3d9/swapchain.c
View file @
a7530e78
...
...
@@ -98,15 +98,17 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DSwapChain9Impl_Present(LPDIRECT
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DSwapChain9Impl_GetFrontBufferData
(
LPDIRECT3DSWAPCHAIN9
iface
,
IDirect3DSurface9
*
pDestSurface
)
{
static
HRESULT
WINAPI
IDirect3DSwapChain9Impl_GetFrontBufferData
(
IDirect3DSwapChain9
*
iface
,
IDirect3DSurface9
*
pDestSurface
)
{
IDirect3DSwapChain9Impl
*
This
=
(
IDirect3DSwapChain9Impl
*
)
iface
;
IDirect3DSurface9Impl
*
dst
=
unsafe_impl_from_IDirect3DSurface9
(
pDestSurface
);
HRESULT
hr
;
TRACE
(
"iface %p, surface %p.
\n
"
,
iface
,
pDestSurface
);
wined3d_mutex_lock
();
hr
=
wined3d_swapchain_get_front_buffer_data
(
This
->
wined3d_swapchain
,
((
IDirect3DSurface9Impl
*
)
pDestSurface
)
->
wined3d_surface
);
hr
=
wined3d_swapchain_get_front_buffer_data
(
This
->
wined3d_swapchain
,
dst
->
wined3d_surface
);
wined3d_mutex_unlock
();
return
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