From bad9cd29a8f93d8984dbb0cf70a3baeee7722cd6 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 2 May 2019 17:10:50 +0430 Subject: [PATCH] wined3d: Get rid of the redundant "device" parameter to context_destroy(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/context.c | 8 +++++--- dlls/wined3d/device.c | 2 +- dlls/wined3d/swapchain.c | 4 ++-- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index f4179d7d206..50155861331 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1581,7 +1581,7 @@ void context_release(struct wined3d_context *context) if (context->destroy_delayed) { TRACE("Destroying context %p.\n", context); - context_destroy(context->device, context); + wined3d_context_destroy(context); } } } @@ -2280,8 +2280,9 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, return TRUE; } -void context_destroy(struct wined3d_device *device, struct wined3d_context *context) +void wined3d_context_destroy(struct wined3d_context *context) { + struct wined3d_device *device = context->device; BOOL destroy; TRACE("Destroying ctx %p\n", context); @@ -2289,7 +2290,8 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont wined3d_from_cs(device->cs); /* We delay destroying a context when it is active. The context_release() - * function invokes context_destroy() again while leaving the last level. */ + * function invokes wined3d_context_destroy() again while leaving the last + * level. */ if (context->level) { TRACE("Delaying destruction of context %p.\n", context); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 23ba41c56b4..e25565da7f5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1019,7 +1019,7 @@ static void wined3d_device_delete_opengl_contexts_cs(void *object) if (device->contexts[0]->swapchain) swapchain_destroy_contexts(device->contexts[0]->swapchain); else - context_destroy(device, device->contexts[0]); + wined3d_context_destroy(device->contexts[0]); } } diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index c1429de91b1..4ac091f6924 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1095,7 +1095,7 @@ static struct wined3d_context *swapchain_create_context(struct wined3d_swapchain if (!(ctx_array = heap_calloc(swapchain->num_contexts + 1, sizeof(*ctx_array)))) { ERR("Out of memory when trying to allocate a new context array\n"); - context_destroy(swapchain->device, ctx); + wined3d_context_destroy(ctx); return NULL; } memcpy(ctx_array, swapchain->context, sizeof(*ctx_array) * swapchain->num_contexts); @@ -1114,7 +1114,7 @@ void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) for (i = 0; i < swapchain->num_contexts; ++i) { - context_destroy(swapchain->device, swapchain->context[i]); + wined3d_context_destroy(swapchain->context[i]); } heap_free(swapchain->context); swapchain->num_contexts = 0; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 14444cb181f..daba66932f7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2189,7 +2189,7 @@ void context_copy_bo_address(struct wined3d_context *context, struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, struct wined3d_texture *target, const struct wined3d_format *ds_format) DECLSPEC_HIDDEN; HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx) DECLSPEC_HIDDEN; -void context_destroy(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; +void wined3d_context_destroy(struct wined3d_context *context) DECLSPEC_HIDDEN; void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;