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
56fffd06
Commit
56fffd06
authored
Jun 12, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Get rid of IDirect3DQuery9Impl.
parent
2f2995de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
74 deletions
+62
-74
d3d9_private.h
dlls/d3d9/d3d9_private.h
+8
-18
device.c
dlls/d3d9/device.c
+1
-1
query.c
dlls/d3d9/query.c
+53
-55
No files found.
dlls/d3d9/d3d9_private.h
View file @
56fffd06
...
@@ -299,24 +299,14 @@ HRESULT pixelshader_init(struct d3d9_pixelshader *shader,
...
@@ -299,24 +299,14 @@ HRESULT pixelshader_init(struct d3d9_pixelshader *shader,
struct
d3d9_device
*
device
,
const
DWORD
*
byte_code
)
DECLSPEC_HIDDEN
;
struct
d3d9_device
*
device
,
const
DWORD
*
byte_code
)
DECLSPEC_HIDDEN
;
struct
d3d9_pixelshader
*
unsafe_impl_from_IDirect3DPixelShader9
(
IDirect3DPixelShader9
*
iface
)
DECLSPEC_HIDDEN
;
struct
d3d9_pixelshader
*
unsafe_impl_from_IDirect3DPixelShader9
(
IDirect3DPixelShader9
*
iface
)
DECLSPEC_HIDDEN
;
/* --------------- */
struct
d3d9_query
/* IDirect3DQuery9 */
{
/* --------------- */
IDirect3DQuery9
IDirect3DQuery9_iface
;
LONG
refcount
;
/*****************************************************************************
struct
wined3d_query
*
wined3d_query
;
* IDirect3DPixelShader implementation structure
IDirect3DDevice9Ex
*
parent_device
;
*/
};
typedef
struct
IDirect3DQuery9Impl
{
IDirect3DQuery9
IDirect3DQuery9_iface
;
LONG
ref
;
/* IDirect3DQuery9 fields */
struct
wined3d_query
*
wineD3DQuery
;
/* Parent reference */
IDirect3DDevice9Ex
*
parentDevice
;
}
IDirect3DQuery9Impl
;
HRESULT
query_init
(
IDirect3DQuery9Impl
*
query
,
struct
d3d9_device
*
device
,
D3DQUERYTYPE
type
)
DECLSPEC_HIDDEN
;
HRESULT
query_init
(
struct
d3d9_query
*
query
,
struct
d3d9_device
*
device
,
D3DQUERYTYPE
type
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_D3D9_PRIVATE_H */
#endif
/* __WINE_D3D9_PRIVATE_H */
dlls/d3d9/device.c
View file @
56fffd06
...
@@ -2760,7 +2760,7 @@ static HRESULT WINAPI d3d9_device_DeletePatch(IDirect3DDevice9Ex *iface, UINT ha
...
@@ -2760,7 +2760,7 @@ static HRESULT WINAPI d3d9_device_DeletePatch(IDirect3DDevice9Ex *iface, UINT ha
static
HRESULT
WINAPI
d3d9_device_CreateQuery
(
IDirect3DDevice9Ex
*
iface
,
D3DQUERYTYPE
type
,
IDirect3DQuery9
**
query
)
static
HRESULT
WINAPI
d3d9_device_CreateQuery
(
IDirect3DDevice9Ex
*
iface
,
D3DQUERYTYPE
type
,
IDirect3DQuery9
**
query
)
{
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DQuery9Impl
*
object
;
struct
d3d9_query
*
object
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, type %#x, query %p.
\n
"
,
iface
,
type
,
query
);
TRACE
(
"iface %p, type %#x, query %p.
\n
"
,
iface
,
type
,
query
);
...
...
dlls/d3d9/query.c
View file @
56fffd06
...
@@ -25,66 +25,65 @@
...
@@ -25,66 +25,65 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d9
);
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d9
);
static
inline
IDirect3DQuery9Impl
*
impl_from_IDirect3DQuery9
(
IDirect3DQuery9
*
iface
)
static
inline
struct
d3d9_query
*
impl_from_IDirect3DQuery9
(
IDirect3DQuery9
*
iface
)
{
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DQuery9Impl
,
IDirect3DQuery9_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d9_query
,
IDirect3DQuery9_iface
);
}
}
static
HRESULT
WINAPI
IDirect3DQuery9Impl_QueryInterface
(
IDirect3DQuery9
*
iface
,
REFIID
riid
,
static
HRESULT
WINAPI
d3d9_query_QueryInterface
(
IDirect3DQuery9
*
iface
,
REFIID
riid
,
void
**
out
)
void
**
ppobj
)
{
{
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppobj
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_IDirect3DQuery9
)
if
(
IsEqualGUID
(
riid
,
&
IID_IDirect3DQuery9
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
{
IDirect3DQuery9_AddRef
(
iface
);
IDirect3DQuery9_AddRef
(
iface
);
*
ppobj
=
iface
;
*
out
=
iface
;
return
S_OK
;
return
S_OK
;
}
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
ppobj
=
NULL
;
*
out
=
NULL
;
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
static
ULONG
WINAPI
IDirect3DQuery9Impl
_AddRef
(
IDirect3DQuery9
*
iface
)
static
ULONG
WINAPI
d3d9_query
_AddRef
(
IDirect3DQuery9
*
iface
)
{
{
IDirect3DQuery9Impl
*
This
=
impl_from_IDirect3DQuery9
(
iface
);
struct
d3d9_query
*
query
=
impl_from_IDirect3DQuery9
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
ULONG
ref
count
=
InterlockedIncrement
(
&
query
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
ref
count
);
return
ref
;
return
ref
count
;
}
}
static
ULONG
WINAPI
IDirect3DQuery9Impl
_Release
(
IDirect3DQuery9
*
iface
)
static
ULONG
WINAPI
d3d9_query
_Release
(
IDirect3DQuery9
*
iface
)
{
{
IDirect3DQuery9Impl
*
This
=
impl_from_IDirect3DQuery9
(
iface
);
struct
d3d9_query
*
query
=
impl_from_IDirect3DQuery9
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
count
=
InterlockedDecrement
(
&
query
->
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
ref
count
);
if
(
ref
==
0
)
{
if
(
!
refcount
)
{
wined3d_mutex_lock
();
wined3d_mutex_lock
();
wined3d_query_decref
(
This
->
wineD3DQ
uery
);
wined3d_query_decref
(
query
->
wined3d_q
uery
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
IDirect3DDevice9Ex_Release
(
This
->
parentD
evice
);
IDirect3DDevice9Ex_Release
(
query
->
parent_d
evice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
query
);
}
}
return
ref
;
return
ref
count
;
}
}
static
HRESULT
WINAPI
IDirect3DQuery9Impl_GetDevice
(
IDirect3DQuery9
*
iface
,
static
HRESULT
WINAPI
d3d9_query_GetDevice
(
IDirect3DQuery9
*
iface
,
IDirect3DDevice9
**
device
)
IDirect3DDevice9
**
device
)
{
{
IDirect3DQuery9Impl
*
This
=
impl_from_IDirect3DQuery9
(
iface
);
struct
d3d9_query
*
query
=
impl_from_IDirect3DQuery9
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
IDirect3DDevice9
*
)
This
->
parentD
evice
;
*
device
=
(
IDirect3DDevice9
*
)
query
->
parent_d
evice
;
IDirect3DDevice9_AddRef
(
*
device
);
IDirect3DDevice9_AddRef
(
*
device
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
...
@@ -92,86 +91,85 @@ static HRESULT WINAPI IDirect3DQuery9Impl_GetDevice(IDirect3DQuery9 *iface,
...
@@ -92,86 +91,85 @@ static HRESULT WINAPI IDirect3DQuery9Impl_GetDevice(IDirect3DQuery9 *iface,
return
D3D_OK
;
return
D3D_OK
;
}
}
static
D3DQUERYTYPE
WINAPI
IDirect3DQuery9Impl
_GetType
(
IDirect3DQuery9
*
iface
)
static
D3DQUERYTYPE
WINAPI
d3d9_query
_GetType
(
IDirect3DQuery9
*
iface
)
{
{
IDirect3DQuery9Impl
*
This
=
impl_from_IDirect3DQuery9
(
iface
);
struct
d3d9_query
*
query
=
impl_from_IDirect3DQuery9
(
iface
);
D3DQUERYTYPE
type
;
D3DQUERYTYPE
type
;
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
type
=
wined3d_query_get_type
(
This
->
wineD3DQ
uery
);
type
=
wined3d_query_get_type
(
query
->
wined3d_q
uery
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
type
;
return
type
;
}
}
static
DWORD
WINAPI
IDirect3DQuery9Impl
_GetDataSize
(
IDirect3DQuery9
*
iface
)
static
DWORD
WINAPI
d3d9_query
_GetDataSize
(
IDirect3DQuery9
*
iface
)
{
{
IDirect3DQuery9Impl
*
This
=
impl_from_IDirect3DQuery9
(
iface
);
struct
d3d9_query
*
query
=
impl_from_IDirect3DQuery9
(
iface
);
DWORD
ret
;
DWORD
ret
;
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
ret
=
wined3d_query_get_data_size
(
This
->
wineD3DQ
uery
);
ret
=
wined3d_query_get_data_size
(
query
->
wined3d_q
uery
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
ret
;
return
ret
;
}
}
static
HRESULT
WINAPI
IDirect3DQuery9Impl_Issue
(
IDirect3DQuery9
*
iface
,
DWORD
dwIssueF
lags
)
static
HRESULT
WINAPI
d3d9_query_Issue
(
IDirect3DQuery9
*
iface
,
DWORD
f
lags
)
{
{
IDirect3DQuery9Impl
*
This
=
impl_from_IDirect3DQuery9
(
iface
);
struct
d3d9_query
*
query
=
impl_from_IDirect3DQuery9
(
iface
);
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, flags %#x.
\n
"
,
iface
,
dwIssueF
lags
);
TRACE
(
"iface %p, flags %#x.
\n
"
,
iface
,
f
lags
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
hr
=
wined3d_query_issue
(
This
->
wineD3DQuery
,
dwIssueF
lags
);
hr
=
wined3d_query_issue
(
query
->
wined3d_query
,
f
lags
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
hr
;
return
hr
;
}
}
static
HRESULT
WINAPI
IDirect3DQuery9Impl_GetData
(
IDirect3DQuery9
*
iface
,
void
*
pData
,
static
HRESULT
WINAPI
d3d9_query_GetData
(
IDirect3DQuery9
*
iface
,
void
*
data
,
DWORD
size
,
DWORD
flags
)
DWORD
dwSize
,
DWORD
dwGetDataFlags
)
{
{
IDirect3DQuery9Impl
*
This
=
impl_from_IDirect3DQuery9
(
iface
);
struct
d3d9_query
*
query
=
impl_from_IDirect3DQuery9
(
iface
);
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, data %p, size %u, flags %#x.
\n
"
,
TRACE
(
"iface %p, data %p, size %u, flags %#x.
\n
"
,
iface
,
pData
,
dwSize
,
dwGetDataF
lags
);
iface
,
data
,
size
,
f
lags
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
hr
=
wined3d_query_get_data
(
This
->
wineD3DQuery
,
pData
,
dwSize
,
dwGetDataF
lags
);
hr
=
wined3d_query_get_data
(
query
->
wined3d_query
,
data
,
size
,
f
lags
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
hr
;
return
hr
;
}
}
static
const
IDirect3DQuery9Vtbl
Direct3DQuery9_V
tbl
=
static
const
struct
IDirect3DQuery9Vtbl
d3d9_query_v
tbl
=
{
{
IDirect3DQuery9Impl
_QueryInterface
,
d3d9_query
_QueryInterface
,
IDirect3DQuery9Impl
_AddRef
,
d3d9_query
_AddRef
,
IDirect3DQuery9Impl
_Release
,
d3d9_query
_Release
,
IDirect3DQuery9Impl
_GetDevice
,
d3d9_query
_GetDevice
,
IDirect3DQuery9Impl
_GetType
,
d3d9_query
_GetType
,
IDirect3DQuery9Impl
_GetDataSize
,
d3d9_query
_GetDataSize
,
IDirect3DQuery9Impl
_Issue
,
d3d9_query
_Issue
,
IDirect3DQuery9Impl_GetData
d3d9_query_GetData
,
};
};
HRESULT
query_init
(
IDirect3DQuery9Impl
*
query
,
struct
d3d9_device
*
device
,
D3DQUERYTYPE
type
)
HRESULT
query_init
(
struct
d3d9_query
*
query
,
struct
d3d9_device
*
device
,
D3DQUERYTYPE
type
)
{
{
HRESULT
hr
;
HRESULT
hr
;
query
->
IDirect3DQuery9_iface
.
lpVtbl
=
&
Direct3DQuery9_V
tbl
;
query
->
IDirect3DQuery9_iface
.
lpVtbl
=
&
d3d9_query_v
tbl
;
query
->
ref
=
1
;
query
->
ref
count
=
1
;
wined3d_mutex_lock
();
wined3d_mutex_lock
();
hr
=
wined3d_query_create
(
device
->
wined3d_device
,
type
,
&
query
->
wine
D3DQ
uery
);
hr
=
wined3d_query_create
(
device
->
wined3d_device
,
type
,
&
query
->
wine
d3d_q
uery
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
...
@@ -179,8 +177,8 @@ HRESULT query_init(IDirect3DQuery9Impl *query, struct d3d9_device *device, D3DQU
...
@@ -179,8 +177,8 @@ HRESULT query_init(IDirect3DQuery9Impl *query, struct d3d9_device *device, D3DQU
return
hr
;
return
hr
;
}
}
query
->
parent
D
evice
=
&
device
->
IDirect3DDevice9Ex_iface
;
query
->
parent
_d
evice
=
&
device
->
IDirect3DDevice9Ex_iface
;
IDirect3DDevice9Ex_AddRef
(
query
->
parent
D
evice
);
IDirect3DDevice9Ex_AddRef
(
query
->
parent
_d
evice
);
return
D3D_OK
;
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