1. 18 Jun, 2020 1 commit
    • Dylan Baker's avatar
      meson: remove pixman dependency · 9b49f4e0
      Dylan Baker authored
      AFAICT from the git history, what happened is that the gtk demos rely on
      gtk being built with pixman support. pkg-config isn't really expressive
      enough to have that information, so the solution that was come up with
      was to search for pixman as well as gtk+ and hope that pixman being
      installed was.
      
      This isn't actually used anywhere in the meson build anyway, and it's
      causing problems for projects that want to use pixman as a supproject
      (there's a port of cairo underway that's hitting this), because it
      confuses meson.
      9b49f4e0
  2. 02 Jun, 2020 2 commits
  3. 30 May, 2020 1 commit
  4. 11 May, 2020 1 commit
    • Tom Stellard's avatar
      Add -ftrapping-math to default cflags · c2fe1568
      Tom Stellard authored
      This should resolve #22
      and make the tests pass with clang.
      
      -ftrapping-math is already the default[1] for gcc, so this should not change
      behavior when compiling with gcc.  However, clang defaults[2] to -fno-trapping-math,
      so -ftrapping-math is needed to avoid floating-point expceptions when running the
      combiner and stress tests.
      
      The root causes of this issue is that that pixman-combine-float.c guards floating-point
      division operations with a FLOAT_IS_ZERO check e.g.
      
      if (FLOAT_IS_ZERO (sa))
      	f = 1.0f;
      else
      	f = CLAMP (da / sa);
      
      With -fno-trapping-math, the compiler assumes that division will never trap, so it may
      re-order the division and the guard and execute the division first.  In most cases,
      this would not be an issue, because floating-point exceptions are ignored.  However,
      these tests call enable_divbyzero_exceptions() which causes the SIGFPE signal to
      be sent to the program when a divide by zero exception is raised.
      
      [1] https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
      [2] https://clang.llvm.org/docs/UsersManual.html#controlling-floating-point-behavior
      c2fe1568
  5. 26 Apr, 2020 1 commit
  6. 19 Apr, 2020 5 commits
  7. 14 Apr, 2020 1 commit
  8. 07 Apr, 2020 2 commits
  9. 02 Apr, 2020 1 commit
    • Adam Jackson's avatar
      fast-path: Fix some sketchy pointer arithmetic · 348e99b5
      Adam Jackson authored
      We want a uint8_t * at the end of this math, because that's what the
      function we're about to pass it to takes. But ->bits is a uint32_t, so
      if we just do the math in units of that we can avoid the explicit factor
      of four which would risk an integer overflow.
      
      Fixes: #14
      348e99b5
  10. 20 Mar, 2020 1 commit
  11. 19 Mar, 2020 1 commit
  12. 14 Mar, 2020 1 commit
    • Antonio Ospite's avatar
      pixman-compiler.h: fix building tests with MinGW · 3344f507
      Antonio Ospite authored
      MinGW supports __declspec(dllexport) but the current logic that sets
      PIXMAN_EXPORT only uses it when building with MSVC, leaving some symbols
      hidden when building with MinGW.
      
      This results in an error when trying to link the tests:
      
      -----------------------------------------------------------------------
      FAILED: subprojects/pixman/test/combiner-test.exe
      x86_64-w64-mingw32-gcc  -o subprojects/pixman/test/combiner-test.exe 'subprojects/pixman/test/f48fa9c@@combiner-test@exe/combiner-test.c.obj' -Wl,--allow-shlib-undefined -Wl,--start-group subprojects/pixman/test/libtestutils.a subprojects/pixman/pixman/libpixman-1.dll.a -pthread -fopenmp -fopenmp -lm -mconsole -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -Wl,--end-group
      /usr/bin/x86_64-w64-mingw32-ld: subprojects/pixman/test/f48fa9c@@combiner-test@exe/combiner-test.c.obj: in function `main':
      .../build/../subprojects/pixman/test/combiner-test.c:124: undefined reference to `_pixman_internal_only_get_implementation'
      collect2: error: ld returned 1 exit status
      ninja: build stopped: subcommand failed.
      -----------------------------------------------------------------------
      
      By using PIXMAN_API also when building with MinGW, the tests can link
      successfully and the build succeed.
      
      Tested with x86_64-w64-mingw32-gcc (GCC) 8.3-win32 20191201.
      3344f507
  13. 20 Feb, 2020 1 commit
  14. 30 Jan, 2020 2 commits
  15. 19 Dec, 2019 1 commit
  16. 18 Nov, 2019 11 commits
    • Chun-wei Fan's avatar
      thread-test.c: Use Windows Threading API on Windows · 7331d2b4
      Chun-wei Fan authored
      ...When we don't have a pthreads implementation available, which is
      normally the case on Windows.  This attempts to make it easier for people
      on Windows to verify whether their builds of Pixman (and Cairo component,
      if applicable) are thread-safe.  Also, make the number of threads
      a #define, so if we need to change it at some point, it's easier.
      
      This re-enables the thread-test program on Windows in Meson builds.
      7331d2b4
    • Chun-wei Fan's avatar
      demos: Define _USE_MATH_DEFINES on MSVC-style compilers · 1dd3bc0a
      Chun-wei Fan authored
      This is required for the use of M_PI.
      1dd3bc0a
    • Chun-wei Fan's avatar
      test/solid-test.c: Include stdint.h · 3bceb3a9
      Chun-wei Fan authored
      We need that to make sure we have UINT16_MAX.
      3bceb3a9
    • Chun-wei Fan's avatar
      pixman/meson.build: Define PIXMAN_API on MSVC-style compilers · c608e966
      Chun-wei Fan authored
      This will make the public APIs exported from the DLL, so that we have an
      import libary that we can use.
      c608e966
    • Chun-wei Fan's avatar
      pixman-[compiler|private].h: Export symbols for tests · 9d8dd17a
      Chun-wei Fan authored
      Define the existing PIXMAN_EXPORT to be PIXMAN_API, which can overriden
      to be __declspec(dllexport) during the build of the pixman DLL on MSVC
      builds, which will be in the next patch.
      
      Also, export more private symbols as they are needed for the test
      programs.
      9d8dd17a
    • Chun-wei Fan's avatar
      pixman/pixman.h: Mark public APIs with PIXMAN_API · 21d8ded5
      Chun-wei Fan authored
      We can override PIXMAN_API with a CFLAG or config.h define to export
      the symbols with compiler directives, if needed.
      21d8ded5
    • Chun-wei Fan's avatar
      pixman/pixman-version.h.in: Add a PIXMAN_API macro · b7eea540
      Chun-wei Fan authored
      This prepares to mark the public APIs that we have in pixman.h so that
      we can use compiler directives such as __declspec(dllexport) to export
      those symbols.
      b7eea540
    • Chun-wei Fan's avatar
      meson.build: Improve libpng search on MSVC · 06a3f6e6
      Chun-wei Fan authored
      The build system for libpng for MSVC does not generate a pkg-config file
      for us, and CMake support in Meson does not work very well.  So, look
      for libpng manually on MSVC builds if depedency discovery did not work
      out via pkg-config or the CMake config files.
      06a3f6e6
    • Chun-wei Fan's avatar
      build: Don't assume PThreads if threading support is found · 7661b1fa
      Chun-wei Fan authored
      Look also for pthread.h if threading support is found by Meson, as the
      underlying threading support may not be PThreads, depending on platform.
      
      For now, disable the thread-test test program if pthread.h and if
      necessary, the PThreads library, cannot be found, as the current
      implementation assumes the use of PThreads.
      
      Also bump the required Meson version to 0.50.0 since we need it for
      -cc.get_argument_syntax()
      -For a later commit, the has_headers sub-method for cc.find_library()
      7661b1fa
    • Chun-wei Fan's avatar
      meson.build: Disable OpenMP on MSVC builds · e9db2689
      Chun-wei Fan authored
      The implementation of OpenMP is not compliant for our uses, so disable
      it for now by just not checking for it on MSVC builds, as we implicitly
      add an /openmp switch to the build, which will cause linking the tests
      programs to fail, as the OpenMP implementation is not enough.
      e9db2689
    • Chun-wei Fan's avatar
      meson.build: Fix MMX, SSE2 and SSSE3 checks on MSVC · f251c12f
      Chun-wei Fan authored
      -For MSVC builds, do not use the GCC-specific CFlags when checking for
       these features.
      
      -For the MMX check, assume that we have good enough MMX intrinsics and
       inline assembly support (on ix86), since MSVC provides sufficient
       support for those since before the times of MSVC 2008, and 2008 is the
       oldest version that we can support, as with the pre-C99 GTK+ stack.
      
      Unfortunately due to x64 compiler issues, pre-Visual Studio 2010 will
      crash when building SSSE3 code, so we do not enable building SSSE3 code
      on pre-2010 Visual Studio.
      
      Also, for all x64 Visual Studio builds, we do not enable USE_X86_MMX
      as inline assembly is not allowed for x64 Visual Studio builds, and
      instead use the compatibility instrinsics that we already have in the
      code.
      f251c12f
  17. 13 Nov, 2019 3 commits
  18. 01 Nov, 2019 3 commits
  19. 15 Oct, 2019 1 commit