d3d8: Implement IDirect3DVolume8 private data handling on top of wined3d_resource.

This commit is contained in:
Henri Verbeet 2011-06-23 00:02:34 +02:00 committed by Alexandre Julliard
parent 52fd36b68b
commit 330ffc83f2
4 changed files with 9 additions and 28 deletions

View File

@ -126,13 +126,15 @@ static HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(IDirect3DVolume8 *ifac
const void *pData, DWORD SizeOfData, DWORD Flags) const void *pData, DWORD SizeOfData, DWORD Flags)
{ {
IDirect3DVolume8Impl *This = impl_from_IDirect3DVolume8(iface); IDirect3DVolume8Impl *This = impl_from_IDirect3DVolume8(iface);
struct wined3d_resource *resource;
HRESULT hr; HRESULT hr;
TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
iface, debugstr_guid(refguid), pData, SizeOfData, Flags); iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_volume_set_private_data(This->wined3d_volume, refguid, pData, SizeOfData, Flags); resource = wined3d_volume_get_resource(This->wined3d_volume);
hr = wined3d_resource_set_private_data(resource, refguid, pData, SizeOfData, Flags);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
@ -142,13 +144,15 @@ static HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(IDirect3DVolume8 *ifac
void *pData, DWORD *pSizeOfData) void *pData, DWORD *pSizeOfData)
{ {
IDirect3DVolume8Impl *This = impl_from_IDirect3DVolume8(iface); IDirect3DVolume8Impl *This = impl_from_IDirect3DVolume8(iface);
struct wined3d_resource *resource;
HRESULT hr; HRESULT hr;
TRACE("iface %p, guid %s, data %p, data_size %p.\n", TRACE("iface %p, guid %s, data %p, data_size %p.\n",
iface, debugstr_guid(refguid), pData, pSizeOfData); iface, debugstr_guid(refguid), pData, pSizeOfData);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_volume_get_private_data(This->wined3d_volume, refguid, pData, pSizeOfData); resource = wined3d_volume_get_resource(This->wined3d_volume);
hr = wined3d_resource_get_private_data(resource, refguid, pData, pSizeOfData);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
@ -157,12 +161,14 @@ static HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(IDirect3DVolume8 *ifac
static HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(IDirect3DVolume8 *iface, REFGUID refguid) static HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(IDirect3DVolume8 *iface, REFGUID refguid)
{ {
IDirect3DVolume8Impl *This = impl_from_IDirect3DVolume8(iface); IDirect3DVolume8Impl *This = impl_from_IDirect3DVolume8(iface);
struct wined3d_resource *resource;
HRESULT hr; HRESULT hr;
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid)); TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_volume_free_private_data(This->wined3d_volume, refguid); resource = wined3d_volume_get_resource(This->wined3d_volume);
hr = wined3d_resource_free_private_data(resource, refguid);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;

View File

@ -173,23 +173,6 @@ void * CDECL wined3d_volume_get_parent(const struct wined3d_volume *volume)
return volume->resource.parent; return volume->resource.parent;
} }
HRESULT CDECL wined3d_volume_set_private_data(struct wined3d_volume *volume,
REFGUID guid, const void *data, DWORD data_size, DWORD flags)
{
return wined3d_resource_set_private_data(&volume->resource, guid, data, data_size, flags);
}
HRESULT CDECL wined3d_volume_get_private_data(const struct wined3d_volume *volume,
REFGUID guid, void *data, DWORD *data_size)
{
return wined3d_resource_get_private_data(&volume->resource, guid, data, data_size);
}
HRESULT CDECL wined3d_volume_free_private_data(struct wined3d_volume *volume, REFGUID guid)
{
return wined3d_resource_free_private_data(&volume->resource, guid);
}
DWORD CDECL wined3d_volume_set_priority(struct wined3d_volume *volume, DWORD priority) DWORD CDECL wined3d_volume_set_priority(struct wined3d_volume *volume, DWORD priority)
{ {
return resource_set_priority(&volume->resource, priority); return resource_set_priority(&volume->resource, priority);

View File

@ -278,15 +278,12 @@
@ cdecl wined3d_volume_create(ptr long long long long long long ptr ptr ptr) @ cdecl wined3d_volume_create(ptr long long long long long long ptr ptr ptr)
@ cdecl wined3d_volume_decref(ptr) @ cdecl wined3d_volume_decref(ptr)
@ cdecl wined3d_volume_free_private_data(ptr ptr)
@ cdecl wined3d_volume_from_resource(ptr) @ cdecl wined3d_volume_from_resource(ptr)
@ cdecl wined3d_volume_get_parent(ptr) @ cdecl wined3d_volume_get_parent(ptr)
@ cdecl wined3d_volume_get_priority(ptr) @ cdecl wined3d_volume_get_priority(ptr)
@ cdecl wined3d_volume_get_private_data(ptr ptr ptr ptr)
@ cdecl wined3d_volume_get_resource(ptr) @ cdecl wined3d_volume_get_resource(ptr)
@ cdecl wined3d_volume_incref(ptr) @ cdecl wined3d_volume_incref(ptr)
@ cdecl wined3d_volume_map(ptr ptr ptr long) @ cdecl wined3d_volume_map(ptr ptr ptr long)
@ cdecl wined3d_volume_preload(ptr) @ cdecl wined3d_volume_preload(ptr)
@ cdecl wined3d_volume_set_priority(ptr long) @ cdecl wined3d_volume_set_priority(ptr long)
@ cdecl wined3d_volume_set_private_data(ptr ptr ptr long long)
@ cdecl wined3d_volume_unmap(ptr) @ cdecl wined3d_volume_unmap(ptr)

View File

@ -2520,20 +2520,15 @@ HRESULT __cdecl wined3d_volume_create(struct wined3d_device *device, UINT width,
DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
const struct wined3d_parent_ops *parent_ops, struct wined3d_volume **volume); const struct wined3d_parent_ops *parent_ops, struct wined3d_volume **volume);
ULONG __cdecl wined3d_volume_decref(struct wined3d_volume *volume); ULONG __cdecl wined3d_volume_decref(struct wined3d_volume *volume);
HRESULT __cdecl wined3d_volume_free_private_data(struct wined3d_volume *volume, REFGUID guid);
struct wined3d_volume * __cdecl wined3d_volume_from_resource(struct wined3d_resource *resource); struct wined3d_volume * __cdecl wined3d_volume_from_resource(struct wined3d_resource *resource);
void * __cdecl wined3d_volume_get_parent(const struct wined3d_volume *volume); void * __cdecl wined3d_volume_get_parent(const struct wined3d_volume *volume);
DWORD __cdecl wined3d_volume_get_priority(const struct wined3d_volume *volume); DWORD __cdecl wined3d_volume_get_priority(const struct wined3d_volume *volume);
HRESULT __cdecl wined3d_volume_get_private_data(const struct wined3d_volume *volume,
REFGUID guid, void *data, DWORD *data_size);
struct wined3d_resource * __cdecl wined3d_volume_get_resource(struct wined3d_volume *volume); struct wined3d_resource * __cdecl wined3d_volume_get_resource(struct wined3d_volume *volume);
ULONG __cdecl wined3d_volume_incref(struct wined3d_volume *volume); ULONG __cdecl wined3d_volume_incref(struct wined3d_volume *volume);
HRESULT __cdecl wined3d_volume_map(struct wined3d_volume *volume, HRESULT __cdecl wined3d_volume_map(struct wined3d_volume *volume,
WINED3DLOCKED_BOX *locked_box, const WINED3DBOX *box, DWORD flags); WINED3DLOCKED_BOX *locked_box, const WINED3DBOX *box, DWORD flags);
void __cdecl wined3d_volume_preload(struct wined3d_volume *volume); void __cdecl wined3d_volume_preload(struct wined3d_volume *volume);
DWORD __cdecl wined3d_volume_set_priority(struct wined3d_volume *volume, DWORD new_priority); DWORD __cdecl wined3d_volume_set_priority(struct wined3d_volume *volume, DWORD new_priority);
HRESULT __cdecl wined3d_volume_set_private_data(struct wined3d_volume *volume,
REFGUID guid, const void *data, DWORD data_size, DWORD flags);
HRESULT __cdecl wined3d_volume_unmap(struct wined3d_volume *volume); HRESULT __cdecl wined3d_volume_unmap(struct wined3d_volume *volume);
#endif /* __WINE_WINED3D_H */ #endif /* __WINE_WINED3D_H */