[PATCH 1/4] wined3d: Use a single texture2d_is_full_rect() function.

Paul Gofman pgofman at codeweavers.com
Wed May 27 06:36:55 CDT 2020


Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 dlls/wined3d/surface.c         | 13 -------------
 dlls/wined3d/texture.c         |  2 +-
 dlls/wined3d/wined3d_private.h |  1 +
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index d8bf9ce04e..8db322dec7 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -44,19 +44,6 @@ static void get_color_masks(const struct wined3d_format *format, DWORD *masks)
     masks[2] = ((1u << format->blue_size) - 1) << format->blue_offset;
 }
 
-static BOOL texture2d_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r)
-{
-    unsigned int t;
-
-    t = wined3d_texture_get_level_width(texture, level);
-    if ((r->left && r->right) || abs(r->right - r->left) != t)
-        return FALSE;
-    t = wined3d_texture_get_level_height(texture, level);
-    if ((r->top && r->bottom) || abs(r->bottom - r->top) != t)
-        return FALSE;
-    return TRUE;
-}
-
 /* See also float_16_to_32() in wined3d_private.h */
 static inline unsigned short float_32_to_16(const float *in)
 {
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index e8a92acab9..5a8482d86e 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -48,7 +48,7 @@ struct wined3d_rect_f
     float b;
 };
 
-static bool texture2d_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r)
+bool texture2d_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r)
 {
     unsigned int t;
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9f8c212fbf..75335d09b9 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -4172,6 +4172,7 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
         const struct wined3d_box *dst_box, struct wined3d_texture *src_texture,
         unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, DWORD flags,
         const struct wined3d_blt_fx *blt_fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
+bool texture2d_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r) DECLSPEC_HIDDEN;
 void texture2d_get_blt_info(const struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx,
         const RECT *rect, struct wined3d_blt_info *info) DECLSPEC_HIDDEN;
 void texture2d_load_fb_texture(struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx,
-- 
2.26.2




More information about the wine-devel mailing list