summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* pixman-compiler.h: fix building tests with MinGWAntonio Ospite2020-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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.
* pixman-combine: Fix wrong value of RB_MASK_PLUS_ONE.Yin Shiyou2020-02-201-1/+1
| | | | | No functional change, as explained by Søren in https://lists.freedesktop.org/archives/pixman/2020-February/004902.html
* meson: add missing function check (getisax)Mathieu Duponchelle2020-01-301-5/+1
| | | | | .. and add gettimeofday to the list of funcs to check instead of having a separate check for it.
* meson: finish porting over mmx and ssse2 flags for sun and msvcMathieu Duponchelle2020-01-301-2/+9
| | | | Those flags are set by the configure.ac script
* test/utils: Check for FE_INVALID definition before useKhem Raj2019-12-191-0/+2
| | | | Some architectures e.g. nios2 do not support all exceptions.
* thread-test.c: Use Windows Threading API on WindowsChun-wei Fan2019-11-192-16/+75
| | | | | | | | | | ...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.
* demos: Define _USE_MATH_DEFINES on MSVC-style compilersChun-wei Fan2019-11-191-0/+6
| | | | This is required for the use of M_PI.
* test/solid-test.c: Include stdint.hChun-wei Fan2019-11-191-0/+1
| | | | We need that to make sure we have UINT16_MAX.
* pixman/meson.build: Define PIXMAN_API on MSVC-style compilersChun-wei Fan2019-11-191-1/+7
| | | | | This will make the public APIs exported from the DLL, so that we have an import libary that we can use.
* pixman-[compiler|private].h: Export symbols for testsChun-wei Fan2019-11-192-0/+5
| | | | | | | | | 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.
* pixman/pixman.h: Mark public APIs with PIXMAN_APIChun-wei Fan2019-11-191-0/+274
| | | | | We can override PIXMAN_API with a CFLAG or config.h define to export the symbols with compiler directives, if needed.
* pixman/pixman-version.h.in: Add a PIXMAN_API macroChun-wei Fan2019-11-191-0/+4
| | | | | | 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.
* meson.build: Improve libpng search on MSVCChun-wei Fan2019-11-191-1/+18
| | | | | | | 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.
* build: Don't assume PThreads if threading support is foundChun-wei Fan2019-11-192-3/+30
| | | | | | | | | | | | | 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()
* meson.build: Disable OpenMP on MSVC buildsChun-wei Fan2019-11-191-8/+15
| | | | | | | 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.
* meson.build: Fix MMX, SSE2 and SSSE3 checks on MSVCChun-wei Fan2019-11-181-6/+21
| | | | | | | | | | | | | | | | | | | -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.
* pixman-sse2: Fix undefined unaligned loadsAdam Jackson2019-11-131-15/+18
|
* pixman-mmx: Fix undefined unaligned loadsAdam Jackson2019-11-131-3/+7
|
* pixman-mmx: Fix undefined left-shiftsAdam Jackson2019-11-131-2/+2
|
* test: Fix unrepresentable subtraction in stress-testAdam Jackson2019-11-011-1/+1
| | | | | | Does not make the test pass, but does fix this error: ../test/stress-test.c:538:25: runtime error: signed integer overflow: 2147483647 - -2 cannot be represented in type 'int'
* pixman-matrix: Fix left shift of a negative numberAdam Jackson2019-11-011-1/+1
| | | | ../pixman/pixman-matrix.c:276:35: runtime error: left shift of negative value -32768
* pixman-bits-image: Fix left shift of a negative numberAdam Jackson2019-11-011-2/+2
| | | | ../pixman/pixman-bits-image.c:678:33: runtime error: left shift of negative value -32768
* pixman-bits-image: Fix various undefined left shiftsAdam Jackson2019-10-151-14/+16
| | | | ../pixman/pixman-bits-image.c:221:20: runtime error: left shift of 204 by 24 places cannot be represented in type 'int'
* pixman-fast-path: Fix various undefined left shiftsAdam Jackson2019-10-151-2/+2
| | | | ../pixman/pixman-fast-path.c:3089:23: runtime error: left shift of 154 by 24 places cannot be represented in type 'int'
* pixman-sse2: Fix an undefined left shiftAdam Jackson2019-10-151-2/+2
| | | | ../pixman/pixman-sse2.c:3346:14: runtime error: left shift of 41891 by 16 places cannot be represented in type 'int'
* pixman-gradient-walker: Fix undefined left shiftAdam Jackson2019-10-151-4/+4
| | | | ../pixman/pixman-gradient-walker.c:216:35: runtime error: left shift of 163 by 24 places cannot be represented in type 'int'
* pixman-image: Fix undefined left shiftAdam Jackson2019-10-151-1/+1
| | | | ../pixman/pixman-image.c:963:46: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
* pixman-combine: Fix various undefined left shiftsAdam Jackson2019-10-151-2/+2
| | | | | | | | ../pixman/pixman-combine32.c:657:1: runtime error: left shift of 128 by 24 places cannot be represented in type 'int' ../pixman/pixman-combine32.c:694:1: runtime error: left shift of 232 by 24 places cannot be represented in type 'int' ../pixman/pixman-combine32.c:712:1: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' ../pixman/pixman-combine32.c:786:1: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' ../pixman/pixman-combine32.c:805:1: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
* pixman-access: Fix various undefined left shiftsAdam Jackson2019-10-151-16/+16
| | | | | | ../pixman/pixman-access.c:389:2: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' ../pixman/pixman-access.c:1101:2: runtime error: left shift of 2 by 30 places cannot be represented in type 'int' ../pixman/pixman-access.c:1152:2: runtime error: left shift of 2 by 30 places cannot be represented in type 'int'
* pixman: Fix undefined left shift in pixel_contract_from_floatAdam Jackson2019-10-151-1/+1
| | | | ../pixman/pixman-utils.c:216:14: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
* test: Fix undefined left shift in pixel_checker_initAdam Jackson2019-10-151-4/+4
| | | | ../test/utils.c:2070:57: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
* test: Fix undefined left shift in affine-testAdam Jackson2019-10-151-1/+1
| | | | ../test/affine-test.c:174:34: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
* Avoid undefined behavior (left-shifting negative value) in pixman_int_to_fixedJonathan Kew2019-09-111-1/+1
| | | Reported in https://bugzilla.mozilla.org/show_bug.cgi?id=1580352. Casting the argument to uint32_t should avoid invoking undefined behavior here. We'll still have *implementation-defined* behavior when casting the result back to pixman_fixed_t, but that's better than *undefined*.
* meson: don't use link_with for library()Dylan Baker2019-09-091-1/+8
| | | | | | | | | | | | Meson doesn't do the expected thing when library() creates a static library. Instead of combining the libraries together into a single archive it effectively discards them, resulting in missing symbols. To work around this we manually unpack the archives and shove the .o files into the final library. This doesn't affect the shared library at all, but makes the static library have the necessary symbols Fixes #33
* Explicitly cast byte to uint32_t before left-shifting.Jonathan Kew2019-08-301-2/+2
| | | | | To avoid potential signed integer overflow (undefined behavior), as implicit integer promotion means the operand becomes a (signed) int. (Issue originally reported at https://bugzilla.mozilla.org/show_bug.cgi?id=1577669)
* meson: fix TLS support under mingwChristoph Reiter2019-06-101-1/+5
| | | | | | | | | | GCC on Windows complains that "__declspec(thread)" doesn't work, but still compiles it, so the meson check doesn't work. The warning printed by gcc: "warning: 'thread' attribute directive ignored [-Wattributes]" Pass -Werror=attributes to make the check fail instead. This fixes the test suite (minus gtk tests) on Windows with mingw.
* meson: allow building a static libraryChristoph Reiter2019-06-101-1/+1
| | | | | | | | So that passing "-Ddefault_library=both" also creates a static lib. Note that Libs.private in the .pc file will still be wrong because of https://github.com/mesonbuild/meson/issues/3934 (it contains things like -lpixman-mmx)
* meson: define SIZEOF_LONG and use -WundefChristoph Reiter2019-06-101-0/+3
| | | | meson builds defaulted to SIZEOF_LONG=0 in various places
* Don't use GNU extension for binary numbersBasile Clement2019-06-101-3/+3
| | | | | | | | | | | | The dithering code (specifically `dither_factor_bayer_8`) uses a GNU extension for binary notation, eg 0b001. This is not supported by MSVC (at least) and breaks the build on this platform [1]. This patches uses hexadecimal notation instead, fixing the build. [1]: https://lists.freedesktop.org/archives/pixman/2019-June/004883.html Reviewed-by: Matt Turner <mattst88@gmail.com>
* Ordered dithering with blue noise, v2Basile Clement2019-05-257-1/+773
| | | | | | | | | | | | | | | | | | | | | | On some screens (typically low quality laptop screens), using Bayer ordered dithering has been observed to cause color changes depending on *where the gradient is rendered on the screen*, causing visible flickering when moving an image on the screen. To alleviate the issue, this patch adds support for ordered dithering using a 64x64 matrix tuned from blue noise. In addition to being devoid of the positional dependency on screen, the blue noise matrix also generates more pleasing and less discernable patterns. As such, it is now the method used for PIXMAN_DITHER_GOOD and PIXMAN_DITHER_BEST dithering methods. The 64x64 blue noise matrix has been generated using the provided `pixman/dither/make-blue-noise.c` script, which uses the void-and-cluster method. Changes since v1 (thanks Bill): - Use uint16_t for the blue noise matrix for lower memory usage - Use bitwise computation for array index
* demos: Add a dithering demoBasile Clement2019-05-255-1/+431
| | | | | | | | | This adds a dither.c which provides a demo of the dithering feature. This is based on the scale.c demo for scaling and provides a selection of intermediate formats and dithering operators (currently, only PIXMAN_DITHER_ORDERED_BAYER_8) to use. Images are first blitted onto a surface of the intermediate format with the requested dither setup, then blitted back onto a a8r8g8b8 surface for display.
* test: Check the dithering path in tolerance-testBasile Clement2019-05-253-13/+142
| | | | | | This adds support for testing dithered destinations in tolerance-test. When dithering is enabled, the pixel checker allows for an additional quantization error.
* Implement basic dithering for the wide pipeline, v3Basile Clement2019-05-255-1/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements dithering in pixman. A "dither" property is added to BITS images, which is used to: - Force rendering to the image to go through the floating point pipeline. Note that this is different from FAST_PATH_NARROW_FORMAT as it should not enable the floating point pipeline when reading from the image. - Enable dithering in dest_write_back_wide. The dithering uses the destination format to determine noise amplitude. This does not change pixman's behavior when dithering is disabled (the default). Additional types and functions are added to the public API: - The `pixman_dither_t` enum exposes the available dithering methods. Currently a single dithering method based on 8x8 Bayer matrices is implemented (PIXMAN_DITHER_ORDERED_BAYER_8). The PIXMAN_DITHER_FAST, PIXMAN_DITHER_GOOD and PIXMAN_DITHER_BEST aliases are provided and should be used to benefit from future specializations. - The `pixman_image_set_dither` function allows to set the dithering method to use when rendering to a bits image. - The `pixman_image_set_dither_offset` function allows to set a vertical and horizontal offsets for the dither matrix. This can be used after scrolling to ensure a consistent spatial positioning of the dither matrix. Changes since previous version (v2): - linear_gradient_is_horizontal optimization is still compatible with the wide pipeline. The code disabling it was a remnant of a previous patch which performed dithering directly inside linear_get_scanline, and thus needed to be called independently for each scanline. Changes since v1: - Renamed PIXMAN_DITHER_BAYER_8 to PIXMAN_DITHER_ORDERED_BAYER_8 - Disable dithering for channels with 32bpp or more (since they can represent exactly the wide values already). This makes the patches compatible with the newly added floating point format. Dithering is compatible with linear_gradient_is_horizontal
* add Hygon Dhyana support to enable X86_MMX_EXTENSIONS featureFan Jinke2019-05-021-0/+1
| | | | | Signed-off-by: Fan Jinke <fanjinke@hygon.cn> Signed-off-by: Matt Turner <mattst88@gmail.com>
* Fix bilinear filter computation in wide pipelineBasile Clement2019-04-112-1/+10
| | | | | | | | | | | | | | | | | | The recently introduced wide pipeline for filters has a typo which causes it to improperly compute bilinear interpolation positions, causing various glitches when enabled. This patch uses the proper computation for bilinear interpolation in the wide pipeline. It also makes related `if` statements conformant to the CODING_STYLE: * If a substatement spans multiple lines, then there must be braces around it. * If one substatement of an if statement has braces, then the other must too. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
* Post-release version bump to 0.38.5Matt Turner2019-04-102-2/+2
| | | | Signed-off-by: Matt Turner <mattst88@gmail.com>
* Pre-release version bump to 0.38.4pixman-0.38.4Matt Turner2019-04-102-2/+2
| | | | Signed-off-by: Matt Turner <mattst88@gmail.com>
* Makefile.am: Ship Meson assembly test files in the tarballMatt Turner2019-04-101-0/+2
| | | | | | | | | | These were forgotten in commit 0ea37df4286e (meson: store ARM SIMD and NEON tests as text files) and since autotools doesn't use them make distcheck still succeeded. Fixes #30 Signed-off-by: Matt Turner <mattst88@gmail.com>
* Makefile.am: Update download linksMatt Turner2019-04-071-2/+2
| | | | Signed-off-by: Matt Turner <mattst88@gmail.com>
* Post-release version bump to 0.38.3Matt Turner2019-04-072-2/+2
| | | | Signed-off-by: Matt Turner <mattst88@gmail.com>