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
584053d0
Commit
584053d0
authored
May 22, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
May 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Get rid of IDirect3DSwapChain8Impl.
parent
1993727e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
62 deletions
+52
-62
d3d8_private.h
dlls/d3d8/d3d8_private.h
+4
-13
device.c
dlls/d3d8/device.c
+2
-2
swapchain.c
dlls/d3d8/swapchain.c
+46
-47
No files found.
dlls/d3d8/d3d8_private.h
View file @
584053d0
...
...
@@ -101,7 +101,6 @@
void
fixup_caps
(
WINED3DCAPS
*
pWineCaps
)
DECLSPEC_HIDDEN
;
typedef
struct
IDirect3DSurface8Impl
IDirect3DSurface8Impl
;
typedef
struct
IDirect3DSwapChain8Impl
IDirect3DSwapChain8Impl
;
typedef
struct
IDirect3DVolume8Impl
IDirect3DVolume8Impl
;
struct
d3d8
...
...
@@ -189,23 +188,15 @@ struct IDirect3DVolume8Impl
HRESULT
volume_init
(
IDirect3DVolume8Impl
*
volume
,
struct
d3d8_device
*
device
,
UINT
width
,
UINT
height
,
UINT
depth
,
DWORD
usage
,
enum
wined3d_format_id
format
,
enum
wined3d_pool
pool
)
DECLSPEC_HIDDEN
;
/* ------------------- */
/* IDirect3DSwapChain8 */
/* ------------------- */
/*****************************************************************************
* IDirect3DSwapChain8 implementation structure
*/
struct
IDirect3DSwapChain8Impl
struct
d3d8_swapchain
{
/* IUnknown fields */
IDirect3DSwapChain8
IDirect3DSwapChain8_iface
;
LONG
ref
;
LONG
refcount
;
struct
wined3d_swapchain
*
wined3d_swapchain
;
IDirect3DDevice8
*
parent
D
evice
;
IDirect3DDevice8
*
parent
_d
evice
;
};
HRESULT
swapchain_init
(
IDirect3DSwapChain8Impl
*
swapchain
,
struct
d3d8_device
*
device
,
HRESULT
swapchain_init
(
struct
d3d8_swapchain
*
swapchain
,
struct
d3d8_device
*
device
,
D3DPRESENT_PARAMETERS
*
present_parameters
)
DECLSPEC_HIDDEN
;
/* ----------------- */
...
...
dlls/d3d8/device.c
View file @
584053d0
...
...
@@ -498,7 +498,7 @@ static HRESULT WINAPI d3d8_device_CreateAdditionalSwapChain(IDirect3DDevice8 *if
D3DPRESENT_PARAMETERS
*
present_parameters
,
IDirect3DSwapChain8
**
swapchain
)
{
struct
d3d8_device
*
device
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DSwapChain8Impl
*
object
;
struct
d3d8_swapchain
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, present_parameters %p, swapchain %p.
\n
"
,
...
...
@@ -2974,7 +2974,7 @@ static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent
return
hr
;
}
*
swapchain
=
((
IDirect3DSwapChain8Impl
*
)
d3d_swapchain
)
->
wined3d_swapchain
;
*
swapchain
=
((
struct
d3d8_swapchain
*
)
d3d_swapchain
)
->
wined3d_swapchain
;
wined3d_swapchain_incref
(
*
swapchain
);
IDirect3DSwapChain8_Release
(
d3d_swapchain
);
...
...
dlls/d3d8/swapchain.c
View file @
584053d0
...
...
@@ -23,107 +23,106 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d8
);
static
inline
IDirect3DSwapChain8Impl
*
impl_from_IDirect3DSwapChain8
(
IDirect3DSwapChain8
*
iface
)
static
inline
struct
d3d8_swapchain
*
impl_from_IDirect3DSwapChain8
(
IDirect3DSwapChain8
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DSwapChain8Impl
,
IDirect3DSwapChain8_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d8_swapchain
,
IDirect3DSwapChain8_iface
);
}
static
HRESULT
WINAPI
IDirect3DSwapChain8Impl_QueryInterface
(
IDirect3DSwapChain8
*
iface
,
REFIID
riid
,
void
**
ppobj
)
static
HRESULT
WINAPI
d3d8_swapchain_QueryInterface
(
IDirect3DSwapChain8
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"iface %p, riid %s, o
bject %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppobj
);
TRACE
(
"iface %p, riid %s, o
ut %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_IDirect3DSwapChain8
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IUnknown_AddRef
(
iface
);
*
ppobj
=
iface
;
*
out
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
ppobj
=
NULL
;
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirect3DSwapChain8Impl
_AddRef
(
IDirect3DSwapChain8
*
iface
)
static
ULONG
WINAPI
d3d8_swapchain
_AddRef
(
IDirect3DSwapChain8
*
iface
)
{
IDirect3DSwapChain8Impl
*
This
=
impl_from_IDirect3DSwapChain8
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
struct
d3d8_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain8
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
swapchain
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
ref
);
if
(
ref
==
1
)
{
if
(
This
->
parentD
evice
)
IDirect3DDevice8_AddRef
(
This
->
parentD
evice
);
if
(
swapchain
->
parent_d
evice
)
IDirect3DDevice8_AddRef
(
swapchain
->
parent_d
evice
);
wined3d_mutex_lock
();
wined3d_swapchain_incref
(
This
->
wined3d_swapchain
);
wined3d_swapchain_incref
(
swapchain
->
wined3d_swapchain
);
wined3d_mutex_unlock
();
}
return
ref
;
}
static
ULONG
WINAPI
IDirect3DSwapChain8Impl
_Release
(
IDirect3DSwapChain8
*
iface
)
static
ULONG
WINAPI
d3d8_swapchain
_Release
(
IDirect3DSwapChain8
*
iface
)
{
IDirect3DSwapChain8Impl
*
This
=
impl_from_IDirect3DSwapChain8
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
d3d8_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain8
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
swapchain
->
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
ref
);
if
(
!
ref
)
{
IDirect3DDevice8
*
parent
Device
=
This
->
parentD
evice
;
IDirect3DDevice8
*
parent
_device
=
swapchain
->
parent_d
evice
;
wined3d_mutex_lock
();
wined3d_swapchain_decref
(
This
->
wined3d_swapchain
);
wined3d_swapchain_decref
(
swapchain
->
wined3d_swapchain
);
wined3d_mutex_unlock
();
if
(
parent
D
evice
)
IDirect3DDevice8_Release
(
parent
D
evice
);
if
(
parent
_d
evice
)
IDirect3DDevice8_Release
(
parent
_d
evice
);
}
return
ref
;
}
static
HRESULT
WINAPI
IDirect3DSwapChain8Impl
_Present
(
IDirect3DSwapChain8
*
iface
,
const
RECT
*
pSourceRect
,
const
RECT
*
pDestRect
,
HWND
hDestWindowO
verride
,
const
RGNDATA
*
pDirtyR
egion
)
static
HRESULT
WINAPI
d3d8_swapchain
_Present
(
IDirect3DSwapChain8
*
iface
,
const
RECT
*
src_rect
,
const
RECT
*
dst_rect
,
HWND
dst_window_o
verride
,
const
RGNDATA
*
dirty_r
egion
)
{
IDirect3DSwapChain8Impl
*
This
=
impl_from_IDirect3DSwapChain8
(
iface
);
struct
d3d8_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain8
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, src_rect %
p, dst_rect %p
, dst_window_override %p, dirty_region %p.
\n
"
,
iface
,
pSourceRect
,
pDestRect
,
hDestWindowOverride
,
pDirtyR
egion
);
TRACE
(
"iface %p, src_rect %
s, dst_rect %s
, dst_window_override %p, dirty_region %p.
\n
"
,
iface
,
wine_dbgstr_rect
(
src_rect
),
wine_dbgstr_rect
(
dst_rect
),
dst_window_override
,
dirty_r
egion
);
wined3d_mutex_lock
();
hr
=
wined3d_swapchain_present
(
This
->
wined3d_swapchain
,
pSourceR
ect
,
pDestRect
,
hDestWindowOverride
,
pDirtyR
egion
,
0
);
hr
=
wined3d_swapchain_present
(
swapchain
->
wined3d_swapchain
,
src_r
ect
,
dst_rect
,
dst_window_override
,
dirty_r
egion
,
0
);
wined3d_mutex_unlock
();
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DSwapChain8Impl
_GetBackBuffer
(
IDirect3DSwapChain8
*
iface
,
UINT
iBackBuffer
,
D3DBACKBUFFER_TYPE
Type
,
IDirect3DSurface8
**
ppBackB
uffer
)
static
HRESULT
WINAPI
d3d8_swapchain
_GetBackBuffer
(
IDirect3DSwapChain8
*
iface
,
UINT
backbuffer_idx
,
D3DBACKBUFFER_TYPE
backbuffer_type
,
IDirect3DSurface8
**
backb
uffer
)
{
IDirect3DSwapChain8Impl
*
This
=
impl_from_IDirect3DSwapChain8
(
iface
);
struct
d3d8_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain8
(
iface
);
struct
wined3d_surface
*
wined3d_surface
=
NULL
;
IDirect3DSurface8Impl
*
surface_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.
\n
"
,
iface
,
iBackBuffer
,
Type
,
ppBackB
uffer
);
iface
,
backbuffer_idx
,
backbuffer_type
,
backb
uffer
);
wined3d_mutex_lock
();
hr
=
wined3d_swapchain_get_back_buffer
(
This
->
wined3d_swapchain
,
iBackBuffer
,
(
enum
wined3d_backbuffer_type
)
T
ype
,
&
wined3d_surface
);
hr
=
wined3d_swapchain_get_back_buffer
(
swapchain
->
wined3d_swapchain
,
backbuffer_idx
,
(
enum
wined3d_backbuffer_type
)
backbuffer_t
ype
,
&
wined3d_surface
);
if
(
SUCCEEDED
(
hr
)
&&
wined3d_surface
)
{
surface_impl
=
wined3d_surface_get_parent
(
wined3d_surface
);
*
ppBackB
uffer
=
&
surface_impl
->
IDirect3DSurface8_iface
;
IDirect3DSurface8_AddRef
(
*
ppBackB
uffer
);
*
backb
uffer
=
&
surface_impl
->
IDirect3DSurface8_iface
;
IDirect3DSurface8_AddRef
(
*
backb
uffer
);
wined3d_surface_decref
(
wined3d_surface
);
}
wined3d_mutex_unlock
();
...
...
@@ -131,13 +130,13 @@ static HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(IDirect3DSwapChain8
return
hr
;
}
static
const
IDirect3DSwapChain8Vtbl
Direct3DSwapChain8_V
tbl
=
static
const
IDirect3DSwapChain8Vtbl
d3d8_swapchain_v
tbl
=
{
IDirect3DSwapChain8Impl
_QueryInterface
,
IDirect3DSwapChain8Impl
_AddRef
,
IDirect3DSwapChain8Impl
_Release
,
IDirect3DSwapChain8Impl
_Present
,
IDirect3DSwapChain8Impl
_GetBackBuffer
d3d8_swapchain
_QueryInterface
,
d3d8_swapchain
_AddRef
,
d3d8_swapchain
_Release
,
d3d8_swapchain
_Present
,
d3d8_swapchain
_GetBackBuffer
};
static
void
STDMETHODCALLTYPE
d3d8_swapchain_wined3d_object_released
(
void
*
parent
)
...
...
@@ -150,14 +149,14 @@ static const struct wined3d_parent_ops d3d8_swapchain_wined3d_parent_ops =
d3d8_swapchain_wined3d_object_released
,
};
HRESULT
swapchain_init
(
IDirect3DSwapChain8Impl
*
swapchain
,
struct
d3d8_device
*
device
,
HRESULT
swapchain_init
(
struct
d3d8_swapchain
*
swapchain
,
struct
d3d8_device
*
device
,
D3DPRESENT_PARAMETERS
*
present_parameters
)
{
struct
wined3d_swapchain_desc
desc
;
HRESULT
hr
;
swapchain
->
ref
=
1
;
swapchain
->
IDirect3DSwapChain8_iface
.
lpVtbl
=
&
Direct3DSwapChain8_V
tbl
;
swapchain
->
ref
count
=
1
;
swapchain
->
IDirect3DSwapChain8_iface
.
lpVtbl
=
&
d3d8_swapchain_v
tbl
;
desc
.
backbuffer_width
=
present_parameters
->
BackBufferWidth
;
desc
.
backbuffer_height
=
present_parameters
->
BackBufferHeight
;
...
...
@@ -201,8 +200,8 @@ HRESULT swapchain_init(IDirect3DSwapChain8Impl *swapchain, struct d3d8_device *d
return
hr
;
}
swapchain
->
parent
D
evice
=
&
device
->
IDirect3DDevice8_iface
;
IDirect3DDevice8_AddRef
(
swapchain
->
parent
D
evice
);
swapchain
->
parent
_d
evice
=
&
device
->
IDirect3DDevice8_iface
;
IDirect3DDevice8_AddRef
(
swapchain
->
parent
_d
evice
);
return
D3D_OK
;
}
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