In libpixman/ictrap.c:pixman_composite_trapezoids(), the bounding box of the intermediate surface needs to be intersected with the bounding box of the image (bailing immediately on empty intersection). This should help a *lot* when zoomed in on a larger image.
Created attachment 2017 [details] [review] Intersect trapezoids bounds with destination surface bounds before creating intermediate surface. Here's a patch that I just committed to libpixman. It seems to do the job. When I render objects entirely "off-screen" libpixman disappears completely from profile results. (Currently, with cairo this means that drawing out-of-bounds objects is about twice as fast as drawing visible objects, since libpixman was at about 50% in the profile before. More work will be needed in cairo to increase that performance further.)
Now that the attached patch is committed to libpixman, this bug is fixed. But, I'm leaving it open here until we have the same fix in the xserver tree, (or at the very least a bug entry there with the same patch).
Can't we just change the product to 'xserver'?
The bug here is in miTrapezoids, where a patch similar to the one attached here should be applied. Cairo doesn't actually use the pixman_composite_trapezoids() anymore; the problem there is now fixed in a different ways. Some relevant commits: <cworth> ssp: Yeah, the bug came back again later, and I fixed it again here: <cworth> c96a71e709e537f690da6d4a184aa4c64fe11028 <cworth> See also this commit which is the more recent thing that changes the geometry and avoids the server bug: <cworth> 8286b8741675ae163fc40187cd04e84395954c6e
Was this fixed by the conversion of the X server to use the pixman trapezoid code?
No, the issue still exists. When the X server creates the intermediate alpha pixmap, it should restrict the size of it to the underlying destination. That way, it won't have to rasterize a bunch of invisible trapezoids. I think cairo may clip the traps itself these days though, so it's not a huge issue.
The software version of this bug has moved to pixman - see bug 35547. There is still an issue in the server because EXA has cutted and pasted the code in question. Specifically, exaTrapezoids() and exaTriangles() should clip the intermediate alpha picture to the extents (and ideally clip region) of the destination picture.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/78.
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.