From 4beb9e5922301b76c16f6ea885bc1cb604f9eb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Fri, 4 Nov 2016 13:43:43 +0100 Subject: [PATCH] wined3d: Move surface_get_drawable_size() to view.c file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/surface.c | 33 --------------------------------- dlls/wined3d/view.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 1c211edc777..bba855a74a3 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -36,39 +36,6 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); static const DWORD surface_simple_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY | WINED3D_LOCATION_BUFFER; -void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, - unsigned int *width, unsigned int *height) -{ - if (surface->container->swapchain) - { - /* The drawable size of an onscreen drawable is the surface size. - * (Actually: The window size, but the surface is created in window - * size.) */ - *width = context->current_rt.texture->resource.width; - *height = context->current_rt.texture->resource.height; - } - else if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) - { - const struct wined3d_swapchain *swapchain = context->swapchain; - - /* The drawable size of a backbuffer / aux buffer offscreen target is - * the size of the current context's drawable, which is the size of - * the back buffer of the swapchain the active context belongs to. */ - *width = swapchain->desc.backbuffer_width; - *height = swapchain->desc.backbuffer_height; - } - else - { - struct wined3d_surface *rt; - - /* The drawable size of an FBO target is the OpenGL texture size, - * which is the power of two size. */ - rt = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; - *width = wined3d_texture_get_level_pow2_width(rt->container, rt->texture_level); - *height = wined3d_texture_get_level_pow2_height(rt->container, rt->texture_level); - } -} - struct blt_info { GLenum binding; diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 7f07d574c4a..1f819e68558 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -94,6 +94,39 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str return view->resource; } +void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, + unsigned int *width, unsigned int *height) +{ + if (surface->container->swapchain) + { + /* The drawable size of an onscreen drawable is the surface size. + * (Actually: The window size, but the surface is created in window + * size.) */ + *width = context->current_rt.texture->resource.width; + *height = context->current_rt.texture->resource.height; + } + else if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) + { + const struct wined3d_swapchain *swapchain = context->swapchain; + + /* The drawable size of a backbuffer / aux buffer offscreen target is + * the size of the current context's drawable, which is the size of + * the back buffer of the swapchain the active context belongs to. */ + *width = swapchain->desc.backbuffer_width; + *height = swapchain->desc.backbuffer_height; + } + else + { + struct wined3d_surface *rt; + + /* The drawable size of an FBO target is the OpenGL texture size, + * which is the power of two size. */ + rt = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; + *width = wined3d_texture_get_level_pow2_width(rt->container, rt->texture_level); + *height = wined3d_texture_get_level_pow2_height(rt->container, rt->texture_level); + } +} + static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view, const struct wined3d_rendertarget_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)