Discussion:
[cairo] [PATCH] pthread-same-source: Refresh reference images
Uli Schlachter
2018-03-31 11:52:53 UTC
Permalink
I already did the same thing in commit 3e22a8580a804. That commit added
a GENERATE_REFERENCE mode that does not use threads and used that for
generating the reference image.

However, the above commit falls into the range between commits
fb57ea13e04d and 3d94269bd4. The later commit reverts the earlier one,
which changed the way that image downscaling works / is used.

This means that the reference image that were generated back then were
broken. Thus, regenerating the images is the right thing to do.

Signed-off-by: Uli Schlachter <***@znc.in>
---
test/reference/pthread-same-source.ref.png | Bin 1076 -> 1002 bytes
1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/test/reference/pthread-same-source.ref.png b/test/reference/pthread-same-source.ref.png
index c1c186b9b8a5ac31c1c9aa5ce42f162c3e0f389e..92a86c2f6e9b89fd612baa7dd6d25f8af33bd78a 100644
GIT binary patch
literal 1002
***@N?(olHy`uVBq!ia0y~yU<5K58911L)MWvCLm<VL<***@E-&h>|H*Yfq{9x
zr;B4q#hka-4JRIU5O6&>Q9zdYs-fYO)Di)nqak_|))+CfueYu`H)loK|83W#***@_Q|
z_TvZJ7Qe60m;$!d|K>kn{*%***@lFT!u?FjUJyFC!{gID7nqBq>^dkGiHUeY!_Z`
zWAymUqI8zsVHWR#%el-Go^iU&;%_jKc36I!P2sF?hlxBxrdfmEc3y{B>H?W|43}~k
z=H^K^nD{GPs$p0XEB&BOD06O>c!P=Z3=<#;(#HxkSm7*)yzsJ&5oo_hF^DYL6${dR
zDF$K&NO1%4TGsJy=qvqq&Fbp!Gk?x~wiI6*40LQ72!T9gb=M5&OsGr2{uqK%zt8N6
ztN)(AHux<t4zL9FO^7$=IV_<{tX^l^G2bO>`7K~Xai~!{x<ILf#2BVf%a-qK7T118
nzYdu%{@}Tx`C4b%r;q;@lYN%0`rIY~%)AVqu6{1-oD!M<vdew`

literal 1076
***@N?(olHy`uVBq!ia0y~yU<5K58911L)MWvCLm<VL<***@E-&h>|H*Yfr0s@
zr;B4q#hkZy75!urCE70L*LAOco0Ruz*P5FGoYn_SeQ!8k^%eGU<yExEJL=<6-cWHa
***@O;BTpM900xA(ng4$V%}`@fetYI#****@nzw8InKQT>6V}4O`n_<aM7NxV?4zqX{
zT+U^***@JzVFM4utktif+Pufr^Vg-d%FmfU2px@*ReY1ioSnRrcer5`+=?D0BeH^UOi
zgG+WoOwj|H%#aBpf#!qkbeILP`7Oxc3C|$L1GU^_AYMyZUc=u_^5=n`J9}n(WzC$)
z*H&(0^w<nSCA)GN=H^K^n1GPO^4n||UJgmAEvClxadmgLeSaMJIwb%1zWaIGb8q*>
zXUu(NYAkPmb=NgusDh&m6o=qQ1;-gE62Y+wiD_UgLZTHc2vP=)SK>9^nl<zF*N0WL
z7W20HZ3RZ$e?d1Y#2?6U*rPl<ZQlKN^?z%ufcAZzHS_w<YV-a5KwoFkBSx*w58O_*
zhuEzD`RngFTl}^H(<=xeg)$^_K!cTXslUu8{4P#o4{6H-76S~Pu6{1-oD!M<66(JT
--
2.16.2
--
cairo mailing list
***@cairographics.org
https:
Bryce Harrington
2018-04-02 18:26:56 UTC
Permalink
Post by Uli Schlachter
I already did the same thing in commit 3e22a8580a804. That commit added
a GENERATE_REFERENCE mode that does not use threads and used that for
generating the reference image.
However, the above commit falls into the range between commits
fb57ea13e04d and 3d94269bd4. The later commit reverts the earlier one,
which changed the way that image downscaling works / is used.
This means that the reference image that were generated back then were
broken. Thus, regenerating the images is the right thing to do.
Seems reasonable.

Acked-by: Bryce Harrington <***@osg.samsung.com>

(It'd still be interesting to see further refinements on the downscaling
code, I'm sure there's still potential there for more optimization.
Hopefully some day someone can look again at the convolution filter
approach and see if it can get better integrated without causing
test failures.)

Pushed:
To ssh://git.freedesktop.org/git/cairo
fba7a7c..50a6ad5 master -> master
Post by Uli Schlachter
---
test/reference/pthread-same-source.ref.png | Bin 1076 -> 1002 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/test/reference/pthread-same-source.ref.png b/test/reference/pthread-same-source.ref.png
index c1c186b9b8a5ac31c1c9aa5ce42f162c3e0f389e..92a86c2f6e9b89fd612baa7dd6d25f8af33bd78a 100644
GIT binary patch
literal 1002
zWAymUqI8zsVHWR#%el-Go^iU&;%_jKc36I!P2sF?hlxBxrdfmEc3y{B>H?W|43}~k
z=H^K^nD{GPs$p0XEB&BOD06O>c!P=Z3=<#;(#HxkSm7*)yzsJ&5oo_hF^DYL6${dR
zDF$K&NO1%4TGsJy=qvqq&Fbp!Gk?x~wiI6*40LQ72!T9gb=M5&OsGr2{uqK%zt8N6
ztN)(AHux<t4zL9FO^7$=IV_<{tX^l^G2bO>`7K~Xai~!{x<ILf#2BVf%a-qK7T118
literal 1076
zr;B4q#hkZy75!urCE70L*LAOco0Ruz*P5FGoYn_SeQ!8k^%eGU<yExEJL=<6-cWHa
zgG+WoOwj|H%#aBpf#!qkbeILP`7Oxc3C|$L1GU^_AYMyZUc=u_^5=n`J9}n(WzC$)
z*H&(0^w<nSCA)GN=H^K^n1GPO^4n||UJgmAEvClxadmgLeSaMJIwb%1zWaIGb8q*>
zXUu(NYAkPmb=NgusDh&m6o=qQ1;-gE62Y+wiD_UgLZTHc2vP=)SK>9^nl<zF*N0WL
z7W20HZ3RZ$e?d1Y#2?6U*rPl<ZQlKN^?z%ufcAZzHS_w<YV-a5KwoFkBSx*w58O_*
zhuEzD`RngFTl}^H(<=xeg)$^_K!cTXslUu8{4P#o4{6H-76S~Pu6{1-oD!M<66(JT
--
2.16.2
--
cairo mailing list
https://lists.cairographics.org/mailman/listinfo/cairo
--
cairo mailing list
***@cairographics.org
https://lists.cairographics.org/mailma
Bill Spitzak
2018-04-02 19:59:02 UTC
Permalink
Post by Bryce Harrington
(It'd still be interesting to see further refinements on the downscaling
code, I'm sure there's still potential there for more optimization.
Hopefully some day someone can look again at the convolution filter
approach and see if it can get better integrated without causing
test failures.)
I have some plans for improving the downscaling, but they are three years
old. The main problem is that my proposed changes to pixman were rejected
and I had to give up after that, as I cannot see any possible way to
improve this unless the filtering decisions are simplified and moved to
pixman.

The basic problem is that the current filter api can define a single size
of filter but the size and form of the filter depends on the transform
algorithm. My proposed 2-pass algorithm, for instance, requires the filter
in one direction to be parallel to an axis in the source image, and the
filter in the second direction to be parallel to an axis in the destination
image, and which one is chosen depends on the rotation and the dimensions
of the image. Schemes that do multiple passes through intermediate images
(ie mipmaps, Catmull-Rom 3-pass, closest-integer follwed by filtering, etc)
put limits on the filters that can be used or how they are specified, as
they must decompose into multple filters that are convolved. And for
non-affine transforms the filter will vary for every single location.

Also just as a basic design criteria, I do not believe users of Cairo or
Pixman are interested in anything other than whether filtering is
happening, and perhaps choosing between "good" and "best" filtering to
trade off speed. Limiting the api to simple keywords such as "good" and
"best" will allow much more freedom for replacing and improving the
filtering.

My proposal basically amounts to this:

1. Move filtering to Pixman and make the _GOOD and _BEST settings do
something different and desirable. First proposal is to make them do
exactly what Cairo is doing, running the existing filtering code (which is
not 2-pass as it runs the 2 "passes" on every pixel, not reusing any
previous results). Apparently there is a bug in the X so that pixman inside
X will never receive the _GOOD or _BEST settings, for now I propose that it
fall back to the image backend in these cases, to support this Cairo will
still retain some redundant code to detect if _BILINEAR can be used so it
does not have to do the fallback.

2. Add a new 2-pass algorithm to pixman and make _GOOD and _BEST run that
(and possibly _BILINEAR as it is possible it will be faster than that for
downscaling). The api is designed so that it is possible to replace this
algorithm, in particular any kind of hardware-supported filtering might be
far faster and should be allowed. This necessarily means that test image
outputs can change, they will need to be changed when Cairo is changed to
new algorithms. Add some non-affine tests to pixman.

3. Probably not strongly related, but add some non-affine transforms to
source images to Cairo so it can use them.

Does anybody see any chance that this sort of change could be approved?
Loading...