http://bugs.freedesktop.org/show_bug.cgi?id=12417

           Summary: glCopyPixel is incorrect if zoomX factor is negative and
                    overlap
           Product: Mesa
           Version: CVS
          Platform: Other
        OS/Version: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa3d-dev@lists.sourceforge.net
        ReportedBy: [EMAIL PROTECTED]


If zoomX factor is negative and src and dst region overlap, glCopyPixels is
implemented incorrect. 
The root cause is function src/mesa/swrast/s_copypix.c/regions_overlap() is
incorrect when zoomX is negative. Below is the patch:

--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -71,7 +71,8 @@ regions_overlap(GLint srcx, GLint srcy,
    }
    else {
       /* add one pixel of slop when zooming, just to be safe */
-      if ((srcx > dstx + (width * zoomX) + 1) || (srcx + width + 1 < dstx)) {
+      if ((srcx > (dstx + ((zoomX > 0) ? (width * zoomX + 1) : 0))) || 
+             (srcx + width + 1 < dstx + ((zoomX > 0) ? 0 : (width * zoomX))))
{
          return GL_FALSE;
       }
       else if ((srcy < dsty) && (srcy + height < dsty + (height * zoomY))) {


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to