The code in fb/fbpict.c that handles tiling is handling the coordinates that have already been offset by pSrc/pMask->pDrawable->x,y. For a pixmap in offscreen memory, these quantities will be non-zero, so when we do the modular arithmetic, the resulting coordinates no longer point to the pixmap but rather to a portion of the framebuffer starting at 0,0. I think the attached patch is correct ... it certainly fixes the test case I was working from. I'm not completely confident that I understand all uses of pDrawable->x,y, however. [ Fixing this bug is important for getting Cairo to perform well; we'll have to use expensive fallbacks on older servers to work around this problem. ]
Created attachment 2906 [details] GPG public key
Owen, Can you attach the test case that you were working from for this?
http://bugzilla.gnome.org/show_bug.cgi?id=306216 has a test case, but it depends on GTK+ and on removing the workaround from Cairo. (grep for buggy_repeat in cairo-xlib-surface.c) I believe the patch I've provided here is "obviously correct" (and has been tested in practice), and while it might be nice to have a xlib and RENDER test case, I'm not inclined to spend the time it would take to write one. Plus note that any test case will only intermittantly reproduce the problem since it depends on the pixmap ending up in offscreen video emory.
Keith said it looked good to him (and that it only matters for XAA servers anyway), so it's committed to Xorg HEAD for 6.9 RC0: CVSROOT: /cvs/xorg Module name: xc Changes by: alanc@gabe.freedesktop.org 05/08/01 15:22:17 Log message: 2005-08-01 Alan Coopersmith <alan.coopersmith@sun.com> * programs/Xserver/fb/fbpict.c: Bugzilla #3566 <https://bugs.freedesktop.org/show_bug.cgi?id=3566> Patch #2906 <https://bugs.freedesktop.org/attachment.cgi?id=2906> Fix for RENDER, repeating pictures and offscreen memory (Owen Taylor) Modified files: ./: ChangeLog xc/programs/Xserver/fb/: fbpict.c Revision Changes Path 1.1173 +7 -0 xc/ChangeLog 1.17 +8 -4 xc/programs/Xserver/fb/fbpict.c
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.