Commit graph

63 commits

Author SHA1 Message Date
Adrian Johnson
efe303d9db Remove autotools build 2023-01-08 22:27:47 +10:30
Manuel Stoeckl
0490607584 pdiff: convert RGB24 image values to ARGB32 on read
To avoid reading a potentially garbage alpha channel when users
of pdiff_compare pass in RGB24 images, if the format is RGB24,
force the alpha channel to be 0xff.

This commit also updates CI to adjust for the new tests that have
started/stopped failing. New failures often are cases where
the reference image has alpha transparency, but the test output
does not; new passing tests may indicate that the unused alpha
channel of an RGB24 image was garbage, but now is ignored.
2021-08-29 11:56:27 -04:00
Uli Schlachter
1981fb6dfb meson: Use more dependency objects
For example, to depend on cairo-script, inccairoscript was added to
"include_directories:" and libcairoscript was added to "link_with:".
This commit instead uses the libcairoscript_dep dependency everywhere.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-05-22 07:59:52 +02:00
Emmanuele Bassi
bd13841257 Drop the conditional inclusion of config.h
We *always* generate this file, and we depend on its existence.

The idea behind HAVE_CONFIG_H was being able to include random files
from different projects, back in a time where "libraries" were literally
just random files instead of actual shared objects.

Since we're not in the '80s any more, and our build system(s) define
HAVE_CONFIG_H *and* generate the config.h header file, we don't need a
conditional guard around its inclusion.
2021-05-01 17:05:29 +01:00
Emmanuele Bassi
bfd1602db9 Remove stray _GNU_SOURCE definitions
We define _GNU_SOURCE globally in both the Autotools build, through the
use of the AC_USE_SYSTEM_EXTENSIONS macro; and in the Meson build, with
add_project_arguments().
2021-05-01 16:58:15 +01:00
Emmanuele Bassi
8336309794 meson: Define HAVE_CONFIG_H as a project flag
Precisely what Autotools does, instead of adding it as per-target C
argument.

Once we remove HAVE_CONFIG_H checks in every source file, we'll be able
to drop it.
2021-05-01 16:55:38 +01:00
Mathieu Duponchelle
596a82f2d1 Add meson build definitions
Co-Authored by:
Nirbheek Chauhan <nirbheek@centricular.com>
lb90 <luca.bacci982@gmail.com>
Tim-Philipp Müller <tim@centricular.com>
2020-07-31 12:21:50 +01:00
luz.paz
6d93bddbd6 Misc. typos
Found via `codespell -i 3 -w -I ../cairo-word-whitelist.txt -L tim,ned,uint`
Follow up of 12cb59be7d

Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
2019-01-31 17:37:15 -08:00
Sylvestre Ledru
da9ef97372 Remove some useless declarations found by scan-build, the LLVM/clang static analyzer
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-05-06 10:14:53 -07:00
Bryce W. Harrington
5577223489 pdiff: Drop unused variable
Fixes:
perceptualdiff.c:35:24: warning: unused variable ‘dim’
[-Wunused-variable]

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04 09:27:56 +01:00
Bryce W. Harrington
319b893582 pdiff: Quell warning about signed/unsigned comparisons
perceptualdiff.c:55:19: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
perceptualdiff.c:60:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04 09:27:55 +01:00
Andrea Canciani
b6d593dc71 build: Clean up environment variables and flags for the win32 build
Avoid ovverriding LINK, as it has a special meaning for the MSVC build
tools.
2011-06-20 10:24:21 +02:00
Andrea Canciani
5534c30524 build: Use common rules for making pdiff
Instead of providing special rules for compiling C files in pdiff, use
the common ones and build a different pdiff for debug and release.
2011-06-20 10:24:21 +02:00
Andrea Canciani
b8a7f8621a Update FSF address
I updated the Free Software Foundation address using the following script.

for i in $(git grep Temple | cut -d: -f1 )
do
  sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-04-27 11:13:38 +02:00
Jeff Muizelaar
2d6336624c [test-win32] Fix static linking of the test suite.
Previously, the test suite needed to be dynamically linked to work.
2009-04-01 11:32:58 -04:00
Behdad Esfahbod
0ac7a242f8 [build] Add Makefile.win32.common 2008-09-22 20:11:38 -04:00
Behdad Esfahbod
de5b8bce37 Makefile.am cleanup
Use a common build/Makefile.am.common file.
2008-09-11 15:49:09 -04:00
Behdad Esfahbod
042ef899a2 [test/pdiff] Fix include syntax 2008-09-10 13:57:17 -04:00
Chris Wilson
84a7a9955c [test] Typo in Makefile.am
s/AC_CPPFLAGS/AM_CPPFLAGS/g
2008-09-10 18:23:31 +01:00
Behdad Esfahbod
43a42d0a19 [test/pdiff/Makefile.am] Another automake warning fix 2008-09-10 12:41:32 -04:00
Behdad Esfahbod
5926257770 Revamp the build system.
Quick summary of changes:

  - Move list of cairo source files out of src/Makefile.am and into
    src/Sources.mk,

  - Generate files src/Config.mk and src/Config.mk.win32 that choose
    the right set of source files and headers based on configured
    backends and features.  This drastically simplifies building
    using other build systems.  The src/Makefile.win32 file needs
    to be updated to reflect these changes.

  - Add README files to various directories,

  - Add toplevel HACKING file.
2008-09-02 20:24:08 -04:00
Chris Wilson
08ea9d1f2a [pdiff] Get the surface data pointer once.
Don't call cairo_image_surface_get_data() for every single component of
the two surfaces to compare.
2008-08-26 23:01:30 +01:00
Chris Wilson
db7e3cb854 [Makefile.am] Delete intermediates
Clean up after calling 'gcc -save-temps'.
2008-08-17 11:39:56 +01:00
Azar@.(none)
95db215cc1 Some fixes and improvements to the Win32 build 2008-02-06 21:45:24 -05:00
Chris Wilson
ed3fccec01 [pdiff] Avoid the memleak for small surfaces.
Allocate the arrays after the guard against small surfaces to avoid
leaking them.
2007-12-20 14:13:12 +00:00
Chris Wilson
bd3dd72262 [pdiff] Reorganise the inner loops of the convolution.
Reorder the indices and introduce a couple of temporary accumulators to
improve cache access.
2007-10-16 16:03:03 +01:00
Chris Wilson
fa9201b9c9 [pdiff] Check for too small images.
The Laplacian pyramid can only work on images larger than 3x3 due to the
size of its convolution kernel. So if the image is too small return an
error (-1) before attempting to construction the pyramid.
2007-10-16 15:57:44 +01:00
Vladimir Vukicevic
19fa097f51 [win32] Update win32 Makefiles
Happy building with msys, one location for CFLAGS/etc changes (toplevel),
new pdiff makefile.
2007-08-28 10:54:18 -07:00
Behdad Esfahbod
06382092e5 [pdiff] Ship gpl.txt 2007-04-11 19:43:01 -04:00
Behdad Esfahbod
17f5706d17 [pdiff] Make stdint.h inclusion portable (#10441)
by copying magic bits from cairo-wideint-private.h.
2007-04-03 16:04:04 -04:00
Chris Wilson
14cab8b020 Correct an off-by-one in the reflection of the convolution index.
Currently the convolution code uses the formula 2*(N-1)-n to reflect the index
n when n is greater than or equal to N.
This is wrong as n=N -> 2*(N-1)-N = N-2 instead of N-1.

Furthermore when the image is small, e.g. at the highest levels of the
pyramid, this causes the code to index before the start of the array and
causes valgrind to issue a warning.
2007-03-12 14:48:11 -07:00
Mathias Hasselmann
ffa86b17ab [test/pdiff] Fix build problem with certain flavors of make 2007-03-04 16:39:00 -05:00
Carl Worth
02f2ece88d Fix leak in pdiff lpyramid
This was a leak in the test suite only, (and then only when tests failed).
2007-03-02 09:32:14 -08:00
Behdad Esfahbod
0bea2ce7f7 [pdiff] Define _GNU_SOURCE to get correct symbols out of <math.h>
math.h does not define __USE_ISOC99 otherwise.
2006-12-17 14:32:08 -05:00
Behdad Esfahbod
2ca6a767ee [pdiff] Don't use float math functions if not using gcc with C99
The float version of many math functions were introduced in C99, and were
causing compile failure on systems like OS X.  We now define them to their
double variant if __USE_ISOC99 is not defined.  We may want to expand it later
to cover non-gcc compilers too, but since this is pdiff only, it's not really
important.
2006-12-17 14:24:57 -05:00
Behdad Esfahbod
57589a9049 [pdiff] Use CAIRO_CFLAGS, to make sure warnings are enabled 2006-12-16 18:18:47 -05:00
Behdad Esfahbod
8f2ad0affd [pdiff] Fix compiler warnings, that were causing crashes 2006-12-16 18:16:46 -05:00
Carl Worth
305cbd8e71 pdiff: Remove casts since we're out of the land of X++ where void* is stupidly broken 2006-12-14 07:58:01 -08:00
Carl Worth
f175b23559 pdiff: Rename everything to .c and fix an last littele C++ isms.
The only things we had missed were a few new/delete pairs, and some
obvious header file fixups, (like not doing <string>).
2006-12-14 07:58:01 -08:00
Carl Worth
18a4fa448f pdiff: Replace CompareArgs class with args_t struct
This gets rid of nearly the last vestiges of C++ from the pdiff code.
2006-12-14 07:58:01 -08:00
Carl Worth
871aba6c80 pdiff: Fix return value from perceptualdiff program 2006-12-14 07:58:01 -08:00
Carl Worth
2174ee2475 pdiff: Remove all uses of std::string 2006-12-14 07:58:01 -08:00
Carl Worth
91b156b82e pdiff: Remove RGBAImage classes now that we're just using cairo image surfaces 2006-12-14 07:58:01 -08:00
Carl Worth
4c812c38e4 pdiff: Remove hideous C++ reference passing 2006-12-14 07:58:01 -08:00
Carl Worth
2457756afd pdiff: Remove intermingled statements and declarations 2006-12-14 07:58:01 -08:00
Carl Worth
e947f5a4bd pdiff: Add .gitignore for perceptualdiff binary 2006-12-14 07:58:01 -08:00
Carl Worth
bb4d4dc771 pdiff: Remove old, unused Yee_Compare interface 2006-12-14 07:58:01 -08:00
Carl Worth
53c3a2f75b pdiff: Rewrite main program to use cairo-based pdiff_compare interface 2006-12-14 07:58:01 -08:00
Carl Worth
358645d6eb pdiff: Rip out unused ImgDiff code, (dropping -output option) 2006-12-14 07:58:00 -08:00
Carl Worth
4438fb6dca pdiff: Move function that depends on command-line argument class to same file as main 2006-12-14 07:58:00 -08:00