Bug 1689998 - Mozilla-specific build fixups for pixman 0.40.0. r=jrmuizel

Depends on D103684

Differential Revision: https://phabricator.services.mozilla.com/D103685
This commit is contained in:
Jonathan Kew 2021-02-02 14:19:49 +00:00
parent 98c87fa486
commit 1baa2d67ad
5 changed files with 44 additions and 3 deletions

View File

@ -35,7 +35,6 @@ SOURCES += [
'pixman-arm.c',
'pixman-bits-image.c',
'pixman-combine-float.c',
'pixman-combine16.c',
'pixman-combine32.c',
'pixman-conical-gradient.c',
'pixman-edge-accessors.c',
@ -70,8 +69,14 @@ LOCAL_INCLUDES += [
'../../cairo/src',
]
if CONFIG['OS_TARGET'] == 'Android':
# For cpu-features.h
LOCAL_INCLUDES += [
'%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK']
]
if CONFIG['MOZ_USE_PTHREADS']:
DEFINES['HAVE_PTHREAD_SETSPECIFIC'] = True
DEFINES['HAVE_PTHREADS'] = True
DEFINES['PACKAGE'] = 'mozpixman'

View File

@ -89,6 +89,23 @@
# endif
#endif
/* In libxul builds we don't ever want to export pixman symbols */
#if 1
#include "prcpucfg.h"
#ifdef HAVE_VISIBILITY_HIDDEN_ATTRIBUTE
#define CVISIBILITY_HIDDEN __attribute__((visibility("hidden")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#define CVISIBILITY_HIDDEN __hidden
#else
#define CVISIBILITY_HIDDEN
#endif
/* In libxul builds we don't ever want to export cairo symbols */
#define PIXMAN_EXPORT extern CVISIBILITY_HIDDEN
#else
/* GCC visibility */
#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(_WIN32)
# define PIXMAN_EXPORT __attribute__ ((visibility("default")))
@ -101,6 +118,8 @@
# define PIXMAN_EXPORT
#endif
#endif
/* member offsets */
#define CONTAINER_OF(type, member, data) \
((type *)(((uint8_t *)data) - offsetof (type, member)))

View File

@ -5,8 +5,17 @@
* The defines which are shared between C and assembly code
*/
/* bilinear interpolation precision (must be < 8) */
/* bilinear interpolation precision (must be <= 8) */
#ifndef MOZILLA_VERSION
#error "Need mozilla headers"
#endif
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
#define LOW_QUALITY_INTERPOLATION
#define LOWER_QUALITY_INTERPOLATION
#define BILINEAR_INTERPOLATION_BITS 4
#else
#define BILINEAR_INTERPOLATION_BITS 7
#endif
#define BILINEAR_INTERPOLATION_RANGE (1 << BILINEAR_INTERPOLATION_BITS)
/*

View File

@ -109,6 +109,10 @@ have_cpuid (void)
#endif
}
#ifdef _MSC_VER
#include <intrin.h> /* for __cpuid */
#endif
static void
pixman_cpuid (uint32_t feature,
uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)

View File

@ -69,6 +69,10 @@ SOFTWARE.
#ifndef PIXMAN_H__
#define PIXMAN_H__
#ifdef MOZILLA_VERSION
#include "cairo/pixman-rename.h"
#endif
#include <pixman-version.h>
#ifdef __cplusplus