summaryrefslogtreecommitdiff
path: root/Build/source/libs/pixman
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/pixman')
-rw-r--r--Build/source/libs/pixman/ChangeLog5
-rw-r--r--Build/source/libs/pixman/README4
-rw-r--r--Build/source/libs/pixman/TLpatches/ChangeLog5
-rw-r--r--Build/source/libs/pixman/TLpatches/TL-Changes2
-rw-r--r--Build/source/libs/pixman/TLpatches/patch-01-hide-symbols6
-rwxr-xr-xBuild/source/libs/pixman/configure20
-rw-r--r--Build/source/libs/pixman/pixman-src/Makefile.am5
-rw-r--r--Build/source/libs/pixman/pixman-src/configure.ac2
-rw-r--r--Build/source/libs/pixman/pixman-src/meson.build496
-rw-r--r--Build/source/libs/pixman/pixman-src/meson_options.txt103
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/Makefile.am1
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/meson.build116
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/pixman-bits-image.c414
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/pixman-conical-gradient.c36
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/pixman-gradient-walker.c114
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/pixman-inlines.h25
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/pixman-linear-gradient.c47
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/pixman-private.h35
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/pixman-radial-gradient.c112
-rw-r--r--Build/source/libs/pixman/version.ac2
20 files changed, 1310 insertions, 240 deletions
diff --git a/Build/source/libs/pixman/ChangeLog b/Build/source/libs/pixman/ChangeLog
index 8591e66b8e7..8f5ad629fed 100644
--- a/Build/source/libs/pixman/ChangeLog
+++ b/Build/source/libs/pixman/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-13 Akira Kakuto <kakuto@w32tex.org>
+
+ Import pixman-0.38.0.
+ * version.ac: Adapted.
+
2018-11-22 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
Import pixman-0.36.0.
diff --git a/Build/source/libs/pixman/README b/Build/source/libs/pixman/README
index ddf7aa4def7..a60417a1b35 100644
--- a/Build/source/libs/pixman/README
+++ b/Build/source/libs/pixman/README
@@ -1,4 +1,4 @@
- Building pixman-0.36.0 as part of the TL tree
+ Building pixman-0.38.0 as part of the TL tree
=============================================
This directory libs/pixman/ uses a proxy Makefile.am to build the pixman
@@ -12,4 +12,4 @@ been translated into equivalent test in libs/pixman/configure.ac.
2012-11-10 Taco Hoekwater <taco@metatex.org>
2012-11-15 Peter Breitenlohner <peb@mppmu.mpg.de>
-2018-11-22 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+2019-02-13 Akira Kakuto <kakuto@w32tex.org>
diff --git a/Build/source/libs/pixman/TLpatches/ChangeLog b/Build/source/libs/pixman/TLpatches/ChangeLog
index 74472ab460b..ac12617622c 100644
--- a/Build/source/libs/pixman/TLpatches/ChangeLog
+++ b/Build/source/libs/pixman/TLpatches/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-13 Akira Kakuto <kakuto@w32tex.org>
+
+ Import pixman-0.38.0.
+ * patch-01-hide-symbols: Adapted.
+
2018-11-22 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
Import pixman-0.36.0.
diff --git a/Build/source/libs/pixman/TLpatches/TL-Changes b/Build/source/libs/pixman/TLpatches/TL-Changes
index 12fa371ae4b..f566f095177 100644
--- a/Build/source/libs/pixman/TLpatches/TL-Changes
+++ b/Build/source/libs/pixman/TLpatches/TL-Changes
@@ -1,4 +1,4 @@
-Changes applied to the pixman-0.36.0/ tree as obtained from:
+Changes applied to the pixman-0.38.0/ tree as obtained from:
http://cairographics.org/releases/
Removed:
diff --git a/Build/source/libs/pixman/TLpatches/patch-01-hide-symbols b/Build/source/libs/pixman/TLpatches/patch-01-hide-symbols
index b583be3474f..dcc3bb0989c 100644
--- a/Build/source/libs/pixman/TLpatches/patch-01-hide-symbols
+++ b/Build/source/libs/pixman/TLpatches/patch-01-hide-symbols
@@ -1,6 +1,6 @@
-diff -ur pixman-0.36.0/pixman/pixman-compiler.h pixman-src/pixman/pixman-compiler.h
---- pixman-0.36.0/pixman/pixman-compiler.h Wed Apr 11 21:07:58 2018
-+++ pixman-src/pixman/pixman-compiler.h Thu Nov 22 15:59:02 2018
+diff -ur pixman-0.38.0/pixman/pixman-compiler.h pixman-src/pixman/pixman-compiler.h
+--- pixman-0.38.0/pixman/pixman-compiler.h Wed Apr 11 21:07:58 2018
++++ pixman-src/pixman/pixman-compiler.h Wed Feb 13 07:43:19 2019
@@ -91,7 +91,7 @@
/* GCC visibility */
diff --git a/Build/source/libs/pixman/configure b/Build/source/libs/pixman/configure
index a301df98c71..505ddfe81ba 100755
--- a/Build/source/libs/pixman/configure
+++ b/Build/source/libs/pixman/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for pixman (TeX Live) 0.36.0.
+# Generated by GNU Autoconf 2.69 for pixman (TeX Live) 0.38.0.
#
# Report bugs to <tex-k@tug.org>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='pixman (TeX Live)'
PACKAGE_TARNAME='pixman--tex-live-'
-PACKAGE_VERSION='0.36.0'
-PACKAGE_STRING='pixman (TeX Live) 0.36.0'
+PACKAGE_VERSION='0.38.0'
+PACKAGE_STRING='pixman (TeX Live) 0.38.0'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''
@@ -1281,7 +1281,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures pixman (TeX Live) 0.36.0 to adapt to many kinds of systems.
+\`configure' configures pixman (TeX Live) 0.38.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1348,7 +1348,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pixman (TeX Live) 0.36.0:";;
+ short | recursive ) echo "Configuration of pixman (TeX Live) 0.38.0:";;
esac
cat <<\_ACEOF
@@ -1445,7 +1445,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pixman (TeX Live) configure 0.36.0
+pixman (TeX Live) configure 0.38.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pixman (TeX Live) $as_me 0.36.0, which was
+It was created by pixman (TeX Live) $as_me 0.38.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3876,7 +3876,7 @@ fi
# Define the identity of the package.
PACKAGE='pixman--tex-live-'
- VERSION='0.36.0'
+ VERSION='0.38.0'
cat >>confdefs.h <<_ACEOF
@@ -6587,7 +6587,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pixman (TeX Live) $as_me 0.36.0, which was
+This file was extended by pixman (TeX Live) $as_me 0.38.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6653,7 +6653,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-pixman (TeX Live) config.status 0.36.0
+pixman (TeX Live) config.status 0.38.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/libs/pixman/pixman-src/Makefile.am b/Build/source/libs/pixman/pixman-src/Makefile.am
index 593cbcf1e97..a6806650391 100644
--- a/Build/source/libs/pixman/pixman-src/Makefile.am
+++ b/Build/source/libs/pixman/pixman-src/Makefile.am
@@ -23,7 +23,10 @@ RELEASE_ANNOUNCE_LIST = cairo-announce@cairographics.org, xorg-announce@lists.fr
EXTRA_DIST = \
Makefile.win32 \
- Makefile.win32.common
+ Makefile.win32.common \
+ meson.build \
+ meson_options.txt \
+ $(NULL)
tar_gz = $(PACKAGE)-$(VERSION).tar.gz
tar_bz2 = $(PACKAGE)-$(VERSION).tar.bz2
diff --git a/Build/source/libs/pixman/pixman-src/configure.ac b/Build/source/libs/pixman/pixman-src/configure.ac
index 0d55402f910..6efc6c0f80d 100644
--- a/Build/source/libs/pixman/pixman-src/configure.ac
+++ b/Build/source/libs/pixman/pixman-src/configure.ac
@@ -53,7 +53,7 @@ AC_PREREQ([2.57])
#
m4_define([pixman_major], 0)
-m4_define([pixman_minor], 36)
+m4_define([pixman_minor], 38)
m4_define([pixman_micro], 0)
m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
diff --git a/Build/source/libs/pixman/pixman-src/meson.build b/Build/source/libs/pixman/pixman-src/meson.build
new file mode 100644
index 00000000000..fe77893b8ce
--- /dev/null
+++ b/Build/source/libs/pixman/pixman-src/meson.build
@@ -0,0 +1,496 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+project(
+ 'pixman',
+ ['c'],
+ version : '0.38.0',
+ license : 'MIT',
+ meson_version : '>= 0.47.2',
+ default_options : ['buildtype=debugoptimized'],
+)
+
+config = configuration_data()
+cc = meson.get_compiler('c')
+null_dep = dependency('', required : false)
+
+add_project_arguments(
+ cc.get_supported_arguments([
+ '-Wdeclaration-after-statement',
+ '-fno-strict-aliasing',
+ '-fvisibility=hidden',
+ ]),
+ language : ['c']
+)
+
+# GCC and Clang both ignore -Wno options that they don't recognize, so test for
+# -W<opt>, then add -Wno-<opt> if it's ignored
+foreach opt : ['unused-local-typedefs']
+ if cc.has_argument('-W' + opt)
+ add_project_arguments(['-Wno-' + opt], language : ['c'])
+ endif
+endforeach
+
+use_loongson_mmi = get_option('loongson-mmi')
+have_loongson_mmi = false
+loongson_mmi_flags = ['-mach=loongson2f']
+if not use_loongson_mmi.disabled()
+ if host_machine.cpu_family() == 'mips64' and cc.compiles('''
+ #ifndef __mips_loongson_vector_rev
+ #error "Loongson Multimedia Instructions are only available on Loongson"
+ #endif
+ #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
+ #error "Need GCC >= 4.4 for Loongson MMI compilation"
+ #endif
+ #include "pixman/loongson-mmintrin.h"
+ int main () {
+ union {
+ __m64 v;
+ char c[8];
+ } a = { .c = {1, 2, 3, 4, 5, 6, 7, 8} };
+ int b = 4;
+ __m64 c = _mm_srli_pi16 (a.v, b);
+ return 0;
+ }''',
+ args : loongson_mmi_flags,
+ name : 'Loongson MMI Intrinsic Support')
+ have_loongson_mmi = true
+ endif
+endif
+
+if have_loongson_mmi
+ config.set10('USE_LOONGSON_MMI', true)
+elif use_loongson_mmi.enabled()
+ error('Loongson MMI Support unavailable, but required')
+endif
+
+use_mmx = get_option('mmx')
+have_mmx = false
+mmx_flags = ['-mmmx', '-Winline']
+if not use_mmx.disabled()
+ if host_machine.cpu_family() == 'x86_64'
+ have_mmx = true
+ elif host_machine.cpu_family() == 'x86' and cc.compiles('''
+ #include <mmintrin.h>
+ #include <stdint.h>
+
+ /* Check support for block expressions */
+ #define _mm_shuffle_pi16(A, N) \
+ ({ \
+ __m64 ret; \
+ \
+ /* Some versions of clang will choke on K */ \
+ asm ("pshufw %2, %1, %0\n\t" \
+ : "=y" (ret) \
+ : "y" (A), "K" ((const int8_t)N) \
+ ); \
+ \
+ ret; \
+ })
+
+ int main () {
+ __m64 v = _mm_cvtsi32_si64 (1);
+ __m64 w;
+
+ w = _mm_shuffle_pi16(v, 5);
+
+ /* Some versions of clang will choke on this */
+ asm ("pmulhuw %1, %0\n\t"
+ : "+y" (w)
+ : "y" (v)
+ );
+
+ return _mm_cvtsi64_si32 (v);
+ }''',
+ args : mmx_flags,
+ name : 'MMX Intrinsic Support')
+ have_mmx = true
+ endif
+endif
+
+if have_mmx
+ config.set10('USE_X86_MMX', true)
+elif use_mmx.enabled()
+ error('MMX Support unavailable, but required')
+endif
+
+use_sse2 = get_option('sse2')
+have_sse2 = false
+sse2_flags = ['-msse2', '-Winline']
+if not use_sse2.disabled()
+ if host_machine.cpu_family() == 'x86'
+ if cc.compiles('''
+ #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
+ # if !defined(__amd64__) && !defined(__x86_64__)
+ # error "Need GCC >= 4.2 for SSE2 intrinsics on x86"
+ # endif
+ #endif
+ #include <mmintrin.h>
+ #include <xmmintrin.h>
+ #include <emmintrin.h>
+ int param;
+ int main () {
+ __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
+ c = _mm_xor_si128 (a, b);
+ return _mm_cvtsi128_si32(c);
+ }''',
+ args : sse2_flags,
+ name : 'SSE2 Intrinsic Support')
+ have_sse2 = true
+ endif
+ elif host_machine.cpu_family() == 'x86_64'
+ have_sse2 = true
+ endif
+endif
+
+if have_sse2
+ config.set10('USE_SSE2', true)
+elif use_sse2.enabled()
+ error('sse2 Support unavailable, but required')
+endif
+
+use_ssse3 = get_option('ssse3')
+have_ssse3 = false
+ssse3_flags =['-mssse3', '-Winline']
+if not use_ssse3.disabled()
+ if host_machine.cpu_family().startswith('x86')
+ if cc.compiles('''
+ #include <mmintrin.h>
+ #include <xmmintrin.h>
+ #include <emmintrin.h>
+ int param;
+ int main () {
+ __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
+ c = _mm_xor_si128 (a, b);
+ return _mm_cvtsi128_si32(c);
+ }''',
+ args : ssse3_flags,
+ name : 'SSSE3 Intrinsic Support')
+ have_ssse3 = true
+ endif
+ endif
+endif
+
+if have_ssse3
+ config.set10('USE_SSSE3', true)
+elif use_ssse3.enabled()
+ error('ssse3 Support unavailable, but required')
+endif
+
+use_vmx = get_option('vmx')
+have_vmx = false
+vmx_flags = ['-maltivec', '-mabi=altivec']
+if not use_vmx.disabled()
+ if host_machine.cpu_family().startswith('ppc')
+ if cc.compiles('''
+ #include <altivec.h>
+ int main () {
+ vector unsigned int v = vec_splat_u32 (1);
+ v = vec_sub (v, v);
+ return 0;
+ }''',
+ args : vmx_flags,
+ name : 'VMX/Altivec Intrinsic Support')
+ have_vmx = true
+ endif
+ endif
+endif
+
+if have_vmx
+ config.set10('USE_VMX', true)
+elif use_vmx.enabled()
+ error('vmx Support unavailable, but required')
+endif
+
+use_armv6_simd = get_option('arm-simd')
+have_armv6_simd = false
+if not use_armv6_simd.disabled()
+ if host_machine.cpu_family() == 'arm'
+ if cc.compiles('''
+ .text
+ .arch armv6
+ .object_arch armv4
+ .arm
+ .altmacro
+ #ifndef __ARM_EABI__
+ #error EABI is required (to be sure that calling conventions are compatible)
+ #endif
+ pld [r0]
+ uqadd8 r0, r0, r0
+ ''',
+ args : ['-x assembler-with-cpp'],
+ name : 'ARMv6 SIMD Intrinsic Support')
+ have_armv6_simd = true
+ endif
+ endif
+endif
+
+if have_armv6_simd
+ config.set10('USE_ARM_SIMD', true)
+elif use_armv6_simd.enabled()
+ error('ARMv6 SIMD Support unavailable, but required')
+endif
+
+use_neon = get_option('neon')
+have_neon = false
+if not use_neon.disabled()
+ if host_machine.cpu_family() == 'arm'
+ if cc.compiles('''
+ .text
+ .fpu neon
+ .arch armv7a
+ .object_arch armv4
+ .eabi_attribute 10, 0
+ .arm
+ .altmacro
+ #ifndef __ARM_EABI__
+ #error EABI is required (to be sure that calling conventions are compatible)
+ #endif
+ pld [r0]
+ vmovn.u16 d0, q0
+ ''',
+ args : ['-x assembler-with-cpp'],
+ name : 'NEON Intrinsic Support')
+ have_neon = true
+ endif
+ endif
+endif
+
+if have_neon
+ config.set10('USE_ARM_NEON', true)
+elif use_neon.enabled()
+ error('NEON Support unavailable, but required')
+endif
+
+use_iwmmxt = get_option('iwmmxt')
+have_iwmmxt = false
+iwmmxt_flags = ['-flax-vector-conversions', '-Winline']
+if not use_iwmmxt.disabled()
+ if get_option('iwmmxt2')
+ iwmmxt_flags += '-march=iwmmxt2'
+ else
+ iwmmxt_flags += '-march=iwmmxt'
+ endif
+
+ if host_machine.cpu_family() == 'arm'
+ if cc.compiles('''
+ #ifndef __IWMMXT__
+ #error "IWMMXT not enabled (with -march=iwmmxt)"
+ #endif
+ #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))
+ #error "Need GCC >= 4.8 for IWMMXT intrinsics"
+ #endif
+ #include <mmintrin.h>
+ int main () {
+ union {
+ __m64 v;
+ char c[8];
+ } a = { .c = {1, 2, 3, 4, 5, 6, 7, 8} };
+ int b = 4;
+ __m64 c = _mm_srli_si64 (a.v, b);
+ }
+ ''',
+ args : iwmmxt_flags,
+ name : 'IWMMXT Intrinsic Support')
+ have_iwmmxt = true
+ endif
+ endif
+endif
+
+if have_iwmmxt
+ config.set10('USE_ARM_IWMMXT', true)
+elif use_iwmmxt.enabled()
+ error('NEON Support unavailable, but required')
+endif
+
+use_mips_dspr2 = get_option('mips-dspr2')
+have_mips_dspr2 = false
+mips_dspr2_flags = ['-mdspr2']
+if not use_mips_dspr2.disabled()
+ if host_machine.cpu_family() == 'mips32'
+ if cc.compiles('''
+ #if !(defined(__mips__) && __mips_isa_rev >= 2)
+ #error MIPS DSPr2 is currently only available on MIPS32r2 platforms.
+ #endif
+ int
+ main ()
+ {
+ int c = 0, a = 0, b = 0;
+ __asm__ __volatile__ (
+ "precr.qb.ph %[c], %[a], %[b] \n\t"
+ : [c] "=r" (c)
+ : [a] "r" (a), [b] "r" (b)
+ );
+ return c;
+ }''',
+ args : mipds_dspr2_flags,
+ name : 'DSPr2 Intrinsic Support')
+ have_mips_dspr2 = true
+ endif
+ endif
+endif
+
+if have_mips_dspr2
+ config.set10('USE_MIPS_DSPR2', true)
+elif use_mips_dspr2.enabled()
+ error('MIPS DSPr2 Support unavailable, but required')
+endif
+
+use_gnu_asm = get_option('gnu-inline-asm')
+if not use_gnu_asm.disabled()
+ if cc.compiles('''
+ int main () {
+ /* Most modern architectures have a NOP instruction, so this is a fairly generic test. */
+ asm volatile ( "\tnop\n" : : : "cc", "memory" );
+ return 0;
+ }
+ ''',
+ name : 'GNU Inline ASM support.')
+ config.set10('USE_GCC_INLINE_ASM', true)
+ elif use_gnu_asm.enabled()
+ error('GNU inline assembly support missing but required.')
+ endif
+endif
+
+if get_option('timers')
+ config.set('PIXMAN_TIMERS', 1)
+endif
+if get_option('gnuplot')
+ config.set('PIXMAN_GNUPLOT', 1)
+endif
+
+use_openmp = get_option('openmp')
+dep_openmp = null_dep
+if not use_openmp.disabled()
+ dep_openmp = dependency('openmp', required : get_option('openmp'))
+ if dep_openmp.found()
+ config.set10('USE_OPENMP', true)
+ endif
+endif
+
+dep_gtk = dependency('gtk+-2.0', version : '>= 2.16', required : get_option('gtk'))
+dep_glib = dependency('glib-2.0', required : get_option('gtk'))
+dep_pixman = dependency('pixman-1', required : get_option('gtk'),
+ version : '>= ' + meson.project_version())
+dep_png = dependency('libpng', required : get_option('libpng'))
+if dep_png.found()
+ config.set('HAVE_LIBPNG', 1)
+endif
+dep_m = cc.find_library('m', required : false)
+dep_threads = dependency('threads')
+if dep_threads.found()
+ config.set('HAVE_PTHREADS', 1)
+endif
+
+funcs = ['sigaction', 'alarm', 'mprotect', 'getpagesize', 'mmap']
+# mingw claimes to have posix_memalign, but it doesn't
+if host_machine.system() != 'windows'
+ funcs += 'posix_memalign'
+endif
+
+foreach f : funcs
+ if cc.has_function(f)
+ config.set('HAVE_@0@'.format(f.to_upper()), 1)
+ endif
+endforeach
+
+if cc.has_function('gettimeofday')
+ config.set('HAVE_GETTIMEOFDAY', 1)
+endif
+
+# This is only used in one test, that defines _GNU_SOURCE
+if cc.has_function('feenableexcept',
+ prefix : '#define _GNU_SOURCE\n#include <fenv.h>',
+ dependencies : dep_m)
+ config.set('HAVE_FEENABLEEXCEPT', 1)
+endif
+
+if cc.has_header_symbol('fenv.h', 'FE_DIVBYZERO')
+ config.set('HAVE_FEDIVBYZERO', 1)
+endif
+
+foreach h : ['sys/mman.h', 'fenv.h', 'unistd.h']
+ if cc.check_header(h)
+ config.set('HAVE_@0@'.format(h.underscorify().to_upper()), 1)
+ endif
+endforeach
+
+if (host_machine.system() == 'windows' and
+ cc.compiles('int __declspec(thread) foo;', name : 'TLS via __declspec(thread)'))
+ config.set('TLS', '__declspec(thread)')
+elif cc.compiles('int __thread foo;', name : 'TLS via __thread')
+ config.set('TLS', '__thread')
+endif
+
+if cc.links('''
+ static int x = 1;
+ static void __attribute__((constructor)) constructor_function () { x = 0; }
+ int main (void) { return x; }
+ ''',
+ name : '__attribute__((constructor))')
+ config.set('TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR', 1)
+endif
+
+if cc.links(
+ ' __float128 a = 1.0Q, b = 2.0Q; int main (void) { return a + b; }',
+ name : 'Has float128 support')
+ config.set('HAVE_FLOAT128', 1)
+endif
+
+if cc.has_function('clz')
+ config.set('HAVE_BUILTIN_CLZ', 1)
+endif
+
+if cc.links('''
+ unsigned int __attribute__ ((vector_size(16))) e, a, b;
+ int main (void) { e = a - ((b << 27) + (b >> (32 - 27))) + 1; return e[0]; }
+ ''',
+ name : 'Support for GCC vector extensions')
+ config.set('HAVE_GCC_VECTOR_EXTENSIONS', 1)
+endif
+
+if host_machine.endian() == 'big'
+ config.set('WORDS_BIGENDIAN', 1)
+endif
+
+# Required to make pixman-private.h
+config.set('PACKAGE', 'foo')
+
+version_conf = configuration_data()
+split = meson.project_version().split('.')
+version_conf.set('PIXMAN_VERSION_MAJOR', split[0])
+version_conf.set('PIXMAN_VERSION_MINOR', split[1])
+version_conf.set('PIXMAN_VERSION_MICRO', split[2])
+
+add_project_arguments('-DHAVE_CONFIG_H', language : ['c'])
+
+subdir('pixman')
+subdir('test')
+subdir('demos')
+
+pkg = import('pkgconfig')
+pkg.generate(
+ name : 'Pixman',
+ filebase : 'pixman-1',
+ description : 'The pixman library (version 1)',
+ libraries : libpixman,
+ subdirs: 'pixman-1',
+ version : meson.project_version(),
+)
diff --git a/Build/source/libs/pixman/pixman-src/meson_options.txt b/Build/source/libs/pixman/pixman-src/meson_options.txt
new file mode 100644
index 00000000000..79ff4a3af00
--- /dev/null
+++ b/Build/source/libs/pixman/pixman-src/meson_options.txt
@@ -0,0 +1,103 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+option(
+ 'loongson-mmi',
+ type : 'feature',
+ description : 'Use Loongson MMI intrinsic optimized paths',
+)
+option(
+ 'mmx',
+ type : 'feature',
+ description : 'Use X86 MMX intrinsic optimized paths',
+)
+option(
+ 'sse2',
+ type : 'feature',
+ description : 'Use X86 SSE2 intrinsic optimized paths',
+)
+option(
+ 'ssse3',
+ type : 'feature',
+ description : 'Use X86 SSSE3 intrinsic optimized paths',
+)
+option(
+ 'vmx',
+ type : 'feature',
+ description : 'Use PPC VMX/Altivec intrinsic optimized paths',
+)
+option(
+ 'arm-simd',
+ type : 'feature',
+ description : 'Use ARMv6 SIMD intrinsic optimized paths',
+)
+option(
+ 'neon',
+ type : 'feature',
+ description : 'Use ARM NEON intrinsic optimized paths',
+)
+option(
+ 'iwmmxt',
+ type : 'feature',
+ description : 'Use ARM IWMMXT intrinsic optimized paths',
+)
+option(
+ 'iwmmxt2',
+ type : 'boolean',
+ value : true,
+ description : 'Use ARM IWMMXT2 intrinsic instead of IWMMXT',
+)
+option(
+ 'mips-dspr2',
+ type : 'feature',
+ description : 'Use MIPS32 DSPr2 intrinsic optimized paths',
+)
+option(
+ 'gnu-inline-asm',
+ type : 'feature',
+ description : 'Use GNU style inline assembler',
+)
+option(
+ 'openmp',
+ type : 'feature',
+ description : 'Enable openmp support',
+)
+option(
+ 'timers',
+ type : 'boolean',
+ value : false,
+ description : 'Enable TIMER_* macros',
+)
+option(
+ 'gnuplot',
+ type : 'boolean',
+ value : false,
+ description : 'Enable output of filters that can be piped to gnuplot',
+)
+option(
+ 'gtk',
+ type : 'feature',
+ description : 'Enable tests using GTK',
+)
+option(
+ 'libpng',
+ type : 'feature',
+ description : 'Use libpng'
+)
diff --git a/Build/source/libs/pixman/pixman-src/pixman/Makefile.am b/Build/source/libs/pixman/pixman-src/pixman/Makefile.am
index 581b6f61e2e..3de26153e95 100644
--- a/Build/source/libs/pixman/pixman-src/pixman/Makefile.am
+++ b/Build/source/libs/pixman/pixman-src/pixman/Makefile.am
@@ -14,6 +14,7 @@ EXTRA_DIST = \
Makefile.win32 \
pixman-region.c \
solaris-hwcap.mapfile \
+ meson.build \
$(NULL)
# mmx code
diff --git a/Build/source/libs/pixman/pixman-src/pixman/meson.build b/Build/source/libs/pixman/pixman-src/pixman/meson.build
new file mode 100644
index 00000000000..3dabec97cab
--- /dev/null
+++ b/Build/source/libs/pixman/pixman-src/pixman/meson.build
@@ -0,0 +1,116 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+config_h = configure_file(
+ configuration : config,
+ output : 'config.h'
+)
+
+version_h = configure_file(
+ configuration : version_conf,
+ input : 'pixman-version.h.in',
+ output : 'pixman-version.h',
+ install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'pixman-1')
+)
+
+pixman_simd_libs = []
+simds = [
+ ['mmx', have_mmx, mmx_flags, []],
+ ['sse2', have_sse2, sse2_flags, []],
+ ['ssse3', have_ssse3, ssse3_flags, []],
+ ['vmx', have_vmx, vmx_flags, []],
+ ['arm-simd', have_armv6_simd, [],
+ ['pixman-arm-simd-asm.S', 'pixman-arm-simd-asm-scaled.S']],
+ ['arm-neon', have_neon, [],
+ ['pixman-arm-neon-asm.S', 'pixman-arm-neon-asm-scaled.S']],
+ ['mips-dspr2', have_mips_dspr2, mips_dspr2_flags,
+ ['pixman-mips-dspr2-asm.S', 'pixman-mips-memcpy-asm.S']],
+ ['loongson-mmi', have_loongson_mmi, loongson_mmi_flags, []]
+]
+
+foreach simd : simds
+ if simd[1]
+ name = 'pixman-' + simd[0]
+ pixman_simd_libs += static_library(
+ name,
+ [name + '.c', config_h, version_h, simd[3]],
+ c_args : simd[2]
+ )
+ endif
+endforeach
+
+if have_iwmmxt
+ pixman_simd_libs += static_library(
+ 'pixman-iwmmt',
+ 'pixman-mmx.c',
+ c_args : iwmmxt_flags,
+ )
+endif
+
+pixman_files = files(
+ 'pixman.c',
+ 'pixman-access.c',
+ 'pixman-access-accessors.c',
+ 'pixman-bits-image.c',
+ 'pixman-combine32.c',
+ 'pixman-combine-float.c',
+ 'pixman-conical-gradient.c',
+ 'pixman-filter.c',
+ 'pixman-x86.c',
+ 'pixman-mips.c',
+ 'pixman-arm.c',
+ 'pixman-ppc.c',
+ 'pixman-edge.c',
+ 'pixman-edge-accessors.c',
+ 'pixman-fast-path.c',
+ 'pixman-glyph.c',
+ 'pixman-general.c',
+ 'pixman-gradient-walker.c',
+ 'pixman-image.c',
+ 'pixman-implementation.c',
+ 'pixman-linear-gradient.c',
+ 'pixman-matrix.c',
+ 'pixman-noop.c',
+ 'pixman-radial-gradient.c',
+ 'pixman-region16.c',
+ 'pixman-region32.c',
+ 'pixman-solid-fill.c',
+ 'pixman-timer.c',
+ 'pixman-trap.c',
+ 'pixman-utils.c',
+)
+
+libpixman = shared_library(
+ 'pixman-1',
+ [pixman_files, config_h, version_h],
+ link_with : [pixman_simd_libs],
+ dependencies : [dep_m, dep_threads],
+ version : meson.project_version(),
+ install : true,
+)
+
+inc_pixman = include_directories('.')
+
+idep_pixman = declare_dependency(
+ link_with: libpixman,
+ include_directories : inc_pixman,
+)
+
+install_headers('pixman.h', subdir : 'pixman-1')
diff --git a/Build/source/libs/pixman/pixman-src/pixman/pixman-bits-image.c b/Build/source/libs/pixman/pixman-src/pixman/pixman-bits-image.c
index 9fb91ff5831..564789e9c68 100644
--- a/Build/source/libs/pixman/pixman-src/pixman/pixman-bits-image.c
+++ b/Build/source/libs/pixman/pixman-src/pixman/pixman-bits-image.c
@@ -36,43 +36,45 @@
#include "pixman-combine32.h"
#include "pixman-inlines.h"
-static uint32_t *
-_pixman_image_get_scanline_generic_float (pixman_iter_t * iter,
- const uint32_t *mask)
-{
- pixman_iter_get_scanline_t fetch_32 = iter->data;
- uint32_t *buffer = iter->buffer;
-
- fetch_32 (iter, NULL);
+/* Fetch functions */
- pixman_expand_to_float ((argb_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
+static force_inline void
+fetch_pixel_no_alpha_32 (bits_image_t *image,
+ int x, int y, pixman_bool_t check_bounds,
+ void *out)
+{
+ uint32_t *ret = out;
- return iter->buffer;
+ if (check_bounds &&
+ (x < 0 || x >= image->width || y < 0 || y >= image->height))
+ *ret = 0;
+ else
+ *ret = image->fetch_pixel_32 (image, x, y);
}
-/* Fetch functions */
-
-static force_inline uint32_t
-fetch_pixel_no_alpha (bits_image_t *image,
- int x, int y, pixman_bool_t check_bounds)
+static force_inline void
+fetch_pixel_no_alpha_float (bits_image_t *image,
+ int x, int y, pixman_bool_t check_bounds,
+ void *out)
{
+ argb_t *ret = out;
+
if (check_bounds &&
(x < 0 || x >= image->width || y < 0 || y >= image->height))
- {
- return 0;
- }
-
- return image->fetch_pixel_32 (image, x, y);
+ ret->a = ret->r = ret->g = ret->b = 0.f;
+ else
+ *ret = image->fetch_pixel_float (image, x, y);
}
-typedef uint32_t (* get_pixel_t) (bits_image_t *image,
- int x, int y, pixman_bool_t check_bounds);
+typedef void (* get_pixel_t) (bits_image_t *image,
+ int x, int y, pixman_bool_t check_bounds, void *out);
-static force_inline uint32_t
+static force_inline void
bits_image_fetch_pixel_nearest (bits_image_t *image,
pixman_fixed_t x,
pixman_fixed_t y,
- get_pixel_t get_pixel)
+ get_pixel_t get_pixel,
+ void *out)
{
int x0 = pixman_fixed_to_int (x - pixman_fixed_e);
int y0 = pixman_fixed_to_int (y - pixman_fixed_e);
@@ -82,19 +84,20 @@ bits_image_fetch_pixel_nearest (bits_image_t *image,
repeat (image->common.repeat, &x0, image->width);
repeat (image->common.repeat, &y0, image->height);
- return get_pixel (image, x0, y0, FALSE);
+ get_pixel (image, x0, y0, FALSE, out);
}
else
{
- return get_pixel (image, x0, y0, TRUE);
+ get_pixel (image, x0, y0, TRUE, out);
}
}
-static force_inline uint32_t
-bits_image_fetch_pixel_bilinear (bits_image_t *image,
- pixman_fixed_t x,
- pixman_fixed_t y,
- get_pixel_t get_pixel)
+static force_inline void
+bits_image_fetch_pixel_bilinear_32 (bits_image_t *image,
+ pixman_fixed_t x,
+ pixman_fixed_t y,
+ get_pixel_t get_pixel,
+ void *out)
{
pixman_repeat_t repeat_mode = image->common.repeat;
int width = image->width;
@@ -102,6 +105,7 @@ bits_image_fetch_pixel_bilinear (bits_image_t *image,
int x1, y1, x2, y2;
uint32_t tl, tr, bl, br;
int32_t distx, disty;
+ uint32_t *ret = out;
x1 = x - pixman_fixed_1 / 2;
y1 = y - pixman_fixed_1 / 2;
@@ -121,27 +125,140 @@ bits_image_fetch_pixel_bilinear (bits_image_t *image,
repeat (repeat_mode, &x2, width);
repeat (repeat_mode, &y2, height);
- tl = get_pixel (image, x1, y1, FALSE);
- bl = get_pixel (image, x1, y2, FALSE);
- tr = get_pixel (image, x2, y1, FALSE);
- br = get_pixel (image, x2, y2, FALSE);
+ get_pixel (image, x1, y1, FALSE, &tl);
+ get_pixel (image, x2, y1, FALSE, &tr);
+ get_pixel (image, x1, y2, FALSE, &bl);
+ get_pixel (image, x2, y2, FALSE, &br);
}
else
{
- tl = get_pixel (image, x1, y1, TRUE);
- tr = get_pixel (image, x2, y1, TRUE);
- bl = get_pixel (image, x1, y2, TRUE);
- br = get_pixel (image, x2, y2, TRUE);
+ get_pixel (image, x1, y1, TRUE, &tl);
+ get_pixel (image, x2, y1, TRUE, &tr);
+ get_pixel (image, x1, y2, TRUE, &bl);
+ get_pixel (image, x2, y2, TRUE, &br);
}
- return bilinear_interpolation (tl, tr, bl, br, distx, disty);
+ *ret = bilinear_interpolation (tl, tr, bl, br, distx, disty);
}
-static force_inline uint32_t
+static force_inline void
+bits_image_fetch_pixel_bilinear_float (bits_image_t *image,
+ pixman_fixed_t x,
+ pixman_fixed_t y,
+ get_pixel_t get_pixel,
+ void *out)
+{
+ pixman_repeat_t repeat_mode = image->common.repeat;
+ int width = image->width;
+ int height = image->height;
+ int x1, y1, x2, y2;
+ argb_t tl, tr, bl, br;
+ float distx, disty;
+ argb_t *ret = out;
+
+ x1 = x - pixman_fixed_1 / 2;
+ y1 = y - pixman_fixed_1 / 2;
+
+ distx = ((float)pixman_fixed_fraction(x1)) / 65536.f;
+ disty = ((float)pixman_fixed_fraction(y1)) / 65536.f;
+
+ x1 = pixman_fixed_to_int (x1);
+ y1 = pixman_fixed_to_int (y1);
+ x2 = x1 + 1;
+ y2 = y1 + 1;
+
+ if (repeat_mode != PIXMAN_REPEAT_NONE)
+ {
+ repeat (repeat_mode, &x1, width);
+ repeat (repeat_mode, &y1, height);
+ repeat (repeat_mode, &x2, width);
+ repeat (repeat_mode, &y2, height);
+
+ get_pixel (image, x1, y1, FALSE, &tl);
+ get_pixel (image, x2, y1, FALSE, &tr);
+ get_pixel (image, x1, y2, FALSE, &bl);
+ get_pixel (image, x2, y2, FALSE, &br);
+ }
+ else
+ {
+ get_pixel (image, x1, y1, TRUE, &tl);
+ get_pixel (image, x2, y1, TRUE, &tr);
+ get_pixel (image, x1, y2, TRUE, &bl);
+ get_pixel (image, x2, y2, TRUE, &br);
+ }
+
+ *ret = bilinear_interpolation_float (tl, tr, bl, br, distx, disty);
+}
+
+static force_inline void accum_32(int *satot, int *srtot,
+ int *sgtot, int *sbtot,
+ const void *p, pixman_fixed_t f)
+{
+ uint32_t pixel = *(uint32_t *)p;
+
+ *srtot += (int)RED_8 (pixel) * f;
+ *sgtot += (int)GREEN_8 (pixel) * f;
+ *sbtot += (int)BLUE_8 (pixel) * f;
+ *satot += (int)ALPHA_8 (pixel) * f;
+}
+
+static force_inline void reduce_32(int satot, int srtot,
+ int sgtot, int sbtot, void *p)
+{
+ uint32_t *ret = p;
+
+ satot = (satot + 0x8000) >> 16;
+ srtot = (srtot + 0x8000) >> 16;
+ sgtot = (sgtot + 0x8000) >> 16;
+ sbtot = (sbtot + 0x8000) >> 16;
+
+ satot = CLIP (satot, 0, 0xff);
+ srtot = CLIP (srtot, 0, 0xff);
+ sgtot = CLIP (sgtot, 0, 0xff);
+ sbtot = CLIP (sbtot, 0, 0xff);
+
+ *ret = ((satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot));
+}
+
+static force_inline void accum_float(int *satot, int *srtot,
+ int *sgtot, int *sbtot,
+ const void *p, pixman_fixed_t f)
+{
+ const argb_t *pixel = p;
+
+ *satot += pixel->a * f;
+ *srtot += pixel->r * f;
+ *sgtot += pixel->g * f;
+ *sbtot += pixel->b * f;
+}
+
+static force_inline void reduce_float(int satot, int srtot,
+ int sgtot, int sbtot,
+ void *p)
+{
+ argb_t *ret = p;
+
+ ret->a = CLIP (satot / 65536.f, 0.f, 1.f);
+ ret->r = CLIP (srtot / 65536.f, 0.f, 1.f);
+ ret->g = CLIP (sgtot / 65536.f, 0.f, 1.f);
+ ret->b = CLIP (sbtot / 65536.f, 0.f, 1.f);
+}
+
+typedef void (* accumulate_pixel_t) (int *satot, int *srtot,
+ int *sgtot, int *sbtot,
+ const void *pixel, pixman_fixed_t f);
+
+typedef void (* reduce_pixel_t) (int satot, int srtot,
+ int sgtot, int sbtot, void *out);
+
+static force_inline void
bits_image_fetch_pixel_convolution (bits_image_t *image,
pixman_fixed_t x,
pixman_fixed_t y,
- get_pixel_t get_pixel)
+ get_pixel_t get_pixel,
+ void *out,
+ accumulate_pixel_t accum,
+ reduce_pixel_t reduce)
{
pixman_fixed_t *params = image->common.filter_params;
int x_off = (params[0] - pixman_fixed_1) >> 1;
@@ -174,48 +291,39 @@ bits_image_fetch_pixel_convolution (bits_image_t *image,
if (f)
{
- uint32_t pixel;
+ /* Must be big enough to hold a argb_t */
+ argb_t pixel;
if (repeat_mode != PIXMAN_REPEAT_NONE)
{
repeat (repeat_mode, &rx, width);
repeat (repeat_mode, &ry, height);
- pixel = get_pixel (image, rx, ry, FALSE);
+ get_pixel (image, rx, ry, FALSE, &pixel);
}
else
{
- pixel = get_pixel (image, rx, ry, TRUE);
+ get_pixel (image, rx, ry, TRUE, &pixel);
}
- srtot += (int)RED_8 (pixel) * f;
- sgtot += (int)GREEN_8 (pixel) * f;
- sbtot += (int)BLUE_8 (pixel) * f;
- satot += (int)ALPHA_8 (pixel) * f;
+ accum (&satot, &srtot, &sgtot, &sbtot, &pixel, f);
}
params++;
}
}
- satot = (satot + 0x8000) >> 16;
- srtot = (srtot + 0x8000) >> 16;
- sgtot = (sgtot + 0x8000) >> 16;
- sbtot = (sbtot + 0x8000) >> 16;
-
- satot = CLIP (satot, 0, 0xff);
- srtot = CLIP (srtot, 0, 0xff);
- sgtot = CLIP (sgtot, 0, 0xff);
- sbtot = CLIP (sbtot, 0, 0xff);
-
- return ((satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot));
+ reduce (satot, srtot, sgtot, sbtot, out);
}
-static uint32_t
-bits_image_fetch_pixel_separable_convolution (bits_image_t *image,
- pixman_fixed_t x,
- pixman_fixed_t y,
- get_pixel_t get_pixel)
+static void
+bits_image_fetch_pixel_separable_convolution (bits_image_t *image,
+ pixman_fixed_t x,
+ pixman_fixed_t y,
+ get_pixel_t get_pixel,
+ void *out,
+ accumulate_pixel_t accum,
+ reduce_pixel_t reduce)
{
pixman_fixed_t *params = image->common.filter_params;
pixman_repeat_t repeat_mode = image->common.repeat;
@@ -270,82 +378,91 @@ bits_image_fetch_pixel_separable_convolution (bits_image_t *image,
if (fx)
{
+ /* Must be big enough to hold a argb_t */
+ argb_t pixel;
pixman_fixed_t f;
- uint32_t pixel;
if (repeat_mode != PIXMAN_REPEAT_NONE)
{
repeat (repeat_mode, &rx, width);
repeat (repeat_mode, &ry, height);
- pixel = get_pixel (image, rx, ry, FALSE);
+ get_pixel (image, rx, ry, FALSE, &pixel);
}
else
{
- pixel = get_pixel (image, rx, ry, TRUE);
+ get_pixel (image, rx, ry, TRUE, &pixel);
}
f = (fy * fx + 0x8000) >> 16;
- srtot += (int)RED_8 (pixel) * f;
- sgtot += (int)GREEN_8 (pixel) * f;
- sbtot += (int)BLUE_8 (pixel) * f;
- satot += (int)ALPHA_8 (pixel) * f;
+ accum(&satot, &srtot, &sgtot, &sbtot, &pixel, f);
}
}
}
}
- satot = (satot + 0x8000) >> 16;
- srtot = (srtot + 0x8000) >> 16;
- sgtot = (sgtot + 0x8000) >> 16;
- sbtot = (sbtot + 0x8000) >> 16;
- satot = CLIP (satot, 0, 0xff);
- srtot = CLIP (srtot, 0, 0xff);
- sgtot = CLIP (sgtot, 0, 0xff);
- sbtot = CLIP (sbtot, 0, 0xff);
-
- return ((satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot));
+ reduce(satot, srtot, sgtot, sbtot, out);
}
-static force_inline uint32_t
-bits_image_fetch_pixel_filtered (bits_image_t *image,
+static force_inline void
+bits_image_fetch_pixel_filtered (bits_image_t *image,
+ pixman_bool_t wide,
pixman_fixed_t x,
pixman_fixed_t y,
- get_pixel_t get_pixel)
+ get_pixel_t get_pixel,
+ void *out)
{
switch (image->common.filter)
{
case PIXMAN_FILTER_NEAREST:
case PIXMAN_FILTER_FAST:
- return bits_image_fetch_pixel_nearest (image, x, y, get_pixel);
+ bits_image_fetch_pixel_nearest (image, x, y, get_pixel, out);
break;
case PIXMAN_FILTER_BILINEAR:
case PIXMAN_FILTER_GOOD:
case PIXMAN_FILTER_BEST:
- return bits_image_fetch_pixel_bilinear (image, x, y, get_pixel);
+ if (wide)
+ bits_image_fetch_pixel_bilinear_float (image, x, y, get_pixel, out);
+ else
+ bits_image_fetch_pixel_bilinear_32 (image, x, y, get_pixel, out);
break;
case PIXMAN_FILTER_CONVOLUTION:
- return bits_image_fetch_pixel_convolution (image, x, y, get_pixel);
+ if (wide)
+ bits_image_fetch_pixel_convolution (image, x, y,
+ get_pixel, out,
+ accum_float,
+ reduce_float);
+ else
+ bits_image_fetch_pixel_convolution (image, x, y,
+ get_pixel, out,
+ accum_32, reduce_32);
break;
case PIXMAN_FILTER_SEPARABLE_CONVOLUTION:
- return bits_image_fetch_pixel_separable_convolution (image, x, y, get_pixel);
+ if (wide)
+ bits_image_fetch_pixel_separable_convolution (image, x, y,
+ get_pixel, out,
+ accum_float,
+ reduce_float);
+ else
+ bits_image_fetch_pixel_separable_convolution (image, x, y,
+ get_pixel, out,
+ accum_32, reduce_32);
break;
default:
break;
}
-
- return 0;
}
static uint32_t *
-bits_image_fetch_affine_no_alpha (pixman_iter_t * iter,
- const uint32_t * mask)
+__bits_image_fetch_affine_no_alpha (pixman_iter_t * iter,
+ pixman_bool_t wide,
+ const uint32_t * mask)
{
pixman_image_t *image = iter->image;
int offset = iter->x;
@@ -357,6 +474,8 @@ bits_image_fetch_affine_no_alpha (pixman_iter_t * iter,
pixman_fixed_t ux, uy;
pixman_vector_t v;
int i;
+ get_pixel_t get_pixel =
+ wide ? fetch_pixel_no_alpha_float : fetch_pixel_no_alpha_32;
/* reference point is the center of the pixel */
v.vector[0] = pixman_int_to_fixed (offset) + pixman_fixed_1 / 2;
@@ -384,27 +503,45 @@ bits_image_fetch_affine_no_alpha (pixman_iter_t * iter,
{
if (!mask || mask[i])
{
- buffer[i] = bits_image_fetch_pixel_filtered (
- &image->bits, x, y, fetch_pixel_no_alpha);
+ bits_image_fetch_pixel_filtered (
+ &image->bits, wide, x, y, get_pixel, buffer);
}
x += ux;
y += uy;
+ buffer += wide ? 4 : 1;
}
- return buffer;
+ return iter->buffer;
+}
+
+static uint32_t *
+bits_image_fetch_affine_no_alpha_32 (pixman_iter_t *iter,
+ const uint32_t *mask)
+{
+ return __bits_image_fetch_affine_no_alpha(iter, FALSE, mask);
+}
+
+static uint32_t *
+bits_image_fetch_affine_no_alpha_float (pixman_iter_t *iter,
+ const uint32_t *mask)
+{
+ return __bits_image_fetch_affine_no_alpha(iter, TRUE, mask);
}
/* General fetcher */
-static force_inline uint32_t
-fetch_pixel_general (bits_image_t *image, int x, int y, pixman_bool_t check_bounds)
+static force_inline void
+fetch_pixel_general_32 (bits_image_t *image,
+ int x, int y, pixman_bool_t check_bounds,
+ void *out)
{
- uint32_t pixel;
+ uint32_t pixel, *ret = out;
if (check_bounds &&
(x < 0 || x >= image->width || y < 0 || y >= image->height))
{
- return 0;
+ *ret = 0;
+ return;
}
pixel = image->fetch_pixel_32 (image, x, y);
@@ -433,18 +570,59 @@ fetch_pixel_general (bits_image_t *image, int x, int y, pixman_bool_t check_boun
pixel |= (pixel_a << 24);
}
- return pixel;
+ *ret = pixel;
+}
+
+static force_inline void
+fetch_pixel_general_float (bits_image_t *image,
+ int x, int y, pixman_bool_t check_bounds,
+ void *out)
+{
+ argb_t *ret = out;
+
+ if (check_bounds &&
+ (x < 0 || x >= image->width || y < 0 || y >= image->height))
+ {
+ ret->a = ret->r = ret->g = ret->b = 0;
+ return;
+ }
+
+ *ret = image->fetch_pixel_float (image, x, y);
+
+ if (image->common.alpha_map)
+ {
+ x -= image->common.alpha_origin_x;
+ y -= image->common.alpha_origin_y;
+
+ if (x < 0 || x >= image->common.alpha_map->width ||
+ y < 0 || y >= image->common.alpha_map->height)
+ {
+ ret->a = 0.f;
+ }
+ else
+ {
+ argb_t alpha;
+
+ alpha = image->common.alpha_map->fetch_pixel_float (
+ image->common.alpha_map, x, y);
+
+ ret->a = alpha.a;
+ }
+ }
}
static uint32_t *
-bits_image_fetch_general (pixman_iter_t *iter,
- const uint32_t *mask)
+__bits_image_fetch_general (pixman_iter_t *iter,
+ pixman_bool_t wide,
+ const uint32_t *mask)
{
pixman_image_t *image = iter->image;
int offset = iter->x;
int line = iter->y++;
int width = iter->width;
uint32_t * buffer = iter->buffer;
+ get_pixel_t get_pixel =
+ wide ? fetch_pixel_general_float : fetch_pixel_general_32;
pixman_fixed_t x, y, w;
pixman_fixed_t ux, uy, uw;
@@ -493,16 +671,31 @@ bits_image_fetch_general (pixman_iter_t *iter,
y0 = 0;
}
- buffer[i] = bits_image_fetch_pixel_filtered (
- &image->bits, x0, y0, fetch_pixel_general);
+ bits_image_fetch_pixel_filtered (
+ &image->bits, wide, x0, y0, get_pixel, buffer);
}
x += ux;
y += uy;
w += uw;
+ buffer += wide ? 4 : 1;
}
- return buffer;
+ return iter->buffer;
+}
+
+static uint32_t *
+bits_image_fetch_general_32 (pixman_iter_t *iter,
+ const uint32_t *mask)
+{
+ return __bits_image_fetch_general(iter, FALSE, mask);
+}
+
+static uint32_t *
+bits_image_fetch_general_float (pixman_iter_t *iter,
+ const uint32_t *mask)
+{
+ return __bits_image_fetch_general(iter, TRUE, mask);
}
static void
@@ -703,15 +896,15 @@ static const fetcher_info_t fetcher_info[] =
/* Affine, no alpha */
{ PIXMAN_any,
(FAST_PATH_NO_ALPHA_MAP | FAST_PATH_HAS_TRANSFORM | FAST_PATH_AFFINE_TRANSFORM),
- bits_image_fetch_affine_no_alpha,
- _pixman_image_get_scanline_generic_float
+ bits_image_fetch_affine_no_alpha_32,
+ bits_image_fetch_affine_no_alpha_float,
},
/* General */
{ PIXMAN_any,
0,
- bits_image_fetch_general,
- _pixman_image_get_scanline_generic_float
+ bits_image_fetch_general_32,
+ bits_image_fetch_general_float,
},
{ PIXMAN_null },
@@ -741,7 +934,6 @@ _pixman_bits_image_src_iter_init (pixman_image_t *image, pixman_iter_t *iter)
}
else
{
- iter->data = info->get_scanline_32;
iter->get_scanline = info->get_scanline_float;
}
return;
diff --git a/Build/source/libs/pixman/pixman-src/pixman/pixman-conical-gradient.c b/Build/source/libs/pixman/pixman-src/pixman/pixman-conical-gradient.c
index 8bb46aecdca..a39e20c4eb6 100644
--- a/Build/source/libs/pixman/pixman-src/pixman/pixman-conical-gradient.c
+++ b/Build/source/libs/pixman/pixman-src/pixman/pixman-conical-gradient.c
@@ -51,7 +51,10 @@ coordinates_to_parameter (double x, double y, double angle)
}
static uint32_t *
-conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
+conical_get_scanline (pixman_iter_t *iter,
+ const uint32_t *mask,
+ int Bpp,
+ pixman_gradient_walker_write_t write_pixel)
{
pixman_image_t *image = iter->image;
int x = iter->x;
@@ -61,7 +64,7 @@ conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
gradient_t *gradient = (gradient_t *)image;
conical_gradient_t *conical = (conical_gradient_t *)image;
- uint32_t *end = buffer + width;
+ uint32_t *end = buffer + width * (Bpp / 4);
pixman_gradient_walker_t walker;
pixman_bool_t affine = TRUE;
double cx = 1.;
@@ -109,11 +112,12 @@ conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
{
double t = coordinates_to_parameter (rx, ry, conical->angle);
- *buffer = _pixman_gradient_walker_pixel (
- &walker, (pixman_fixed_48_16_t)pixman_double_to_fixed (t));
+ write_pixel (&walker,
+ (pixman_fixed_48_16_t)pixman_double_to_fixed (t),
+ buffer);
}
- ++buffer;
+ buffer += (Bpp / 4);
rx += cx;
ry += cy;
@@ -144,11 +148,12 @@ conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
t = coordinates_to_parameter (x, y, conical->angle);
- *buffer = _pixman_gradient_walker_pixel (
- &walker, (pixman_fixed_48_16_t)pixman_double_to_fixed (t));
+ write_pixel (&walker,
+ (pixman_fixed_48_16_t)pixman_double_to_fixed (t),
+ buffer);
}
- ++buffer;
+ buffer += (Bpp / 4);
rx += cx;
ry += cy;
@@ -161,14 +166,17 @@ conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
}
static uint32_t *
-conical_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
+conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
{
- uint32_t *buffer = conical_get_scanline_narrow (iter, NULL);
-
- pixman_expand_to_float (
- (argb_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
+ return conical_get_scanline (iter, mask, 4,
+ _pixman_gradient_walker_write_narrow);
+}
- return buffer;
+static uint32_t *
+conical_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
+{
+ return conical_get_scanline (iter, NULL, 16,
+ _pixman_gradient_walker_write_wide);
}
void
diff --git a/Build/source/libs/pixman/pixman-src/pixman/pixman-gradient-walker.c b/Build/source/libs/pixman/pixman-src/pixman/pixman-gradient-walker.c
index 822f8e62bae..af4df586bc0 100644
--- a/Build/source/libs/pixman/pixman-src/pixman/pixman-gradient-walker.c
+++ b/Build/source/libs/pixman/pixman-src/pixman/pixman-gradient-walker.c
@@ -122,10 +122,9 @@ gradient_walker_reset (pixman_gradient_walker_t *walker,
left_c = right_c;
}
- /* The alpha channel is scaled to be in the [0, 255] interval,
- * and the red/green/blue channels are scaled to be in [0, 1].
+ /* The alpha/red/green/blue channels are scaled to be in [0, 1].
* This ensures that after premultiplication all channels will
- * be in the [0, 255] interval.
+ * be in the [0, 1] interval.
*/
la = (left_c->alpha * (1.0f/257.0f));
lr = (left_c->red * (1.0f/257.0f));
@@ -143,7 +142,7 @@ gradient_walker_reset (pixman_gradient_walker_t *walker,
if (FLOAT_IS_ZERO (rx - lx) || left_x == INT32_MIN || right_x == INT32_MAX)
{
walker->a_s = walker->r_s = walker->g_s = walker->b_s = 0.0f;
- walker->a_b = (la + ra) / 2.0f;
+ walker->a_b = (la + ra) / 510.0f;
walker->r_b = (lr + rr) / 510.0f;
walker->g_b = (lg + rg) / 510.0f;
walker->b_b = (lb + rb) / 510.0f;
@@ -152,12 +151,12 @@ gradient_walker_reset (pixman_gradient_walker_t *walker,
{
float w_rec = 1.0f / (rx - lx);
- walker->a_b = (la * rx - ra * lx) * w_rec;
+ walker->a_b = (la * rx - ra * lx) * w_rec * (1.0f/255.0f);
walker->r_b = (lr * rx - rr * lx) * w_rec * (1.0f/255.0f);
walker->g_b = (lg * rx - rg * lx) * w_rec * (1.0f/255.0f);
walker->b_b = (lb * rx - rb * lx) * w_rec * (1.0f/255.0f);
- walker->a_s = (ra - la) * w_rec;
+ walker->a_s = (ra - la) * w_rec * (1.0f/255.0f);
walker->r_s = (rr - lr) * w_rec * (1.0f/255.0f);
walker->g_s = (rg - lg) * w_rec * (1.0f/255.0f);
walker->b_s = (rb - lb) * w_rec * (1.0f/255.0f);
@@ -169,34 +168,97 @@ gradient_walker_reset (pixman_gradient_walker_t *walker,
walker->need_reset = FALSE;
}
-uint32_t
-_pixman_gradient_walker_pixel (pixman_gradient_walker_t *walker,
- pixman_fixed_48_16_t x)
+static argb_t
+pixman_gradient_walker_pixel_float (pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x)
{
- float a, r, g, b;
- uint8_t a8, r8, g8, b8;
- uint32_t v;
+ argb_t f;
float y;
if (walker->need_reset || x < walker->left_x || x >= walker->right_x)
- gradient_walker_reset (walker, x);
+ gradient_walker_reset (walker, x);
y = x * (1.0f / 65536.0f);
- a = walker->a_s * y + walker->a_b;
- r = a * (walker->r_s * y + walker->r_b);
- g = a * (walker->g_s * y + walker->g_b);
- b = a * (walker->b_s * y + walker->b_b);
+ f.a = walker->a_s * y + walker->a_b;
+ f.r = f.a * (walker->r_s * y + walker->r_b);
+ f.g = f.a * (walker->g_s * y + walker->g_b);
+ f.b = f.a * (walker->b_s * y + walker->b_b);
- a8 = a + 0.5f;
- r8 = r + 0.5f;
- g8 = g + 0.5f;
- b8 = b + 0.5f;
+ return f;
+}
+
+static uint32_t
+pixman_gradient_walker_pixel_32 (pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x)
+{
+ argb_t f;
+ float y;
+
+ if (walker->need_reset || x < walker->left_x || x >= walker->right_x)
+ gradient_walker_reset (walker, x);
+
+ y = x * (1.0f / 65536.0f);
+
+ /* Instead of [0...1] for ARGB, we want [0...255],
+ * multiply alpha with 255 and the color channels
+ * also get multiplied by the alpha multiplier.
+ *
+ * We don't use pixman_contract_from_float because it causes a 2x
+ * slowdown to do so, and the values are already normalized,
+ * so we don't have to worry about values < 0.f or > 1.f
+ */
+ f.a = 255.f * (walker->a_s * y + walker->a_b);
+ f.r = f.a * (walker->r_s * y + walker->r_b);
+ f.g = f.a * (walker->g_s * y + walker->g_b);
+ f.b = f.a * (walker->b_s * y + walker->b_b);
- v = ((a8 << 24) & 0xff000000) |
- ((r8 << 16) & 0x00ff0000) |
- ((g8 << 8) & 0x0000ff00) |
- ((b8 >> 0) & 0x000000ff);
+ return (((uint8_t)(f.a + .5f) << 24) & 0xff000000) |
+ (((uint8_t)(f.r + .5f) << 16) & 0x00ff0000) |
+ (((uint8_t)(f.g + .5f) << 8) & 0x0000ff00) |
+ (((uint8_t)(f.b + .5f) >> 0) & 0x000000ff);
+}
+
+void
+_pixman_gradient_walker_write_narrow (pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer)
+{
+ *buffer = pixman_gradient_walker_pixel_32 (walker, x);
+}
+
+void
+_pixman_gradient_walker_write_wide (pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer)
+{
+ *(argb_t *)buffer = pixman_gradient_walker_pixel_float (walker, x);
+}
+
+void
+_pixman_gradient_walker_fill_narrow (pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer,
+ uint32_t *end)
+{
+ register uint32_t color;
+
+ color = pixman_gradient_walker_pixel_32 (walker, x);
+ while (buffer < end)
+ *buffer++ = color;
+}
+
+void
+_pixman_gradient_walker_fill_wide (pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer,
+ uint32_t *end)
+{
+ register argb_t color;
+ argb_t *buffer_wide = (argb_t *)buffer;
+ argb_t *end_wide = (argb_t *)end;
- return v;
+ color = pixman_gradient_walker_pixel_float (walker, x);
+ while (buffer_wide < end_wide)
+ *buffer_wide++ = color;
}
diff --git a/Build/source/libs/pixman/pixman-src/pixman/pixman-inlines.h b/Build/source/libs/pixman/pixman-src/pixman/pixman-inlines.h
index 1c8441d6dab..332e208140a 100644
--- a/Build/source/libs/pixman/pixman-src/pixman/pixman-inlines.h
+++ b/Build/source/libs/pixman/pixman-src/pixman/pixman-inlines.h
@@ -222,6 +222,31 @@ bilinear_interpolation (uint32_t tl, uint32_t tr,
#endif
#endif // BILINEAR_INTERPOLATION_BITS <= 4
+static force_inline argb_t
+bilinear_interpolation_float (argb_t tl, argb_t tr,
+ argb_t bl, argb_t br,
+ float distx, float disty)
+{
+ float distxy, distxiy, distixy, distixiy;
+ argb_t r;
+
+ distxy = distx * disty;
+ distxiy = distx - (1.f - distxy);
+ distixy = (1.f - distx) * disty;
+ distixiy = (1.f - distx) * (1.f - disty);
+
+ r.a = tl.a * distixiy + tr.a * distxiy +
+ bl.a * distixy + br.a * distxy;
+ r.r = tl.r * distixiy + tr.r * distxiy +
+ bl.r * distixy + br.r * distxy;
+ r.g = tl.g * distixiy + tr.g * distxiy +
+ bl.g * distixy + br.g * distxy;
+ r.b = tl.b * distixiy + tr.b * distxiy +
+ bl.b * distixy + br.b * distxy;
+
+ return r;
+}
+
/*
* For each scanline fetched from source image with PAD repeat:
* - calculate how many pixels need to be padded on the left side
diff --git a/Build/source/libs/pixman/pixman-src/pixman/pixman-linear-gradient.c b/Build/source/libs/pixman/pixman-src/pixman/pixman-linear-gradient.c
index 40c8c9f37db..3f528508a18 100644
--- a/Build/source/libs/pixman/pixman-src/pixman/pixman-linear-gradient.c
+++ b/Build/source/libs/pixman/pixman-src/pixman/pixman-linear-gradient.c
@@ -89,8 +89,11 @@ linear_gradient_is_horizontal (pixman_image_t *image,
}
static uint32_t *
-linear_get_scanline_narrow (pixman_iter_t *iter,
- const uint32_t *mask)
+linear_get_scanline (pixman_iter_t *iter,
+ const uint32_t *mask,
+ int Bpp,
+ pixman_gradient_walker_write_t write_pixel,
+ pixman_gradient_walker_fill_t fill_pixel)
{
pixman_image_t *image = iter->image;
int x = iter->x;
@@ -103,7 +106,7 @@ linear_get_scanline_narrow (pixman_iter_t *iter,
pixman_fixed_48_16_t dx, dy;
gradient_t *gradient = (gradient_t *)image;
linear_gradient_t *linear = (linear_gradient_t *)image;
- uint32_t *end = buffer + width;
+ uint32_t *end = buffer + width * (Bpp / 4);
pixman_gradient_walker_t walker;
_pixman_gradient_walker_init (&walker, gradient, image->common.repeat);
@@ -137,7 +140,7 @@ linear_get_scanline_narrow (pixman_iter_t *iter,
if (l == 0 || unit.vector[2] == 0)
{
/* affine transformation only */
- pixman_fixed_32_32_t t, next_inc;
+ pixman_fixed_32_32_t t, next_inc;
double inc;
if (l == 0 || v.vector[2] == 0)
@@ -152,7 +155,7 @@ linear_get_scanline_narrow (pixman_iter_t *iter,
invden = pixman_fixed_1 * (double) pixman_fixed_1 /
(l * (double) v.vector[2]);
v2 = v.vector[2] * (1. / pixman_fixed_1);
- t = ((dx * v.vector[0] + dy * v.vector[1]) -
+ t = ((dx * v.vector[0] + dy * v.vector[1]) -
(dx * linear->p1.x + dy * linear->p1.y) * v2) * invden;
inc = (dx * unit.vector[0] + dy * unit.vector[1]) * invden;
}
@@ -160,11 +163,7 @@ linear_get_scanline_narrow (pixman_iter_t *iter,
if (((pixman_fixed_32_32_t )(inc * width)) == 0)
{
- register uint32_t color;
-
- color = _pixman_gradient_walker_pixel (&walker, t);
- while (buffer < end)
- *buffer++ = color;
+ fill_pixel (&walker, t, buffer, end);
}
else
{
@@ -175,12 +174,11 @@ linear_get_scanline_narrow (pixman_iter_t *iter,
{
if (!mask || *mask++)
{
- *buffer = _pixman_gradient_walker_pixel (&walker,
- t + next_inc);
+ write_pixel (&walker, t + next_inc, buffer);
}
i++;
next_inc = inc * i;
- buffer++;
+ buffer += (Bpp / 4);
}
}
}
@@ -202,14 +200,14 @@ linear_get_scanline_narrow (pixman_iter_t *iter,
invden = pixman_fixed_1 * (double) pixman_fixed_1 /
(l * (double) v.vector[2]);
v2 = v.vector[2] * (1. / pixman_fixed_1);
- t = ((dx * v.vector[0] + dy * v.vector[1]) -
+ t = ((dx * v.vector[0] + dy * v.vector[1]) -
(dx * linear->p1.x + dy * linear->p1.y) * v2) * invden;
}
- *buffer = _pixman_gradient_walker_pixel (&walker, t);
+ write_pixel (&walker, t, buffer);
}
- ++buffer;
+ buffer += (Bpp / 4);
v.vector[0] += unit.vector[0];
v.vector[1] += unit.vector[1];
@@ -223,14 +221,21 @@ linear_get_scanline_narrow (pixman_iter_t *iter,
}
static uint32_t *
-linear_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
+linear_get_scanline_narrow (pixman_iter_t *iter,
+ const uint32_t *mask)
{
- uint32_t *buffer = linear_get_scanline_narrow (iter, NULL);
+ return linear_get_scanline (iter, mask, 4,
+ _pixman_gradient_walker_write_narrow,
+ _pixman_gradient_walker_fill_narrow);
+}
- pixman_expand_to_float (
- (argb_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
- return buffer;
+static uint32_t *
+linear_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
+{
+ return linear_get_scanline (iter, NULL, 16,
+ _pixman_gradient_walker_write_wide,
+ _pixman_gradient_walker_fill_wide);
}
void
diff --git a/Build/source/libs/pixman/pixman-src/pixman/pixman-private.h b/Build/source/libs/pixman/pixman-src/pixman/pixman-private.h
index 73a54146ddb..1bd969591b3 100644
--- a/Build/source/libs/pixman/pixman-src/pixman/pixman-private.h
+++ b/Build/source/libs/pixman/pixman-src/pixman/pixman-private.h
@@ -363,9 +363,38 @@ void
_pixman_gradient_walker_reset (pixman_gradient_walker_t *walker,
pixman_fixed_48_16_t pos);
-uint32_t
-_pixman_gradient_walker_pixel (pixman_gradient_walker_t *walker,
- pixman_fixed_48_16_t x);
+typedef void (*pixman_gradient_walker_write_t) (
+ pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer);
+
+void
+_pixman_gradient_walker_write_narrow(pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer);
+
+void
+_pixman_gradient_walker_write_wide(pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer);
+
+typedef void (*pixman_gradient_walker_fill_t) (
+ pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer,
+ uint32_t *end);
+
+void
+_pixman_gradient_walker_fill_narrow(pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer,
+ uint32_t *end);
+
+void
+_pixman_gradient_walker_fill_wide(pixman_gradient_walker_t *walker,
+ pixman_fixed_48_16_t x,
+ uint32_t *buffer,
+ uint32_t *end);
/*
* Edges
diff --git a/Build/source/libs/pixman/pixman-src/pixman/pixman-radial-gradient.c b/Build/source/libs/pixman/pixman-src/pixman/pixman-radial-gradient.c
index 6a217963da1..0367d78424d 100644
--- a/Build/source/libs/pixman/pixman-src/pixman/pixman-radial-gradient.c
+++ b/Build/source/libs/pixman/pixman-src/pixman/pixman-radial-gradient.c
@@ -66,15 +66,18 @@ fdot (double x1,
return x1 * x2 + y1 * y2 + z1 * z2;
}
-static uint32_t
-radial_compute_color (double a,
- double b,
- double c,
- double inva,
- double dr,
- double mindr,
- pixman_gradient_walker_t *walker,
- pixman_repeat_t repeat)
+static void
+radial_write_color (double a,
+ double b,
+ double c,
+ double inva,
+ double dr,
+ double mindr,
+ pixman_gradient_walker_t *walker,
+ pixman_repeat_t repeat,
+ int Bpp,
+ pixman_gradient_walker_write_t write_pixel,
+ uint32_t *buffer)
{
/*
* In this function error propagation can lead to bad results:
@@ -99,21 +102,25 @@ radial_compute_color (double a,
double t;
if (b == 0)
- return 0;
+ {
+ memset (buffer, 0, Bpp);
+ return;
+ }
t = pixman_fixed_1 / 2 * c / b;
if (repeat == PIXMAN_REPEAT_NONE)
{
if (0 <= t && t <= pixman_fixed_1)
- return _pixman_gradient_walker_pixel (walker, t);
+ return write_pixel (walker, t, buffer);
}
else
{
if (t * dr >= mindr)
- return _pixman_gradient_walker_pixel (walker, t);
+ return write_pixel (walker, t, buffer);
}
- return 0;
+ memset (buffer, 0, Bpp);
+ return;
}
discr = fdot (b, a, 0, b, -c, 0);
@@ -139,24 +146,28 @@ radial_compute_color (double a,
if (repeat == PIXMAN_REPEAT_NONE)
{
if (0 <= t0 && t0 <= pixman_fixed_1)
- return _pixman_gradient_walker_pixel (walker, t0);
+ return write_pixel (walker, t0, buffer);
else if (0 <= t1 && t1 <= pixman_fixed_1)
- return _pixman_gradient_walker_pixel (walker, t1);
+ return write_pixel (walker, t1, buffer);
}
else
{
if (t0 * dr >= mindr)
- return _pixman_gradient_walker_pixel (walker, t0);
+ return write_pixel (walker, t0, buffer);
else if (t1 * dr >= mindr)
- return _pixman_gradient_walker_pixel (walker, t1);
+ return write_pixel (walker, t1, buffer);
}
}
- return 0;
+ memset (buffer, 0, Bpp);
+ return;
}
static uint32_t *
-radial_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
+radial_get_scanline (pixman_iter_t *iter,
+ const uint32_t *mask,
+ int Bpp,
+ pixman_gradient_walker_write_t write_pixel)
{
/*
* Implementation of radial gradients following the PDF specification.
@@ -247,7 +258,7 @@ radial_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
gradient_t *gradient = (gradient_t *)image;
radial_gradient_t *radial = (radial_gradient_t *)image;
- uint32_t *end = buffer + width;
+ uint32_t *end = buffer + width * (Bpp / 4);
pixman_gradient_walker_t walker;
pixman_vector_t v, unit;
@@ -330,18 +341,21 @@ radial_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
{
if (!mask || *mask++)
{
- *buffer = radial_compute_color (radial->a, b, c,
- radial->inva,
- radial->delta.radius,
- radial->mindr,
- &walker,
- image->common.repeat);
+ radial_write_color (radial->a, b, c,
+ radial->inva,
+ radial->delta.radius,
+ radial->mindr,
+ &walker,
+ image->common.repeat,
+ Bpp,
+ write_pixel,
+ buffer);
}
b += db;
c += dc;
dc += ddc;
- ++buffer;
+ buffer += (Bpp / 4);
}
}
else
@@ -375,20 +389,23 @@ radial_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
pdx, pdy, radial->c1.radius);
/* / pixman_fixed_1 / pixman_fixed_1 */
- *buffer = radial_compute_color (radial->a, b, c,
- radial->inva,
- radial->delta.radius,
- radial->mindr,
- &walker,
- image->common.repeat);
+ radial_write_color (radial->a, b, c,
+ radial->inva,
+ radial->delta.radius,
+ radial->mindr,
+ &walker,
+ image->common.repeat,
+ Bpp,
+ write_pixel,
+ buffer);
}
else
{
- *buffer = 0;
+ memset (buffer, 0, Bpp);
}
}
- ++buffer;
+ buffer += (Bpp / 4);
v.vector[0] += unit.vector[0];
v.vector[1] += unit.vector[1];
@@ -401,14 +418,17 @@ radial_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
}
static uint32_t *
-radial_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
+radial_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
{
- uint32_t *buffer = radial_get_scanline_narrow (iter, NULL);
-
- pixman_expand_to_float (
- (argb_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
+ return radial_get_scanline (iter, mask, 4,
+ _pixman_gradient_walker_write_narrow);
+}
- return buffer;
+static uint32_t *
+radial_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
+{
+ return radial_get_scanline (iter, NULL, 16,
+ _pixman_gradient_walker_write_wide);
}
void
@@ -422,11 +442,11 @@ _pixman_radial_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter)
PIXMAN_EXPORT pixman_image_t *
pixman_image_create_radial_gradient (const pixman_point_fixed_t * inner,
- const pixman_point_fixed_t * outer,
- pixman_fixed_t inner_radius,
- pixman_fixed_t outer_radius,
- const pixman_gradient_stop_t *stops,
- int n_stops)
+ const pixman_point_fixed_t * outer,
+ pixman_fixed_t inner_radius,
+ pixman_fixed_t outer_radius,
+ const pixman_gradient_stop_t *stops,
+ int n_stops)
{
pixman_image_t *image;
radial_gradient_t *radial;
diff --git a/Build/source/libs/pixman/version.ac b/Build/source/libs/pixman/version.ac
index 1802e20da3c..09a14edeed6 100644
--- a/Build/source/libs/pixman/version.ac
+++ b/Build/source/libs/pixman/version.ac
@@ -8,4 +8,4 @@ dnl
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current pixman version
-m4_define([pixman_version], [0.36.0])
+m4_define([pixman_version], [0.38.0])