Michael Stefaniuc : wined3d: Use IsRectEmpty() instead of open coding it.

Alexandre Julliard julliard at wine.codeweavers.com
Sat May 14 10:07:27 CDT 2016


Module: wine
Branch: master
Commit: 128e6b5975b6837b0a2605cbd857d04d4a2b7ae6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=128e6b5975b6837b0a2605cbd857d04d4a2b7ae6

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Tue May  3 21:48:05 2016 +0200

wined3d: Use IsRectEmpty() instead of open coding it.

Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/surface.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c3c028c..e0d7c80 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1147,8 +1147,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
                 wined3d_texture_get_level_height(src_texture, src_surface->texture_level));
         src_rect = &r;
     }
-    else if (src_rect->left < 0 || src_rect->left >= src_rect->right
-            || src_rect->top < 0 || src_rect->top >= src_rect->bottom)
+    else if (src_rect->left < 0 || src_rect->top < 0 || IsRectEmpty(src_rect))
     {
         WARN("Invalid source rectangle.\n");
         return WINED3DERR_INVALIDCALL;
@@ -4032,8 +4031,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
 
     dst_w = wined3d_texture_get_level_width(dst_texture, dst_surface->texture_level);
     dst_h = wined3d_texture_get_level_height(dst_texture, dst_surface->texture_level);
-    if (dst_rect->left >= dst_rect->right || dst_rect->top >= dst_rect->bottom
-            || dst_rect->left > dst_w || dst_rect->left < 0
+    if (IsRectEmpty(dst_rect) || dst_rect->left > dst_w || dst_rect->left < 0
             || dst_rect->top > dst_h || dst_rect->top < 0
             || dst_rect->right > dst_w || dst_rect->right < 0
             || dst_rect->bottom > dst_h || dst_rect->bottom < 0)
@@ -4046,8 +4044,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
     {
         src_w = wined3d_texture_get_level_width(src_texture, src_surface->texture_level);
         src_h = wined3d_texture_get_level_height(src_texture, src_surface->texture_level);
-        if (src_rect->left >= src_rect->right || src_rect->top >= src_rect->bottom
-                || src_rect->left > src_w || src_rect->left < 0
+        if (IsRectEmpty(src_rect) || src_rect->left > src_w || src_rect->left < 0
                 || src_rect->top > src_h || src_rect->top < 0
                 || src_rect->right > src_w || src_rect->right < 0
                 || src_rect->bottom > src_h || src_rect->bottom < 0)




More information about the wine-cvs mailing list