mesa/swrast: Use global function _mesa_regions_overlap()
authorAnuj Phogat <anuj.phogat@gmail.com>
Tue, 9 Jun 2015 22:18:13 +0000 (15:18 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Mon, 29 Jun 2015 20:17:19 +0000 (13:17 -0700)
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/swrast/s_copypix.c

index 68c83e44e1297e5cdd589afde48a35889e76f378..8fde0c29540ceceb4300646c8cd1c9bf30fcd32b 100644 (file)
@@ -27,6 +27,7 @@
 #include "main/context.h"
 #include "main/condrender.h"
 #include "main/macros.h"
+#include "main/blit.h"
 #include "main/pixeltransfer.h"
 #include "main/imports.h"
 
@@ -52,19 +53,8 @@ regions_overlap(GLint srcx, GLint srcy,
                 GLfloat zoomX, GLfloat zoomY)
 {
    if (zoomX == 1.0 && zoomY == 1.0) {
-      /* no zoom */
-      if (srcx >= dstx + width || (srcx + width <= dstx)) {
-         return GL_FALSE;
-      }
-      else if (srcy < dsty) { /* this is OK */
-         return GL_FALSE;
-      }
-      else if (srcy > dsty + height) {
-         return GL_FALSE;
-      }
-      else {
-         return GL_TRUE;
-      }
+      return _mesa_regions_overlap(srcx, srcy, srcx + width, srcy + height,
+                                   dstx, dsty, dstx + width, dsty + height);
    }
    else {
       /* add one pixel of slop when zooming, just to be safe */