Commit 2b18192e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of IWineD3DSurface::GetDesc().

parent 30997b56
...@@ -931,6 +931,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(IDirect3DDevice8 *iface, ...@@ -931,6 +931,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(IDirect3DDevice8 *iface,
IDirect3DSurface8Impl *Dest = (IDirect3DSurface8Impl *) pDestinationSurface; IDirect3DSurface8Impl *Dest = (IDirect3DSurface8Impl *) pDestinationSurface;
enum wined3d_format_id srcFormat, destFormat; enum wined3d_format_id srcFormat, destFormat;
struct wined3d_resource_desc wined3d_desc; struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n", TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
iface, pSourceSurface, pSourceRects, cRects, pDestinationSurface, pDestPoints); iface, pSourceSurface, pSourceRects, cRects, pDestinationSurface, pDestPoints);
...@@ -939,10 +940,12 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(IDirect3DDevice8 *iface, ...@@ -939,10 +940,12 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(IDirect3DDevice8 *iface,
* destination texture is in WINED3DPOOL_DEFAULT. */ * destination texture is in WINED3DPOOL_DEFAULT. */
wined3d_mutex_lock(); wined3d_mutex_lock();
IWineD3DSurface_GetDesc(Source->wineD3DSurface, &wined3d_desc); wined3d_resource = IWineD3DSurface_GetResource(Source->wineD3DSurface);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
srcFormat = wined3d_desc.format; srcFormat = wined3d_desc.format;
IWineD3DSurface_GetDesc(Dest->wineD3DSurface, &wined3d_desc); wined3d_resource = IWineD3DSurface_GetResource(Dest->wineD3DSurface);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
destFormat = wined3d_desc.format; destFormat = wined3d_desc.format;
/* Check that the source and destination formats match */ /* Check that the source and destination formats match */
......
...@@ -191,11 +191,13 @@ static HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(IDirect3DSurface8 *iface, D3 ...@@ -191,11 +191,13 @@ static HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(IDirect3DSurface8 *iface, D3
{ {
IDirect3DSurface8Impl *This = (IDirect3DSurface8Impl *)iface; IDirect3DSurface8Impl *This = (IDirect3DSurface8Impl *)iface;
struct wined3d_resource_desc wined3d_desc; struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock(); wined3d_mutex_lock();
IWineD3DSurface_GetDesc(This->wineD3DSurface, &wined3d_desc); wined3d_resource = IWineD3DSurface_GetResource(This->wineD3DSurface);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format); desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
......
...@@ -1070,6 +1070,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(IDirect3DDevice9Ex *iface, ...@@ -1070,6 +1070,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(IDirect3DDevice9Ex *iface,
}; };
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
IDirect3DSurface9Impl *surface = (IDirect3DSurface9Impl *)pSurface; IDirect3DSurface9Impl *surface = (IDirect3DSurface9Impl *)pSurface;
struct wined3d_resource *wined3d_resource;
struct wined3d_resource_desc desc; struct wined3d_resource_desc desc;
HRESULT hr; HRESULT hr;
...@@ -1077,7 +1078,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(IDirect3DDevice9Ex *iface, ...@@ -1077,7 +1078,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(IDirect3DDevice9Ex *iface,
wined3d_mutex_lock(); wined3d_mutex_lock();
IWineD3DSurface_GetDesc(surface->wineD3DSurface, &desc); wined3d_resource = IWineD3DSurface_GetResource(surface->wineD3DSurface);
wined3d_resource_get_desc(wined3d_resource, &desc);
/* This method is only allowed with surfaces that are render targets, or /* This method is only allowed with surfaces that are render targets, or
* offscreen plain surfaces in D3DPOOL_DEFAULT. */ * offscreen plain surfaces in D3DPOOL_DEFAULT. */
......
...@@ -243,11 +243,13 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(IDirect3DSurface9 *iface, D3 ...@@ -243,11 +243,13 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(IDirect3DSurface9 *iface, D3
{ {
IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface;
struct wined3d_resource_desc wined3d_desc; struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock(); wined3d_mutex_lock();
IWineD3DSurface_GetDesc(This->wineD3DSurface, &wined3d_desc); wined3d_resource = IWineD3DSurface_GetResource(This->wineD3DSurface);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format); desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
......
...@@ -2516,6 +2516,7 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE ...@@ -2516,6 +2516,7 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE
{ {
IDirectDrawSurfaceImpl *surfImpl = (IDirectDrawSurfaceImpl *)surf; IDirectDrawSurfaceImpl *surfImpl = (IDirectDrawSurfaceImpl *)surf;
struct wined3d_resource_desc wined3d_desc; struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
IDirectDrawImpl *This = surfImpl->ddraw; IDirectDrawImpl *This = surfImpl->ddraw;
struct wined3d_clipper *clipper = NULL; struct wined3d_clipper *clipper = NULL;
IWineD3DSurface *wineD3DSurface; IWineD3DSurface *wineD3DSurface;
...@@ -2540,7 +2541,8 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE ...@@ -2540,7 +2541,8 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE
IWineD3DSurface_GetClipper(wineD3DSurface, &clipper); IWineD3DSurface_GetClipper(wineD3DSurface, &clipper);
/* Get the surface properties */ /* Get the surface properties */
IWineD3DSurface_GetDesc(wineD3DSurface, &wined3d_desc); wined3d_resource = IWineD3DSurface_GetResource(wineD3DSurface);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
parent = IWineD3DSurface_GetParent(wineD3DSurface); parent = IWineD3DSurface_GetParent(wineD3DSurface);
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, wined3d_desc.width, wined3d_desc.height, hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, wined3d_desc.width, wined3d_desc.height,
......
...@@ -3500,6 +3500,7 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr ...@@ -3500,6 +3500,7 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
DDSURFACEDESC2 *desc, UINT mip_level, WINED3DSURFTYPE surface_type) DDSURFACEDESC2 *desc, UINT mip_level, WINED3DSURFTYPE surface_type)
{ {
struct wined3d_resource_desc wined3d_desc; struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
WINED3DPOOL pool = WINED3DPOOL_DEFAULT; WINED3DPOOL pool = WINED3DPOOL_DEFAULT;
enum wined3d_format_id format; enum wined3d_format_id format;
DWORD usage = 0; DWORD usage = 0;
...@@ -3588,7 +3589,8 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr ...@@ -3588,7 +3589,8 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
} }
surface->surface_desc.dwFlags |= DDSD_PIXELFORMAT; surface->surface_desc.dwFlags |= DDSD_PIXELFORMAT;
IWineD3DSurface_GetDesc(surface->WineD3DSurface, &wined3d_desc); wined3d_resource = IWineD3DSurface_GetResource(surface->WineD3DSurface);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
format = wined3d_desc.format; format = wined3d_desc.format;
if (format == WINED3DFMT_UNKNOWN) if (format == WINED3DFMT_UNKNOWN)
......
...@@ -1292,7 +1292,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock) ...@@ -1292,7 +1292,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
{ {
struct wined3d_resource_desc desc; struct wined3d_resource_desc desc;
IWineD3DSurface_GetDesc(backbuffer, &desc); wined3d_resource_get_desc(&((IWineD3DSurfaceImpl *)backbuffer)->resource, &desc);
IWineD3DSurface_Release(backbuffer); IWineD3DSurface_Release(backbuffer);
/* Set the default scissor rect values */ /* Set the default scissor rect values */
......
...@@ -4720,7 +4720,6 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl = ...@@ -4720,7 +4720,6 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DBaseSurfaceImpl_GetType, IWineD3DBaseSurfaceImpl_GetType,
/* IWineD3DSurface */ /* IWineD3DSurface */
IWineD3DBaseSurfaceImpl_GetResource, IWineD3DBaseSurfaceImpl_GetResource,
IWineD3DBaseSurfaceImpl_GetDesc,
IWineD3DSurfaceImpl_Map, IWineD3DSurfaceImpl_Map,
IWineD3DSurfaceImpl_Unmap, IWineD3DSurfaceImpl_Unmap,
IWineD3DSurfaceImpl_GetDC, IWineD3DSurfaceImpl_GetDC,
......
...@@ -157,15 +157,6 @@ struct wined3d_resource * WINAPI IWineD3DBaseSurfaceImpl_GetResource(IWineD3DSur ...@@ -157,15 +157,6 @@ struct wined3d_resource * WINAPI IWineD3DBaseSurfaceImpl_GetResource(IWineD3DSur
return &((IWineD3DSurfaceImpl *)iface)->resource; return &((IWineD3DSurfaceImpl *)iface)->resource;
} }
void WINAPI IWineD3DBaseSurfaceImpl_GetDesc(IWineD3DSurface *iface, struct wined3d_resource_desc *desc)
{
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)iface;
TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_resource_get_desc(&surface->resource, desc);
}
HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWORD flags) HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWORD flags)
{ {
TRACE("iface %p, flags %#x.\n", iface, flags); TRACE("iface %p, flags %#x.\n", iface, flags);
......
...@@ -452,7 +452,6 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl = ...@@ -452,7 +452,6 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineD3DBaseSurfaceImpl_GetType, IWineD3DBaseSurfaceImpl_GetType,
/* IWineD3DSurface */ /* IWineD3DSurface */
IWineD3DBaseSurfaceImpl_GetResource, IWineD3DBaseSurfaceImpl_GetResource,
IWineD3DBaseSurfaceImpl_GetDesc,
IWineGDISurfaceImpl_Map, IWineGDISurfaceImpl_Map,
IWineGDISurfaceImpl_Unmap, IWineGDISurfaceImpl_Unmap,
IWineGDISurfaceImpl_GetDC, IWineGDISurfaceImpl_GetDC,
......
...@@ -2200,7 +2200,6 @@ DWORD WINAPI IWineD3DBaseSurfaceImpl_SetPriority(IWineD3DSurface *iface, DWORD P ...@@ -2200,7 +2200,6 @@ DWORD WINAPI IWineD3DBaseSurfaceImpl_SetPriority(IWineD3DSurface *iface, DWORD P
DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPriority(IWineD3DSurface *iface) DECLSPEC_HIDDEN; DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPriority(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
WINED3DRESOURCETYPE WINAPI IWineD3DBaseSurfaceImpl_GetType(IWineD3DSurface *iface) DECLSPEC_HIDDEN; WINED3DRESOURCETYPE WINAPI IWineD3DBaseSurfaceImpl_GetType(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
struct wined3d_resource * WINAPI IWineD3DBaseSurfaceImpl_GetResource(IWineD3DSurface *iface) DECLSPEC_HIDDEN; struct wined3d_resource * WINAPI IWineD3DBaseSurfaceImpl_GetResource(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
void WINAPI IWineD3DBaseSurfaceImpl_GetDesc(IWineD3DSurface *iface, struct wined3d_resource_desc *desc) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWORD flags) DECLSPEC_HIDDEN; HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWORD flags) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD flags) DECLSPEC_HIDDEN; HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD flags) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(IWineD3DSurface *iface) DECLSPEC_HIDDEN; HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
......
...@@ -2226,9 +2226,6 @@ interface IWineD3DSurface : IWineD3DResource ...@@ -2226,9 +2226,6 @@ interface IWineD3DSurface : IWineD3DResource
{ {
struct wined3d_resource *GetResource( struct wined3d_resource *GetResource(
); );
void GetDesc(
[out] struct wined3d_resource_desc *desc
);
HRESULT Map( HRESULT Map(
[out] WINED3DLOCKED_RECT *locked_rect, [out] WINED3DLOCKED_RECT *locked_rect,
[in] const RECT *rect, [in] const RECT *rect,
......
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