Commit 1c1de920 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Remove COM from the surface implementation.

parent ab199f56
......@@ -87,7 +87,7 @@ struct d3d10_texture2d
LONG refcount;
IUnknown *dxgi_surface;
IWineD3DSurface *wined3d_surface;
struct wined3d_surface *wined3d_surface;
D3D10_TEXTURE2D_DESC desc;
};
......
......@@ -1322,7 +1322,7 @@ static void STDMETHODCALLTYPE device_parent_WineD3DDeviceCreated(IWineD3DDeviceP
static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent *iface,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, DWORD usage,
WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface)
WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, struct wined3d_surface **surface)
{
struct d3d10_device *This = device_from_device_parent(iface);
struct d3d10_texture2d *texture;
......@@ -1355,7 +1355,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParen
}
*surface = texture->wined3d_surface;
IWineD3DSurface_AddRef(*surface);
wined3d_surface_incref(*surface);
ID3D10Texture2D_Release((ID3D10Texture2D *)texture);
return S_OK;
......@@ -1364,7 +1364,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParen
static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDeviceParent *iface,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format,
WINED3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL lockable,
IWineD3DSurface **surface)
struct wined3d_surface **surface)
{
struct d3d10_device *This = device_from_device_parent(iface);
struct d3d10_texture2d *texture;
......@@ -1397,7 +1397,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDevice
}
*surface = texture->wined3d_surface;
IWineD3DSurface_AddRef(*surface);
wined3d_surface_incref(*surface);
ID3D10Texture2D_Release((ID3D10Texture2D *)texture);
return S_OK;
......@@ -1405,7 +1405,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDevice
static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent *iface,
UINT width, UINT height, enum wined3d_format_id format, WINED3DMULTISAMPLE_TYPE multisample_type,
DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface)
DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface)
{
struct d3d10_device *This = device_from_device_parent(iface);
struct d3d10_texture2d *texture;
......@@ -1438,7 +1438,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
}
*surface = texture->wined3d_surface;
IWineD3DSurface_AddRef(*surface);
wined3d_surface_incref(*surface);
ID3D10Texture2D_Release((ID3D10Texture2D *)texture);
return S_OK;
......
......@@ -61,7 +61,8 @@ static ULONG STDMETHODCALLTYPE d3d10_texture2d_AddRef(ID3D10Texture2D *iface)
TRACE("%p increasing refcount to %u\n", This, refcount);
if (refcount == 1 && This->wined3d_surface) IWineD3DSurface_AddRef(This->wined3d_surface);
if (refcount == 1 && This->wined3d_surface)
wined3d_surface_incref(This->wined3d_surface);
return refcount;
}
......@@ -83,8 +84,10 @@ static ULONG STDMETHODCALLTYPE d3d10_texture2d_Release(ID3D10Texture2D *iface)
if (!refcount)
{
if (This->wined3d_surface) IWineD3DSurface_Release(This->wined3d_surface);
else d3d10_texture2d_wined3d_object_released(This);
if (This->wined3d_surface)
wined3d_surface_decref(This->wined3d_surface);
else
d3d10_texture2d_wined3d_object_released(This);
}
return refcount;
......
......@@ -37,7 +37,7 @@ static struct wined3d_resource *wined3d_resource_from_resource(ID3D10Resource *r
return wined3d_buffer_get_resource(((struct d3d10_buffer *)resource)->wined3d_buffer);
case D3D10_RESOURCE_DIMENSION_TEXTURE2D:
return IWineD3DSurface_GetResource(((struct d3d10_texture2d *)resource)->wined3d_surface);
return wined3d_surface_get_resource(((struct d3d10_texture2d *)resource)->wined3d_surface);
default:
FIXME("Unhandled resource dimension %#x.\n", dimension);
......
......@@ -242,12 +242,8 @@ struct IDirect3DSurface8Impl
/* IUnknown fields */
const IDirect3DSurface8Vtbl *lpVtbl;
LONG ref;
/* IDirect3DSurface8 fields */
IWineD3DSurface *wineD3DSurface;
/* Parent reference */
LPDIRECT3DDEVICE8 parentDevice;
struct wined3d_surface *wined3d_surface;
IDirect3DDevice8 *parentDevice;
/* The surface container */
IUnknown *container;
......
......@@ -61,7 +61,7 @@ static ULONG WINAPI IDirect3DSurface8Impl_AddRef(LPDIRECT3DSURFACE8 iface) {
{
if (This->parentDevice) IUnknown_AddRef(This->parentDevice);
wined3d_mutex_lock();
IUnknown_AddRef(This->wineD3DSurface);
wined3d_surface_incref(This->wined3d_surface);
wined3d_mutex_unlock();
}
......@@ -89,7 +89,7 @@ static ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface) {
/* Implicit surfaces are destroyed with the device, not if refcount reaches 0. */
wined3d_mutex_lock();
IWineD3DSurface_Release(This->wineD3DSurface);
wined3d_surface_decref(This->wined3d_surface);
wined3d_mutex_unlock();
if (parentDevice) IDirect3DDevice8_Release(parentDevice);
......@@ -139,7 +139,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 if
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
wined3d_mutex_lock();
hr = IWineD3DSurface_SetPrivateData(This->wineD3DSurface, refguid, pData, SizeOfData, Flags);
hr = wined3d_surface_set_private_data(This->wined3d_surface, refguid, pData, SizeOfData, Flags);
wined3d_mutex_unlock();
return hr;
......@@ -153,7 +153,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 if
iface, debugstr_guid(refguid), pData, pSizeOfData);
wined3d_mutex_lock();
hr = IWineD3DSurface_GetPrivateData(This->wineD3DSurface, refguid, pData, pSizeOfData);
hr = wined3d_surface_get_private_data(This->wined3d_surface, refguid, pData, pSizeOfData);
wined3d_mutex_unlock();
return hr;
......@@ -166,7 +166,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 i
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
wined3d_mutex_lock();
hr = IWineD3DSurface_FreePrivateData(This->wineD3DSurface, refguid);
hr = wined3d_surface_free_private_data(This->wined3d_surface, refguid);
wined3d_mutex_unlock();
return hr;
......@@ -196,7 +196,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(IDirect3DSurface8 *iface, D3
TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock();
wined3d_resource = IWineD3DSurface_GetResource(This->wineD3DSurface);
wined3d_resource = wined3d_surface_get_resource(This->wined3d_surface);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
wined3d_mutex_unlock();
......@@ -236,7 +236,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D
}
}
hr = IWineD3DSurface_Map(This->wineD3DSurface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
hr = wined3d_surface_map(This->wined3d_surface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock();
return hr;
......@@ -249,7 +249,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
hr = IWineD3DSurface_Unmap(This->wineD3DSurface);
hr = wined3d_surface_unmap(This->wined3d_surface);
wined3d_mutex_unlock();
switch(hr)
......@@ -306,7 +306,7 @@ HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *devic
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
lockable, discard, level, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, multisample_type,
multisample_quality, SURFACE_OPENGL, surface, &d3d8_surface_wined3d_parent_ops, &surface->wineD3DSurface);
multisample_quality, SURFACE_OPENGL, surface, &d3d8_surface_wined3d_parent_ops, &surface->wined3d_surface);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -109,7 +109,7 @@ static HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(IDirect3DSwapChain8
UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8 **ppBackBuffer)
{
IDirect3DSwapChain8Impl *This = impl_from_IDirect3DSwapChain8(iface);
IWineD3DSurface *mySurface = NULL;
struct wined3d_surface *wined3d_surface = NULL;
HRESULT hr;
TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
......@@ -117,12 +117,12 @@ static HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(IDirect3DSwapChain8
wined3d_mutex_lock();
hr = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain,
iBackBuffer, (WINED3DBACKBUFFER_TYPE)Type, &mySurface);
if (SUCCEEDED(hr) && mySurface)
iBackBuffer, (WINED3DBACKBUFFER_TYPE)Type, &wined3d_surface);
if (SUCCEEDED(hr) && wined3d_surface)
{
*ppBackBuffer = IWineD3DSurface_GetParent(mySurface);
*ppBackBuffer = wined3d_surface_get_parent(wined3d_surface);
IDirect3DSurface8_AddRef(*ppBackBuffer);
IWineD3DSurface_Release(mySurface);
wined3d_surface_decref(wined3d_surface);
}
wined3d_mutex_unlock();
......
......@@ -225,12 +225,8 @@ typedef struct IDirect3DSurface9Impl
/* IUnknown fields */
const IDirect3DSurface9Vtbl *lpVtbl;
LONG ref;
/* IDirect3DResource9 fields */
IWineD3DSurface *wineD3DSurface;
/* Parent reference */
LPDIRECT3DDEVICE9EX parentDevice;
struct wined3d_surface *wined3d_surface;
IDirect3DDevice9Ex *parentDevice;
/* The surface container */
IUnknown *container;
......
......@@ -62,7 +62,7 @@ static ULONG WINAPI IDirect3DSurface9Impl_AddRef(LPDIRECT3DSURFACE9 iface) {
{
if (This->parentDevice) IDirect3DDevice9Ex_AddRef(This->parentDevice);
wined3d_mutex_lock();
IWineD3DSurface_AddRef(This->wineD3DSurface);
wined3d_surface_incref(This->wined3d_surface);
wined3d_mutex_unlock();
}
......@@ -90,7 +90,7 @@ static ULONG WINAPI IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface) {
IDirect3DDevice9Ex *parentDevice = This->parentDevice;
wined3d_mutex_lock();
IWineD3DSurface_Release(This->wineD3DSurface);
wined3d_surface_decref(This->wined3d_surface);
wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */
......@@ -141,7 +141,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_SetPrivateData(LPDIRECT3DSURFACE9 if
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
wined3d_mutex_lock();
hr = IWineD3DSurface_SetPrivateData(This->wineD3DSurface, refguid, pData, SizeOfData, Flags);
hr = wined3d_surface_set_private_data(This->wined3d_surface, refguid, pData, SizeOfData, Flags);
wined3d_mutex_unlock();
return hr;
......@@ -155,7 +155,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetPrivateData(LPDIRECT3DSURFACE9 if
iface, debugstr_guid(refguid), pData, pSizeOfData);
wined3d_mutex_lock();
hr = IWineD3DSurface_GetPrivateData(This->wineD3DSurface, refguid, pData, pSizeOfData);
hr = wined3d_surface_get_private_data(This->wined3d_surface, refguid, pData, pSizeOfData);
wined3d_mutex_unlock();
return hr;
......@@ -168,7 +168,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_FreePrivateData(LPDIRECT3DSURFACE9 i
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
wined3d_mutex_lock();
hr = IWineD3DSurface_FreePrivateData(This->wineD3DSurface, refguid);
hr = wined3d_surface_free_private_data(This->wined3d_surface, refguid);
wined3d_mutex_unlock();
return hr;
......@@ -181,7 +181,7 @@ static DWORD WINAPI IDirect3DSurface9Impl_SetPriority(LPDIRECT3DSURFACE9 iface,
TRACE("iface %p, priority %u.\n", iface, PriorityNew);
wined3d_mutex_lock();
hr = IWineD3DSurface_SetPriority(This->wineD3DSurface, PriorityNew);
hr = wined3d_surface_set_priority(This->wined3d_surface, PriorityNew);
wined3d_mutex_unlock();
return hr;
......@@ -194,7 +194,7 @@ static DWORD WINAPI IDirect3DSurface9Impl_GetPriority(LPDIRECT3DSURFACE9 iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
hr = IWineD3DSurface_GetPriority(This->wineD3DSurface);
hr = wined3d_surface_get_priority(This->wined3d_surface);
wined3d_mutex_unlock();
return hr;
......@@ -206,7 +206,7 @@ static void WINAPI IDirect3DSurface9Impl_PreLoad(LPDIRECT3DSURFACE9 iface) {
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
IWineD3DSurface_PreLoad(This->wineD3DSurface);
wined3d_surface_preload(This->wined3d_surface);
wined3d_mutex_unlock();
}
......@@ -242,7 +242,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(IDirect3DSurface9 *iface, D3
TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock();
wined3d_resource = IWineD3DSurface_GetResource(This->wineD3DSurface);
wined3d_resource = wined3d_surface_get_resource(This->wined3d_surface);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
wined3d_mutex_unlock();
......@@ -265,7 +265,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_LockRect(LPDIRECT3DSURFACE9 iface, D
TRACE("iface %p, locked_rect %p, rect %p, flags %#x.\n", iface, pLockedRect, pRect, Flags);
wined3d_mutex_lock();
hr = IWineD3DSurface_Map(This->wineD3DSurface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
hr = wined3d_surface_map(This->wined3d_surface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock();
return hr;
......@@ -278,7 +278,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
hr = IWineD3DSurface_Unmap(This->wineD3DSurface);
hr = wined3d_surface_unmap(This->wined3d_surface);
wined3d_mutex_unlock();
switch(hr)
......@@ -302,7 +302,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetDC(LPDIRECT3DSURFACE9 iface, HDC*
}
wined3d_mutex_lock();
hr = IWineD3DSurface_GetDC(This->wineD3DSurface, phdc);
hr = wined3d_surface_getdc(This->wined3d_surface, phdc);
wined3d_mutex_unlock();
return hr;
......@@ -315,7 +315,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_ReleaseDC(LPDIRECT3DSURFACE9 iface,
TRACE("iface %p, hdc %p.\n", iface, hdc);
wined3d_mutex_lock();
hr = IWineD3DSurface_ReleaseDC(This->wineD3DSurface, hdc);
hr = wined3d_surface_releasedc(This->wined3d_surface, hdc);
wined3d_mutex_unlock();
switch (hr)
......@@ -394,7 +394,7 @@ HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *devic
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
lockable, discard, level, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, multisample_type,
multisample_quality, SURFACE_OPENGL, surface, &d3d9_surface_wined3d_parent_ops, &surface->wineD3DSurface);
multisample_quality, SURFACE_OPENGL, surface, &d3d9_surface_wined3d_parent_ops, &surface->wined3d_surface);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -106,7 +106,7 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetFrontBufferData(LPDIRECT3DSWAPC
wined3d_mutex_lock();
hr = wined3d_swapchain_get_front_buffer_data(This->wined3d_swapchain,
((IDirect3DSurface9Impl *)pDestSurface)->wineD3DSurface);
((IDirect3DSurface9Impl *)pDestSurface)->wined3d_surface);
wined3d_mutex_unlock();
return hr;
......@@ -116,7 +116,7 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetBackBuffer(IDirect3DSwapChain9
UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9 **ppBackBuffer)
{
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
IWineD3DSurface *mySurface = NULL;
struct wined3d_surface *wined3d_surface = NULL;
HRESULT hr;
TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
......@@ -124,12 +124,12 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetBackBuffer(IDirect3DSwapChain9
wined3d_mutex_lock();
hr = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain,
iBackBuffer, (WINED3DBACKBUFFER_TYPE)Type, &mySurface);
if (SUCCEEDED(hr) && mySurface)
iBackBuffer, (WINED3DBACKBUFFER_TYPE)Type, &wined3d_surface);
if (SUCCEEDED(hr) && wined3d_surface)
{
*ppBackBuffer = IWineD3DSurface_GetParent(mySurface);
*ppBackBuffer = wined3d_surface_get_parent(wined3d_surface);
IDirect3DSurface9_AddRef(*ppBackBuffer);
IWineD3DSurface_Release(mySurface);
wined3d_surface_decref(wined3d_surface);
}
wined3d_mutex_unlock();
......
......@@ -1957,7 +1957,7 @@ static HRESULT WINAPI ddraw4_TestCooperativeLevel(IDirectDraw4 *iface)
static HRESULT WINAPI ddraw7_GetGDISurface(IDirectDraw7 *iface, IDirectDrawSurface7 **GDISurface)
{
IDirectDrawImpl *This = impl_from_IDirectDraw7(iface);
IWineD3DSurface *Surf;
struct wined3d_surface *wined3d_surface;
IDirectDrawSurface7 *ddsurf;
HRESULT hr;
DDSCAPS2 ddsCaps;
......@@ -1969,21 +1969,16 @@ static HRESULT WINAPI ddraw7_GetGDISurface(IDirectDraw7 *iface, IDirectDrawSurfa
*/
EnterCriticalSection(&ddraw_cs);
hr = IWineD3DDevice_GetBackBuffer(This->wineD3DDevice,
0, /* SwapChain */
0, /* first back buffer*/
WINED3DBACKBUFFER_TYPE_MONO,
&Surf);
if( (hr != D3D_OK) ||
(!Surf) )
0, 0, WINED3DBACKBUFFER_TYPE_MONO, &wined3d_surface);
if (FAILED(hr) || !wined3d_surface)
{
ERR("IWineD3DDevice::GetBackBuffer failed\n");
LeaveCriticalSection(&ddraw_cs);
return DDERR_NOTFOUND;
}
ddsurf = IWineD3DSurface_GetParent(Surf);
IWineD3DSurface_Release(Surf);
ddsurf = wined3d_surface_get_parent(wined3d_surface);
wined3d_surface_decref(wined3d_surface);
/* Find the front buffer */
ddsCaps.dwCaps = DDSCAPS_FRONTBUFFER;
......@@ -2384,7 +2379,7 @@ static HRESULT WINAPI ddraw7_GetSurfaceFromDC(IDirectDraw7 *iface, HDC hdc,
IDirectDrawSurface7 **Surface)
{
IDirectDrawImpl *This = impl_from_IDirectDraw7(iface);
IWineD3DSurface *wined3d_surface;
struct wined3d_surface *wined3d_surface;
HRESULT hr;
TRACE("iface %p, dc %p, surface %p.\n", iface, hdc, Surface);
......@@ -2399,7 +2394,7 @@ static HRESULT WINAPI ddraw7_GetSurfaceFromDC(IDirectDraw7 *iface, HDC hdc,
return DDERR_NOTFOUND;
}
*Surface = IWineD3DSurface_GetParent(wined3d_surface);
*Surface = wined3d_surface_get_parent(wined3d_surface);
IDirectDrawSurface7_AddRef(*Surface);
TRACE("Returning surface %p.\n", Surface);
return DD_OK;
......@@ -2518,9 +2513,9 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE
struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
IDirectDrawImpl *This = surfImpl->ddraw;
struct wined3d_clipper *clipper = NULL;
IWineD3DSurface *wineD3DSurface;
struct wined3d_surface *wined3d_surface;
struct wined3d_swapchain *swapchain;
struct wined3d_clipper *clipper;
void *parent;
HRESULT hr;
......@@ -2535,27 +2530,27 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE
/* Get the objects */
swapchain = surfImpl->wined3d_swapchain;
surfImpl->wined3d_swapchain = NULL;
wineD3DSurface = surfImpl->WineD3DSurface;
wined3d_surface = surfImpl->wined3d_surface;
/* get the clipper */
IWineD3DSurface_GetClipper(wineD3DSurface, &clipper);
clipper = wined3d_surface_get_clipper(wined3d_surface);
/* Get the surface properties */
wined3d_resource = IWineD3DSurface_GetResource(wineD3DSurface);
wined3d_resource = wined3d_surface_get_resource(wined3d_surface);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
parent = IWineD3DSurface_GetParent(wineD3DSurface);
parent = wined3d_surface_get_parent(wined3d_surface);
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, wined3d_desc.width, wined3d_desc.height,
wined3d_desc.format, TRUE, FALSE, surfImpl->mipmap_level, wined3d_desc.usage, wined3d_desc.pool,
wined3d_desc.multisample_type, wined3d_desc.multisample_quality, This->ImplType,
parent, &ddraw_surface_wined3d_parent_ops, &surfImpl->WineD3DSurface);
parent, &ddraw_surface_wined3d_parent_ops, &surfImpl->wined3d_surface);
if (FAILED(hr))
{
surfImpl->WineD3DSurface = wineD3DSurface;
surfImpl->wined3d_surface = wined3d_surface;
return hr;
}
IWineD3DSurface_SetClipper(surfImpl->WineD3DSurface, clipper);
wined3d_surface_set_clipper(surfImpl->wined3d_surface, clipper);
/* TODO: Copy the surface content, except for render targets */
......@@ -2569,8 +2564,10 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE
if (surfImpl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
IWineD3DDevice_UninitGDI(This->wineD3DDevice);
surfImpl->isRenderTarget = FALSE;
} else {
if(IWineD3DSurface_Release(wineD3DSurface) == 0)
}
else
{
if (!wined3d_surface_decref(wined3d_surface))
TRACE("Surface released successful, next surface\n");
else
ERR("Something's still holding the old WineD3DSurface\n");
......@@ -2578,9 +2575,6 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE
surfImpl->ImplType = This->ImplType;
if (clipper)
wined3d_clipper_decref(clipper);
return DDENUMRET_OK;
}
......@@ -5660,7 +5654,7 @@ static void STDMETHODCALLTYPE device_parent_WineD3DDeviceCreated(IWineD3DDeviceP
static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent *iface,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, DWORD usage,
WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface)
WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, struct wined3d_surface **surface)
{
struct IDirectDrawImpl *This = ddraw_from_device_parent(iface);
IDirectDrawSurfaceImpl *surf = NULL;
......@@ -5720,8 +5714,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParen
}
/* Return the surface */
*surface = surf->WineD3DSurface;
IWineD3DSurface_AddRef(*surface);
*surface = surf->wined3d_surface;
wined3d_surface_incref(*surface);
TRACE("Returning wineD3DSurface %p, it belongs to surface %p\n", *surface, surf);
......@@ -5752,7 +5746,7 @@ static HRESULT WINAPI findRenderTarget(IDirectDrawSurface7 *surface, DDSURFACEDE
static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDeviceParent *iface,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format,
WINED3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL lockable,
IWineD3DSurface **surface)
struct wined3d_surface **surface)
{
struct IDirectDrawImpl *This = ddraw_from_device_parent(iface);
IDirectDrawSurfaceImpl *d3d_surface = This->d3d_target;
......@@ -5779,8 +5773,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDevice
/* TODO: Return failure if the dimensions do not match, but this shouldn't happen */
*surface = target->WineD3DSurface;
IWineD3DSurface_AddRef(*surface);
*surface = target->wined3d_surface;
wined3d_surface_incref(*surface);
target->isRenderTarget = TRUE;
TRACE("Returning wineD3DSurface %p, it belongs to surface %p\n", *surface, d3d_surface);
......@@ -5790,7 +5784,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDevice
static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent *iface,
UINT width, UINT height, enum wined3d_format_id format, WINED3DMULTISAMPLE_TYPE multisample_type,
DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface)
DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface)
{
struct IDirectDrawImpl *This = ddraw_from_device_parent(iface);
IDirectDrawSurfaceImpl *ddraw_surface;
......@@ -5830,8 +5824,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
return hr;
}
*surface = ddraw_surface->WineD3DSurface;
IWineD3DSurface_AddRef(*surface);
*surface = ddraw_surface->wined3d_surface;
wined3d_surface_incref(*surface);
IDirectDrawSurface7_Release((IDirectDrawSurface7 *)ddraw_surface);
return D3D_OK;
......
......@@ -180,7 +180,7 @@ struct IDirectDrawSurfaceImpl
/* Connections to other Objects */
IDirectDrawImpl *ddraw;
IWineD3DSurface *WineD3DSurface;
struct wined3d_surface *wined3d_surface;
struct wined3d_texture *wined3d_texture;
struct wined3d_swapchain *wined3d_swapchain;
......
......@@ -298,7 +298,7 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface)
/* Set the device up to render to the front buffer since the back
* buffer will vanish soon. */
IWineD3DDevice_SetRenderTarget(This->wineD3DDevice, 0,
This->ddraw->d3d_target->WineD3DSurface, TRUE);
This->ddraw->d3d_target->wined3d_surface, TRUE);
/* Release the WineD3DDevice. This won't destroy it */
if(IWineD3DDevice_Release(This->wineD3DDevice) <= 0)
......@@ -1861,10 +1861,8 @@ IDirect3DDeviceImpl_7_SetRenderTarget(IDirect3DDevice7 *iface,
return D3D_OK;
}
hr = IWineD3DDevice_SetRenderTarget(This->wineD3DDevice,
0,
Target ? Target->WineD3DSurface : NULL,
FALSE);
hr = IWineD3DDevice_SetRenderTarget(This->wineD3DDevice, 0,
Target ? Target->wined3d_surface : NULL, FALSE);
if(hr != D3D_OK)
{
LeaveCriticalSection(&ddraw_cs);
......@@ -5563,7 +5561,7 @@ IDirect3DDeviceImpl_7_PreLoad(IDirect3DDevice7 *iface,
return DDERR_INVALIDPARAMS;
EnterCriticalSection(&ddraw_cs);
IWineD3DSurface_PreLoad(surf->WineD3DSurface);
wined3d_surface_preload(surf->wined3d_surface);
LeaveCriticalSection(&ddraw_cs);
return D3D_OK;
}
......@@ -5978,15 +5976,14 @@ static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
* Some games like Sacrifice set palette after Load, and it is a waste of effort to try to load texture without palette and generates
* warnings in wined3d. */
if (!palette_missing)
hr = IWineD3DDevice_UpdateSurface(device->wineD3DDevice, src_level->WineD3DSurface, &rect, dest_level->WineD3DSurface,
&point);
hr = IWineD3DDevice_UpdateSurface(device->wineD3DDevice, src_level->wined3d_surface,
&rect, dest_level->wined3d_surface, &point);
if (palette_missing || FAILED(hr))
{
/* UpdateSurface may fail e.g. if dest is in system memory. Fall back to BltFast that is less strict. */
IWineD3DSurface_BltFast(dest_level->WineD3DSurface,
point.x, point.y,
src_level->WineD3DSurface, &rect, 0);
wined3d_surface_bltfast(dest_level->wined3d_surface, point.x, point.y,
src_level->wined3d_surface, &rect, 0);
}
ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
......@@ -6778,9 +6775,8 @@ IDirect3DDeviceImpl_UpdateDepthStencil(IDirect3DDeviceImpl *This)
}
dsi = (IDirectDrawSurfaceImpl *)depthStencil;
TRACE("Setting wined3d depth stencil to %p (wined3d %p)\n", dsi, dsi->WineD3DSurface);
IWineD3DDevice_SetDepthStencilSurface(This->wineD3DDevice,
dsi->WineD3DSurface);
TRACE("Setting wined3d depth stencil to %p (wined3d %p)\n", dsi, dsi->wined3d_surface);
IWineD3DDevice_SetDepthStencilSurface(This->wineD3DDevice, dsi->wined3d_surface);
IDirectDrawSurface7_Release(depthStencil);
return WINED3DZB_TRUE;
......@@ -6827,7 +6823,7 @@ HRESULT d3d_device_init(IDirect3DDeviceImpl *device, IDirectDrawImpl *ddraw, IDi
IWineD3DDevice_AddRef(ddraw->wineD3DDevice);
/* Render to the back buffer */
hr = IWineD3DDevice_SetRenderTarget(ddraw->wineD3DDevice, 0, target->WineD3DSurface, TRUE);
hr = IWineD3DDevice_SetRenderTarget(ddraw->wineD3DDevice, 0, target->wined3d_surface, TRUE);
if (FAILED(hr))
{
ERR("Failed to set render target, hr %#x.\n", hr);
......
......@@ -178,7 +178,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
memset(surface, 0, surface_count * sizeof(*surface));
for (i = 0; i < surface_count; ++i)
{
IWineD3DSurface *wined3d_surface;
struct wined3d_surface *wined3d_surface;
IUnknown *parent;
hr = IWineD3DDeviceParent_CreateSurface(device_parent, NULL, desc->Width, desc->Height,
......@@ -190,9 +190,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
goto fail;
}
parent = IWineD3DSurface_GetParent(wined3d_surface);
parent = wined3d_surface_get_parent(wined3d_surface);
hr = IUnknown_QueryInterface(parent, &IID_IDXGISurface, (void **)&surface[i]);
IWineD3DSurface_Release(wined3d_surface);
wined3d_surface_decref(wined3d_surface);
if (FAILED(hr))
{
ERR("Surface should implement IDXGISurface\n");
......
......@@ -144,7 +144,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface,
UINT buffer_idx, REFIID riid, void **surface)
{
struct dxgi_swapchain *This = (struct dxgi_swapchain *)iface;
IWineD3DSurface *backbuffer;
struct wined3d_surface *backbuffer;
IUnknown *parent;
HRESULT hr;
......@@ -161,9 +161,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface,
return hr;
}
parent = IWineD3DSurface_GetParent(backbuffer);
parent = wined3d_surface_get_parent(backbuffer);
hr = IUnknown_QueryInterface(parent, riid, surface);
IWineD3DSurface_Release(backbuffer);
wined3d_surface_decref(backbuffer);
LeaveCriticalSection(&dxgi_cs);
return hr;
......
......@@ -1303,8 +1303,8 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
{
struct wined3d_resource_desc desc;
wined3d_resource_get_desc(&((IWineD3DSurfaceImpl *)backbuffer)->resource, &desc);
IWineD3DSurface_Release(backbuffer);
wined3d_resource_get_desc(&backbuffer->resource, &desc);
wined3d_surface_decref(backbuffer);
/* Set the default scissor rect values */
state->scissor_rect.left = 0;
......
......@@ -41,7 +41,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
if (swapchain->front_buffer)
{
surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_NONE, NULL);
if (IWineD3DSurface_Release((IWineD3DSurface *)swapchain->front_buffer))
if (wined3d_surface_decref(swapchain->front_buffer))
WARN("Something's still holding the front buffer (%p).\n", swapchain->front_buffer);
swapchain->front_buffer = NULL;
}
......@@ -53,7 +53,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
while (i--)
{
surface_set_container(swapchain->back_buffers[i], WINED3D_CONTAINER_NONE, NULL);
if (IWineD3DSurface_Release((IWineD3DSurface *)swapchain->back_buffers[i]))
if (wined3d_surface_decref(swapchain->back_buffers[i]))
WARN("Something's still holding back buffer %u (%p).\n", i, swapchain->back_buffers[i]);
}
HeapFree(GetProcessHeap(), 0, swapchain->back_buffers);
......@@ -161,8 +161,7 @@ HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapc
if (swapchain->presentParms.Windowed)
MapWindowPoints(swapchain->win_handle, NULL, &offset, 1);
IWineD3DSurface_BltFast(dst_surface, offset.x, offset.y,
(IWineD3DSurface *)swapchain->front_buffer, NULL, 0);
wined3d_surface_bltfast(dst_surface, offset.x, offset.y, swapchain->front_buffer, NULL, 0);
return WINED3D_OK;
}
......@@ -187,8 +186,9 @@ HRESULT CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *
return WINED3DERR_INVALIDCALL;
}
*back_buffer = (IWineD3DSurface *)swapchain->back_buffers[back_buffer_idx];
if (*back_buffer) IWineD3DSurface_AddRef(*back_buffer);
*back_buffer = swapchain->back_buffers[back_buffer_idx];
if (*back_buffer)
wined3d_surface_incref(*back_buffer);
TRACE("Returning back buffer %p.\n", *back_buffer);
......@@ -438,7 +438,6 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
* allows to use the Blitting engine and avoid copying the whole texture -> render target blitting code.
*/
memset(&cursor, 0, sizeof(cursor));
cursor.lpVtbl = &IWineD3DSurface_Vtbl;
cursor.resource.ref = 1;
cursor.resource.device = swapchain->device;
cursor.resource.pool = WINED3DPOOL_SCRATCH;
......@@ -459,14 +458,14 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
*/
if (swapchain->presentParms.Windowed)
MapWindowPoints(NULL, swapchain->win_handle, (LPPOINT)&destRect, 2);
IWineD3DSurface_Blt((IWineD3DSurface *)swapchain->back_buffers[0], &destRect,
(IWineD3DSurface *)&cursor, NULL, WINEDDBLT_KEYSRC, NULL, WINED3DTEXF_POINT);
wined3d_surface_blt(swapchain->back_buffers[0], &destRect,
&cursor, NULL, WINEDDBLT_KEYSRC, NULL, WINED3DTEXF_POINT);
}
if (swapchain->device->logo_surface)
{
/* Blit the logo into the upper left corner of the drawable. */
IWineD3DSurface_BltFast((IWineD3DSurface *)swapchain->back_buffers[0], 0, 0,
wined3d_surface_bltfast(swapchain->back_buffers[0], 0, 0,
swapchain->device->logo_surface, NULL, WINEDDBLTFAST_SRCCOLORKEY);
}
......@@ -624,7 +623,7 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
swapchain->device->depth_stencil->resource.height);
if (swapchain->device->depth_stencil == swapchain->device->onscreen_depth_stencil)
{
IWineD3DSurface_Release((IWineD3DSurface *)swapchain->device->onscreen_depth_stencil);
wined3d_surface_decref(swapchain->device->onscreen_depth_stencil);
swapchain->device->onscreen_depth_stencil = NULL;
}
}
......@@ -1069,7 +1068,8 @@ err:
{
for (i = 0; i < swapchain->presentParms.BackBufferCount; ++i)
{
if (swapchain->back_buffers[i]) IWineD3DSurface_Release((IWineD3DSurface *)swapchain->back_buffers[i]);
if (swapchain->back_buffers[i])
wined3d_surface_decref(swapchain->back_buffers[i]);
}
HeapFree(GetProcessHeap(), 0, swapchain->back_buffers);
}
......@@ -1085,7 +1085,8 @@ err:
HeapFree(GetProcessHeap(), 0, swapchain->context);
}
if (swapchain->front_buffer) IWineD3DSurface_Release((IWineD3DSurface *)swapchain->front_buffer);
if (swapchain->front_buffer)
wined3d_surface_decref(swapchain->front_buffer);
return hr;
}
......
......@@ -758,7 +758,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
surface_set_texture_name(surface, 0, FALSE);
surface_set_texture_target(surface, 0);
surface_set_container(surface, WINED3D_CONTAINER_NONE, NULL);
IWineD3DSurface_Release((IWineD3DSurface *)surface);
wined3d_surface_decref(surface);
}
/* Do not call while under the GL lock. */
......
......@@ -76,6 +76,40 @@
@ cdecl wined3d_stateblock_decref(ptr)
@ cdecl wined3d_stateblock_incref(ptr)
@ cdecl wined3d_surface_blt(ptr ptr ptr ptr long ptr long)
@ cdecl wined3d_surface_bltfast(ptr long long ptr ptr long)
@ cdecl wined3d_surface_decref(ptr)
@ cdecl wined3d_surface_flip(ptr ptr long)
@ cdecl wined3d_surface_free_private_data(ptr ptr)
@ cdecl wined3d_surface_get_blt_status(ptr long)
@ cdecl wined3d_surface_get_clipper(ptr)
@ cdecl wined3d_surface_get_flip_status(ptr long)
@ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr)
@ cdecl wined3d_surface_get_palette(ptr)
@ cdecl wined3d_surface_get_parent(ptr)
@ cdecl wined3d_surface_get_pitch(ptr)
@ cdecl wined3d_surface_get_priority(ptr)
@ cdecl wined3d_surface_get_private_data(ptr ptr ptr ptr)
@ cdecl wined3d_surface_get_resource(ptr)
@ cdecl wined3d_surface_getdc(ptr ptr)
@ cdecl wined3d_surface_incref(ptr)
@ cdecl wined3d_surface_is_lost(ptr)
@ cdecl wined3d_surface_map(ptr ptr ptr long)
@ cdecl wined3d_surface_preload(ptr)
@ cdecl wined3d_surface_releasedc(ptr ptr)
@ cdecl wined3d_surface_restore(ptr)
@ cdecl wined3d_surface_set_clipper(ptr ptr)
@ cdecl wined3d_surface_set_color_key(ptr long ptr)
@ cdecl wined3d_surface_set_format(ptr long)
@ cdecl wined3d_surface_set_mem(ptr ptr)
@ cdecl wined3d_surface_set_overlay_position(ptr long long)
@ cdecl wined3d_surface_set_palette(ptr ptr)
@ cdecl wined3d_surface_set_priority(ptr long)
@ cdecl wined3d_surface_set_private_data(ptr ptr ptr long long)
@ cdecl wined3d_surface_unmap(ptr)
@ cdecl wined3d_surface_update_overlay(ptr ptr ptr ptr long ptr)
@ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr)
@ cdecl wined3d_swapchain_decref(ptr)
@ cdecl wined3d_swapchain_get_back_buffer(ptr long long ptr)
@ cdecl wined3d_swapchain_get_device(ptr)
......
......@@ -52,8 +52,9 @@
#define WINED3D_QUIRK_NV_CLIP_BROKEN 0x00000010
#define WINED3D_QUIRK_FBO_TEX_UPDATE 0x00000020
typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl;
typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl;
typedef struct wined3d_surface IWineD3DSurfaceImpl;
typedef struct wined3d_surface IWineD3DSurface;
/* Texture format fixups */
......@@ -2018,33 +2019,26 @@ struct wined3d_subresource_container
struct wined3d_surface_ops
{
HRESULT (*surface_private_setup)(struct IWineD3DSurfaceImpl *surface);
void (*surface_cleanup)(struct IWineD3DSurfaceImpl *surface);
void (*surface_realize_palette)(struct IWineD3DSurfaceImpl *surface);
HRESULT (*surface_draw_overlay)(struct IWineD3DSurfaceImpl *surface);
void (*surface_preload)(struct IWineD3DSurfaceImpl *surface);
void (*surface_map)(struct IWineD3DSurfaceImpl *surface, const RECT *rect, DWORD flags);
void (*surface_unmap)(struct IWineD3DSurfaceImpl *surface);
HRESULT (*surface_getdc)(struct IWineD3DSurfaceImpl *surface);
HRESULT (*surface_flip)(struct IWineD3DSurfaceImpl *surface, struct IWineD3DSurfaceImpl *override);
HRESULT (*surface_blt)(struct IWineD3DSurfaceImpl *dst_surface, const RECT *dst_rect,
IWineD3DSurfaceImpl *src_surface, const RECT *src_rect, DWORD flags,
HRESULT (*surface_private_setup)(struct wined3d_surface *surface);
void (*surface_cleanup)(struct wined3d_surface *surface);
void (*surface_realize_palette)(struct wined3d_surface *surface);
HRESULT (*surface_draw_overlay)(struct wined3d_surface *surface);
void (*surface_preload)(struct wined3d_surface *surface);
void (*surface_map)(struct wined3d_surface *surface, const RECT *rect, DWORD flags);
void (*surface_unmap)(struct wined3d_surface *surface);
HRESULT (*surface_getdc)(struct wined3d_surface *surface);
HRESULT (*surface_flip)(struct wined3d_surface *surface, struct wined3d_surface *override);
HRESULT (*surface_blt)(struct wined3d_surface *dst_surface, const RECT *dst_rect,
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const WINEDDBLTFX *fx, WINED3DTEXTUREFILTERTYPE filter);
HRESULT (*surface_bltfast)(struct IWineD3DSurfaceImpl *dst_surface, DWORD dst_x, DWORD dst_y,
IWineD3DSurfaceImpl *src_surface, const RECT *src_rect, DWORD trans);
HRESULT (*surface_set_mem)(struct IWineD3DSurfaceImpl *surface, void *mem);
HRESULT (*surface_bltfast)(struct wined3d_surface *dst_surface, DWORD dst_x, DWORD dst_y,
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD trans);
HRESULT (*surface_set_mem)(struct wined3d_surface *surface, void *mem);
};
/*****************************************************************************
* IWineD3DSurface implementation structure
*/
struct IWineD3DSurfaceImpl
struct wined3d_surface
{
/* IUnknown & IWineD3DResource Information */
const IWineD3DSurfaceVtbl *lpVtbl;
struct wined3d_resource resource;
/* IWineD3DSurface fields */
const struct wined3d_surface_ops *surface_ops;
struct wined3d_subresource_container container;
struct wined3d_palette *palette; /* D3D7 style palette handling */
......@@ -2099,8 +2093,6 @@ struct IWineD3DSurfaceImpl
struct list overlay_entry;
};
extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl DECLSPEC_HIDDEN;
static inline IWineD3DSurfaceImpl *surface_from_resource(struct wined3d_resource *resource)
{
return CONTAINING_RECORD(resource, IWineD3DSurfaceImpl, resource);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment