[PATCH 3/4] ddraw: Use wined3d_texture_get_pitch() in ddraw_surface_init().
Riccardo Bortolato
rikyz619 at gmail.com
Thu Feb 11 15:51:43 CST 2016
Removed the now unused wined3d_surface_get_pitch().
Signed-off-by: Riccardo Bortolato <rikyz619 at gmail.com>
---
dlls/ddraw/surface.c | 11 +++++------
dlls/wined3d/surface.c | 13 -------------
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/wined3d.spec | 3 +--
dlls/wined3d/wined3d_private.h | 2 --
include/wine/wined3d.h | 4 ++--
6 files changed, 9 insertions(+), 26 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index ff2c85b..adb47a6 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -6258,6 +6258,7 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
struct ddraw_texture *texture = wined3d_texture_get_parent(wined3d_texture);
DDSURFACEDESC2 *desc = &surface->surface_desc;
unsigned int version = texture->version;
+ unsigned int row_pitch, slice_pitch, texture_level;
surface->IDirectDrawSurface7_iface.lpVtbl = &ddraw_surface7_vtbl;
surface->IDirectDrawSurface4_iface.lpVtbl = &ddraw_surface4_vtbl;
@@ -6290,13 +6291,11 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
*desc = texture->surface_desc;
surface->first_attached = surface;
+ texture_level = desc->ddsCaps.dwCaps & DDSCAPS_MIPMAP ? sub_resource_idx % desc->u2.dwMipMapCount : 0;
+ wined3d_texture_get_pitch(wined3d_texture, texture_level, &row_pitch, &slice_pitch);
+
if (format_is_compressed(&desc->u4.ddpfPixelFormat))
{
- unsigned int texture_level, row_pitch;
-
- texture_level = desc->ddsCaps.dwCaps & DDSCAPS_MIPMAP ? sub_resource_idx % desc->u2.dwMipMapCount : 0;
- row_pitch = wined3d_surface_get_pitch(wined3d_surface);
-
if (desc->dwFlags & DDSD_LPSURFACE)
desc->u1.dwLinearSize = ~0u;
else
@@ -6307,7 +6306,7 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
else
{
if (!(desc->dwFlags & DDSD_LPSURFACE))
- desc->u1.lPitch = wined3d_surface_get_pitch(wined3d_surface);
+ desc->u1.lPitch = row_pitch;
desc->dwFlags |= DDSD_PITCH;
desc->dwFlags &= ~(DDSD_LPSURFACE | DDSD_LINEARSIZE);
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index cb7995d..0793d3a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1883,19 +1883,6 @@ static inline unsigned short float_32_to_16(const float *in)
return ret;
}
-DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
-{
- unsigned int row_pitch, slice_pitch;
-
- TRACE("surface %p.\n", surface);
-
- wined3d_texture_get_pitch(surface->container, surface->texture_level, &row_pitch, &slice_pitch);
-
- TRACE("Returning %u.\n", row_pitch);
-
- return row_pitch;
-}
-
HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info)
{
struct wined3d_resource *texture_resource = &surface->container->resource;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 8b414a6..58ff5aa 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -499,7 +499,7 @@ void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
return texture->resource.parent;
}
-void wined3d_texture_get_pitch(const struct wined3d_texture *texture,
+void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture,
unsigned int level, unsigned int *row_pitch, unsigned int *slice_pitch)
{
const struct wined3d_resource *resource = &texture->resource;
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 5933b48..bbd2fb5 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -220,8 +220,6 @@
@ cdecl wined3d_stateblock_decref(ptr)
@ cdecl wined3d_stateblock_incref(ptr)
-@ cdecl wined3d_surface_get_pitch(ptr)
-
@ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr)
@ cdecl wined3d_swapchain_decref(ptr)
@ cdecl wined3d_swapchain_get_back_buffer(ptr long)
@@ -250,6 +248,7 @@
@ cdecl wined3d_texture_get_lod(ptr)
@ cdecl wined3d_texture_get_overlay_position(ptr long ptr ptr)
@ cdecl wined3d_texture_get_parent(ptr)
+@ cdecl wined3d_texture_get_pitch(ptr long ptr ptr)
@ cdecl wined3d_texture_get_resource(ptr)
@ cdecl wined3d_texture_get_sub_resource(ptr long)
@ cdecl wined3d_texture_incref(ptr)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 81c3af2..1b8d0f3 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2402,8 +2402,6 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_force_reload(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
-void wined3d_texture_get_pitch(const struct wined3d_texture *texture,
- unsigned int level, unsigned int *row_pitch, unsigned int *slice_pitch) DECLSPEC_HIDDEN;
void wined3d_texture_load(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index f314af3..fbecb0b 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2479,8 +2479,6 @@ HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device,
ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock);
ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
-DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface);
-
HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device, struct wined3d_swapchain_desc *desc,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain);
ULONG __cdecl wined3d_swapchain_decref(struct wined3d_swapchain *swapchain);
@@ -2527,6 +2525,8 @@ DWORD __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture);
HRESULT __cdecl wined3d_texture_get_overlay_position(const struct wined3d_texture *texture,
unsigned int sub_resource_idx, LONG *x, LONG *y);
void * __cdecl wined3d_texture_get_parent(const struct wined3d_texture *texture);
+void __cdecl wined3d_texture_get_pitch(const struct wined3d_texture *texture,
+ unsigned int level, unsigned int *row_pitch, unsigned int *slice_pitch);
struct wined3d_resource * __cdecl wined3d_texture_get_resource(struct wined3d_texture *texture);
struct wined3d_resource * __cdecl wined3d_texture_get_sub_resource(const struct wined3d_texture *texture,
UINT sub_resource_idx);
--
1.9.1
More information about the wine-patches
mailing list