It seems that scaling 1x1 images produces bad results for both CAIRO_FILTER_NEAREST and CAIRO_FILTER_BEST. CAIRO_FILTER_BEST causes bluring at the edges. CAIRO_FILTER_NEAREST occasionally causes the image to disapear. examples of both bad behaviours are attached.
Created attachment 4629 [details] 1x1 scaling with CAIRO_FILTER_BEST
Created attachment 4630 [details] 1x1 scaling with CAIRO_FILTER_BEST
Created attachment 4631 [details] 1x1 scaling with CAIRO_FILTER_NEAREST
Thanks for the excellent report. Can you contribute a program to draw those images? That would be a nice thing to throw into the test suite. It's possible that fixes for a couple of existing bugs will help for this situation as well. For example: [cairo] broken pixman bilinear filtering? http://lists.freedesktop.org/archives/cairo/2006-February/006293.html might explain the CAIRO_FILTER_BEST behavior and that's fixed with the patch in bug #2488. For CAIRO_FILTER_NEAREST, the existing XFAIL filter-nearest-offset case may capture the failure. Regardless, it should also be quite easy to workaround this in cairo by recognizing a 1x1 surface pattern and instead use a solid surface in its place. -Carl as well as the existing XFAIL
I'm puzzled why there isn't a lot *more* blurring of the edges with the BEST filter ... with EXTEND_NONE, scaling up a 1x1 source image should give a blur. (Generally, for scaling images without alpha, you want to use EXTEND_PAD (1.2 addition), and draw a rectangle the size of the scaled result.) It's hard to interpret the images without the source code that draws them.
Created attachment 4633 [details] source code for generating the test images
The behaviour of the current code appears to be correct, the test suite exercises NEAREST and BILINEAR scaling and the suggestion to swap the 1x1 source with a solid colour has been added to todo.
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.