Bug 1800187 - Part 1: Update libpixman to version 0.42.2. r=jfkthame

Depends on D161867

Differential Revision: https://phabricator.services.mozilla.com/D161868
This commit is contained in:
Ryan VanderMeulen 2022-11-14 15:46:33 +00:00
Родитель 67a586f153
Коммит ef9215bccb
21 изменённых файлов: 6680 добавлений и 277 удалений

Просмотреть файл

@ -8,7 +8,7 @@ http://www.cairographics.org/.
VERSIONS:
cairo (12d521df8acc483b2daa844d4f05dc2fe2765ba6)
pixman (0.24.2)
pixman (0.42.2)
==== Patches ====

Просмотреть файл

@ -0,0 +1,42 @@
The following is the MIT license, agreed upon by most contributors.
Copyright holders of new code should use this license statement where
possible. They may also add themselves to the list below.
/*
* Copyright 1987, 1988, 1989, 1998 The Open Group
* Copyright 1987, 1988, 1989 Digital Equipment Corporation
* Copyright 1999, 2004, 2008 Keith Packard
* Copyright 2000 SuSE, Inc.
* Copyright 2000 Keith Packard, member of The XFree86 Project, Inc.
* Copyright 2004, 2005, 2007, 2008, 2009, 2010 Red Hat, Inc.
* Copyright 2004 Nicholas Miell
* Copyright 2005 Lars Knoll & Zack Rusin, Trolltech
* Copyright 2005 Trolltech AS
* Copyright 2007 Luca Barbato
* Copyright 2008 Aaron Plattner, NVIDIA Corporation
* Copyright 2008 Rodrigo Kumpera
* Copyright 2008 André Tupinambá
* Copyright 2008 Mozilla Corporation
* Copyright 2008 Frederic Plourde
* Copyright 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009, 2010 Nokia 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 (including the next
* paragraph) 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.
*/

Просмотреть файл

Просмотреть файл

@ -0,0 +1,140 @@
Pixman
======
Pixman is a library that provides low-level pixel manipulation
features such as image compositing and trapezoid rasterization.
Questions should be directed to the pixman mailing list:
https://lists.freedesktop.org/mailman/listinfo/pixman
You can also file bugs at
https://gitlab.freedesktop.org/pixman/pixman/-/issues/new
or submit improvements in form of a Merge Request via
https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests
For real time discussions about pixman, feel free to join the IRC
channels #cairo and #xorg-devel on the FreeNode IRC network.
Contributing
------------
In order to contribute to pixman, you will need a working knowledge of
the git version control system. For a quick getting started guide,
there is the "Everyday Git With 20 Commands Or So guide"
https://www.kernel.org/pub/software/scm/git/docs/everyday.html
from the Git homepage. For more in depth git documentation, see the
resources on the Git community documentation page:
https://git-scm.com/documentation
Pixman uses the infrastructure from the freedesktop.org umbrella
project. For instructions about how to use the git service on
freedesktop.org, see:
https://www.freedesktop.org/wiki/Infrastructure/git/Developers
The Pixman master repository can be found at:
https://gitlab.freedesktop.org/pixman/pixman
Sending patches
---------------
Patches should be submitted in form of Merge Requests via Gitlab.
You will first need to create a fork of the main pixman repository at
https://gitlab.freedesktop.org/pixman/pixman
via the Fork button on the top right. Once that is done you can add your
personal repository as a remote to your local pixman development git checkout:
git remote add my-gitlab git@gitlab.freedesktop.org:YOURUSERNAME/pixman.git
git fetch my-gitlab
Make sure to have added ssh keys to your gitlab profile at
https://gitlab.freedesktop.org/profile/keys
Once that is set up, the general workflow for sending patches is to create a
new local branch with your improvements and once it's ready push it to your
personal pixman fork:
git checkout -b fix-some-bug
...
git push my-gitlab
The output of the `git push` command will include a link that allows you to
create a Merge Request against the official pixman repository.
Whenever you make changes to your branch (add new commits or fix up commits)
you push them back to your personal pixman fork:
git push -f my-gitlab
If there is an open Merge Request Gitlab will automatically pick up the
changes from your branch and pixman developers can review them anew.
In order for your patches to be accepted, please consider the
following guidelines:
- At each point in the series, pixman should compile and the test
suite should pass.
The exception here is if you are changing the test suite to
demonstrate a bug. In this case, make one commit that makes the
test suite fail due to the bug, and then another commit that fixes
the bug.
You can run the test suite with
make check
if you built pixman with autotools or
meson test -C builddir
if you built pixman with meson.
It will take around two minutes to run on a modern PC.
- Follow the coding style described in the CODING_STYLE file
- For bug fixes, include an update to the test suite to make sure
the bug doesn't reappear.
- For new features, add tests of the feature to the test
suite. Also, add a program demonstrating the new feature to the
demos/ directory.
- Write descriptive commit messages. Useful information to include:
- Benchmark results, before and after
- Description of the bug that was fixed
- Detailed rationale for any new API
- Alternative approaches that were rejected (and why they
don't work)
- If review comments were incorporated, a brief version
history describing what those changes were.
- For big patch series, write an introductory post with an overall
description of the patch series, including benchmarks and
motivation. Each commit message should still be descriptive and
include enough information to understand why this particular commit
was necessary.
Pixman has high standards for code quality and so almost everybody
should expect to have the first versions of their patches rejected.
If you think that the reviewers are wrong about something, or that the
guidelines above are wrong, feel free to discuss the issue. The purpose
of the guidelines and code review is to ensure high code quality; it is
not an exercise in compliance.

Просмотреть файл

@ -1,139 +0,0 @@
- Go through things marked FIXME
- Add calls to prepare and finish access where necessary. grep for
ACCESS_MEM, and make sure they are correctly wrapped in prepare
and finish.
- restore READ/WRITE in the fbcompose combiners since they sometimes
store directly to destination drawables.
- It probably makes sense to move the more strange X region API
into pixman as well, but guarded with PIXMAN_XORG_COMPATIBILITY
- Reinstate the FbBits typedef? At the moment we don't
even have the FbBits type; we just use uint32_t everywhere.
Keith says in bug 2335:
The 64-bit code in fb (pixman) is probably broken; it hasn't been
used in quite some time as PCI (and AGP) is 32-bits wide, so
doing things 64-bits at a time is a net loss. To quickly fix
this, I suggest just using 32-bit datatypes by setting
IC_SHIFT to 5 for all machines.
- Consider whether calling regions region16 is really such a great
idea Vlad wants 32 bit regions for Cairo. This will break X server
ABI, but should otherwise be mostly harmless, though a
pixman_region_get_boxes16() may be useful.
- Make source clipping optional.
- done: source clipping happens through an indirection.
still needs to make the indirection settable. (And call it
from X)
- Consider optimizing the 8/16 bit solid fills in pixman-util.c by
storing more than one value at a time.
- Add an image cache to prevent excessive malloc/free. Note that pixman
needs to be thread safe when used from cairo.
- Review the pixman_format_code_t enum to make sure it will support
future formats. Some formats we will probably need:
ARGB/ABGR with 16/32/64 bit integer/floating channels
YUV2,
YV12
Also we may need the ability to distinguish between PICT_c8 and
PICT_x4c4. (This could be done by interpreting the A channel as
the depth for TYPE_COLOR and TYPE_GRAY formats).
A possibility may be to reserve the two top bits and make them
encode "number of places to shift the channel widths given" Since
these bits are 00 at the moment everything will continue to work,
but these additional widths will be allowed:
All even widths between 18-32
All multiples of four widths between 33 and 64
All multiples of eight between 64 and 128
This means things like r21g22b21 won't work - is that worth
worrying about? I don't think so. And of course the bpp field
can't handle a depth of over 256, so > 64 bit channels arent'
really all that useful.
We could reserve one extra bit to indicate floating point, but
we may also just add
PIXMAN_TYPE_ARGB_FLOAT
PIXMAN_TYPE_BGRA_FLOAT
PIXMAN_TYPE_A_FLOAT
image types. With five bits we can support up to 32 different
format types, which should be enough for everybody, even if we
decide to support all the various video formats here:
http://www.fourcc.org/yuv.php
It may make sense to have a PIXMAN_TYPE_YUV, and then use the
channel bits to specify the exact subtype.
What about color spaces such a linear vs. srGB etc.?
done:
- Run cairo test suite; fix bugs
- one bug in source-scale-clip
- Remove the warning suppression in the ACCESS_MEM macro and fix the
warnings that are real
- irrelevant now.
- make the wrapper functions global instead of image specific
- this won't work since pixman is linked to both fb and wfb
- Add non-mmx solid fill
- Make sure the endian-ness macros are defined correctly.
- The rectangles in a region probably shouldn't be returned const as
the X server will be changing them.
- Right now we _always_ have a clip region, which is empty by default.
Why does this work at all? It probably doesn't. The server
distinguishes two cases, one where nothing is clipped (CT_NONE), and
one where there is a clip region (CT_REGION).
- Default clip region should be the full image
- Test if pseudo color still works. It does, but it also shows that
copying a pixman_indexed_t on every composite operation is not
going to fly. So, for now set_indexed() does not copy the
indexed table.
Also just the malloc() to allocate a pixman image shows up pretty
high.
Options include
- Make all the setters not copy their arguments
- Possibly combined with going back to the stack allocated
approach that we already use for regions.
- Keep a cached pixman_image_t around for every picture. It would
have to be kept uptodate every time something changes about the
picture.
- Break the X server ABI and simply have the relevant parameter
stored in the pixman image. This would have the additional benefits
that:
- We can get rid of the annoying repeat field which is duplicated
elsewhere.
- We can use pixman_color_t and pixman_gradient_stop_t
etc. instead of the types that are defined in
renderproto.h

Просмотреть файл

@ -54,6 +54,8 @@ simds = [
['pixman-arm-simd-asm.S', 'pixman-arm-simd-asm-scaled.S']],
['arm-neon', have_neon, [],
['pixman-arm-neon-asm.S', 'pixman-arm-neon-asm-bilinear.S']],
['arm-neon', have_a64neon, [],
['pixman-arma64-neon-asm.S', 'pixman-arma64-neon-asm-bilinear.S']],
['mips-dspr2', have_mips_dspr2, mips_dspr2_flags,
['pixman-mips-dspr2-asm.S', 'pixman-mips-memcpy-asm.S']],
]
@ -102,19 +104,26 @@ pixman_files = files(
'pixman-utils.c',
)
# We cannot use 'link_with' or 'link_whole' because meson wont do the right
# thing for static archives.
_obs = []
foreach l : pixman_simd_libs
_obs += l.extract_all_objects()
endforeach
# Android cpu-features
cpu_features_path = get_option('cpu-features-path')
cpu_features_sources = []
cpu_features_inc = []
if cpu_features_path != ''
message('Using cpu-features.[ch] from ' + cpu_features_path)
cpu_features_sources = files(
cpu_features_path / 'cpu-features.h',
cpu_features_path / 'cpu-features.c',
)
cpu_features_inc = include_directories(cpu_features_path)
endif
libpixman = library(
'pixman-1',
[pixman_files, config_h, version_h],
objects : _obs,
[pixman_files, config_h, version_h, cpu_features_sources],
link_with: pixman_simd_libs,
c_args : libpixman_extra_cargs,
dependencies : [dep_m, dep_threads],
include_directories : cpu_features_inc,
version : meson.project_version(),
install : true,
)
@ -126,4 +135,8 @@ idep_pixman = declare_dependency(
include_directories : inc_pixman,
)
if meson.version().version_compare('>= 0.54.0')
meson.override_dependency('pixman-1', idep_pixman)
endif
install_headers('pixman.h', subdir : 'pixman-1')

Просмотреть файл

@ -194,7 +194,7 @@ arm_neon_fill (pixman_implementation_t *imp,
uint32_t _xor)
{
/* stride is always multiple of 32bit units in pixman */
uint32_t byte_stride = stride * sizeof(uint32_t);
int32_t byte_stride = stride * sizeof(uint32_t);
switch (bpp)
{
@ -331,6 +331,7 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, a8, b5g6r5, neon_composite_over_8888_8_0565),
PIXMAN_STD_FAST_PATH (OVER, r5g6b5, a8, r5g6b5, neon_composite_over_0565_8_0565),
PIXMAN_STD_FAST_PATH (OVER, b5g6r5, a8, b5g6r5, neon_composite_over_0565_8_0565),
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, x8r8g8b8, neon_composite_over_8888_8888_8888),
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, a8r8g8b8, neon_composite_over_8888_8888_8888),
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, r5g6b5, neon_composite_over_8888_0565),
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, b5g6r5, neon_composite_over_8888_0565),
@ -341,17 +342,33 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
PIXMAN_STD_FAST_PATH (OVER, x8r8g8b8, null, a8r8g8b8, neon_composite_src_x888_8888),
PIXMAN_STD_FAST_PATH (OVER, x8b8g8r8, null, a8b8g8r8, neon_composite_src_x888_8888),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8, neon_composite_add_n_8_8),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, x8r8g8b8, neon_composite_add_n_8_8888),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8r8g8b8, neon_composite_add_n_8_8888),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, x8b8g8r8, neon_composite_add_n_8_8888),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8b8g8r8, neon_composite_add_n_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8, a8, a8, neon_composite_add_8_8_8),
PIXMAN_STD_FAST_PATH (ADD, r5g6b5, a8, r5g6b5, neon_composite_add_0565_8_0565),
PIXMAN_STD_FAST_PATH (ADD, b5g6r5, a8, b5g6r5, neon_composite_add_0565_8_0565),
PIXMAN_STD_FAST_PATH (ADD, x8r8g8b8, a8, x8r8g8b8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8, x8r8g8b8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, x8b8g8r8, a8, x8b8g8r8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, a8, x8b8g8r8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8, a8r8g8b8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, a8, a8b8g8r8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, x8r8g8b8, a8r8g8b8, x8r8g8b8, neon_composite_add_8888_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, x8r8g8b8, neon_composite_add_8888_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, a8r8g8b8, neon_composite_add_8888_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, x8r8g8b8, solid, x8r8g8b8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, solid, x8r8g8b8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, x8b8g8r8, solid, x8b8g8r8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, solid, x8b8g8r8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, solid, a8r8g8b8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, solid, a8b8g8r8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8, null, a8, neon_composite_add_8_8),
PIXMAN_STD_FAST_PATH (ADD, x8r8g8b8, null, x8r8g8b8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, x8r8g8b8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, x8b8g8r8, null, x8b8g8r8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, x8b8g8r8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, a8r8g8b8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, a8b8g8r8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (IN, solid, null, a8, neon_composite_in_n_8),
@ -359,7 +376,9 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
PIXMAN_STD_FAST_PATH (OVER_REVERSE, solid, null, a8b8g8r8, neon_composite_over_reverse_n_8888),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, r5g6b5, neon_composite_out_reverse_8_0565),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, b5g6r5, neon_composite_out_reverse_8_0565),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, x8r8g8b8, neon_composite_out_reverse_8_8888),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, a8r8g8b8, neon_composite_out_reverse_8_8888),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, x8b8g8r8, neon_composite_out_reverse_8_8888),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, a8b8g8r8, neon_composite_out_reverse_8_8888),
SIMPLE_NEAREST_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, neon_8888_8888),
@ -404,6 +423,7 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
SIMPLE_BILINEAR_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, neon_8888_8888),
SIMPLE_BILINEAR_FAST_PATH (ADD, a8r8g8b8, x8r8g8b8, neon_8888_8888),
SIMPLE_BILINEAR_FAST_PATH (ADD, x8r8g8b8, x8r8g8b8, neon_8888_8888),
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, a8r8g8b8, a8r8g8b8, neon_8888_8_8888),
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, a8r8g8b8, x8r8g8b8, neon_8888_8_8888),
@ -420,6 +440,7 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, neon_8888_8_8888),
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, a8r8g8b8, x8r8g8b8, neon_8888_8_8888),
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, x8r8g8b8, x8r8g8b8, neon_8888_8_8888),
{ PIXMAN_OP_NONE },
};

Просмотреть файл

@ -246,5 +246,11 @@ _pixman_arm_get_implementations (pixman_implementation_t *imp)
imp = _pixman_implementation_create_arm_neon (imp);
#endif
#ifdef USE_ARM_A64_NEON
/* neon is a part of aarch64 */
if (!_pixman_disabled ("arm-neon"))
imp = _pixman_implementation_create_arm_neon (imp);
#endif
return imp;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -482,6 +482,7 @@ __bits_image_fetch_affine_no_alpha (pixman_iter_t * iter,
int width = iter->width;
uint32_t * buffer = iter->buffer;
const uint32_t wide_zero[4] = {0};
pixman_fixed_t x, y;
pixman_fixed_t ux, uy;
pixman_vector_t v;
@ -513,7 +514,8 @@ __bits_image_fetch_affine_no_alpha (pixman_iter_t * iter,
for (i = 0; i < width; ++i)
{
if (!mask || mask[i])
if (!mask || (!wide && mask[i]) ||
(wide && memcmp(&mask[4 * i], wide_zero, 16) != 0))
{
bits_image_fetch_pixel_filtered (
&image->bits, wide, x, y, get_pixel, buffer);
@ -636,6 +638,7 @@ __bits_image_fetch_general (pixman_iter_t *iter,
get_pixel_t get_pixel =
wide ? fetch_pixel_general_float : fetch_pixel_general_32;
const uint32_t wide_zero[4] = {0};
pixman_fixed_t x, y, w;
pixman_fixed_t ux, uy, uw;
pixman_vector_t v;
@ -670,7 +673,8 @@ __bits_image_fetch_general (pixman_iter_t *iter,
{
pixman_fixed_t x0, y0;
if (!mask || mask[i])
if (!mask || (!wide && mask[i]) ||
(wide && memcmp(&mask[4 * i], wide_zero, 16) != 0))
{
if (w != 0)
{
@ -1051,14 +1055,14 @@ dest_write_back_narrow (pixman_iter_t *iter)
iter->y++;
}
static const float
static float
dither_factor_blue_noise_64 (int x, int y)
{
float m = dither_blue_noise_64x64[((y & 0x3f) << 6) | (x & 0x3f)];
return m * (1. / 4096.f) + (1. / 8192.f);
}
static const float
static float
dither_factor_bayer_8 (int x, int y)
{
uint32_t m;

Просмотреть файл

@ -128,14 +128,14 @@
#if defined(PIXMAN_NO_TLS)
# define PIXMAN_DEFINE_THREAD_LOCAL(type, name) \
static type name
static type name;
# define PIXMAN_GET_THREAD_LOCAL(name) \
(&name)
#elif defined(TLS)
# define PIXMAN_DEFINE_THREAD_LOCAL(type, name) \
static TLS type name
static TLS type name;
# define PIXMAN_GET_THREAD_LOCAL(name) \
(&name)
@ -195,7 +195,7 @@
#elif defined(_MSC_VER)
# define PIXMAN_DEFINE_THREAD_LOCAL(type, name) \
static __declspec(thread) type name
static __declspec(thread) type name;
# define PIXMAN_GET_THREAD_LOCAL(name) \
(&name)

Просмотреть файл

@ -2836,7 +2836,11 @@ bits_image_fetch_separable_convolution_affine (pixman_image_t * image,
sgtot = CLIP (sgtot, 0, 0xff);
sbtot = CLIP (sbtot, 0, 0xff);
#ifdef WORDS_BIGENDIAN
buffer[k] = (satot << 0) | (srtot << 8) | (sgtot << 16) | (sbtot << 24);
#else
buffer[k] = (satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot << 0);
#endif
next:
vx += ux;

Просмотреть файл

@ -63,7 +63,7 @@ typedef struct
} cache [N_CACHED_FAST_PATHS];
} cache_t;
PIXMAN_DEFINE_THREAD_LOCAL (cache_t, fast_path_cache);
PIXMAN_DEFINE_THREAD_LOCAL (cache_t, fast_path_cache)
static void
dummy_composite_rect (pixman_implementation_t *imp,

Просмотреть файл

@ -60,7 +60,7 @@ _mm_empty (void)
#endif
#ifdef USE_X86_MMX
# if (defined(__SUNPRO_C) || defined(_MSC_VER) || defined(_WIN64))
# if (defined(__SUNPRO_C) || defined(_MSC_VER) || defined(_WIN64)) || defined(__MINGW32__)
# include <xmmintrin.h>
# else
/* We have to compile with -msse to use xmmintrin.h, but that causes SSE
@ -137,13 +137,13 @@ _mm_mulhi_pu16 (__m64 __A, __m64 __B)
* then define USE_M64_CASTS.
* If __m64 is a double datatype, then define USE_M64_DOUBLE.
*/
#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(__clang__)
# define M64_MEMBER m64_u64
#elif defined(__ICC)
# define USE_CVT_INTRINSICS
#elif defined(USE_LOONGSON_MMI)
# define USE_M64_DOUBLE
#elif defined(__GNUC__)
#elif defined(__GNUC__) || defined(__clang__)
# define USE_M64_CASTS
#elif defined(__SUNPRO_C)
# if (__SUNPRO_C >= 0x5120) && !defined(__NOVECTORSIZE__)

Просмотреть файл

@ -68,6 +68,24 @@ pixman_have_vmx (void)
return have_vmx;
}
#elif defined (__FreeBSD__)
#include <machine/cpu.h>
#include <sys/auxv.h>
static pixman_bool_t
pixman_have_vmx (void)
{
unsigned long cpufeatures;
int have_vmx;
if (elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures)))
return FALSE;
have_vmx = cpufeatures & PPC_FEATURE_HAS_ALTIVEC;
return have_vmx;
}
#elif defined (__linux__)
#include <sys/types.h>

Просмотреть файл

@ -649,6 +649,11 @@ pixman_implementation_t *
_pixman_implementation_create_arm_neon (pixman_implementation_t *fallback);
#endif
#ifdef USE_ARM_A64_NEON
pixman_implementation_t *
_pixman_implementation_create_arm_neon (pixman_implementation_t *fallback);
#endif
#ifdef USE_MIPS_DSPR2
pixman_implementation_t *
_pixman_implementation_create_mips_dspr2 (pixman_implementation_t *fallback);

Просмотреть файл

@ -76,7 +76,7 @@
#define PIXREGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
#define PIXREGION_RECTS(reg) \
((reg)->data ? (box_type_t *)((reg)->data + 1) \
: &(reg)->extents)
: (box_type_t *)&(reg)->extents)
#define PIXREGION_BOXPTR(reg) ((box_type_t *)((reg)->data + 1))
#define PIXREGION_BOX(reg, i) (&PIXREGION_BOXPTR (reg)[i])
#define PIXREGION_TOP(reg) PIXREGION_BOX (reg, (reg)->data->numRects)
@ -292,7 +292,7 @@ alloc_data (size_t n)
} while (0)
PIXMAN_EXPORT pixman_bool_t
PREFIX (_equal) (region_type_t *reg1, region_type_t *reg2)
PREFIX (_equal) (const region_type_t *reg1, const region_type_t *reg2)
{
int i;
box_type_t *rects1;
@ -395,7 +395,7 @@ PREFIX (_init_rect) (region_type_t * region,
}
PIXMAN_EXPORT void
PREFIX (_init_with_extents) (region_type_t *region, box_type_t *extents)
PREFIX (_init_with_extents) (region_type_t *region, const box_type_t *extents)
{
if (!GOOD_RECT (extents))
{
@ -417,13 +417,13 @@ PREFIX (_fini) (region_type_t *region)
}
PIXMAN_EXPORT int
PREFIX (_n_rects) (region_type_t *region)
PREFIX (_n_rects) (const region_type_t *region)
{
return PIXREGION_NUMRECTS (region);
}
PIXMAN_EXPORT box_type_t *
PREFIX (_rectangles) (region_type_t *region,
PREFIX (_rectangles) (const region_type_t *region,
int *n_rects)
{
if (n_rects)
@ -505,7 +505,7 @@ pixman_rect_alloc (region_type_t * region,
}
PIXMAN_EXPORT pixman_bool_t
PREFIX (_copy) (region_type_t *dst, region_type_t *src)
PREFIX (_copy) (region_type_t *dst, const region_type_t *src)
{
GOOD (dst);
GOOD (src);
@ -746,8 +746,8 @@ typedef pixman_bool_t (*overlap_proc_ptr) (region_type_t *region,
static pixman_bool_t
pixman_op (region_type_t * new_reg, /* Place to store result */
region_type_t * reg1, /* First region in operation */
region_type_t * reg2, /* 2d region in operation */
const region_type_t * reg1, /* First region in operation */
const region_type_t * reg2, /* 2d region in operation */
overlap_proc_ptr overlap_func, /* Function to call for over-
* lapping bands */
int append_non1, /* Append non-overlapping bands
@ -1155,8 +1155,8 @@ pixman_region_intersect_o (region_type_t *region,
PIXMAN_EXPORT pixman_bool_t
PREFIX (_intersect) (region_type_t * new_reg,
region_type_t * reg1,
region_type_t * reg2)
const region_type_t * reg1,
const region_type_t * reg2)
{
GOOD (reg1);
GOOD (reg2);
@ -1321,7 +1321,7 @@ pixman_region_union_o (region_type_t *region,
PIXMAN_EXPORT pixman_bool_t
PREFIX(_intersect_rect) (region_type_t *dest,
region_type_t *source,
const region_type_t *source,
int x, int y,
unsigned int width,
unsigned int height)
@ -1342,7 +1342,7 @@ PREFIX(_intersect_rect) (region_type_t *dest,
*/
PIXMAN_EXPORT pixman_bool_t
PREFIX (_union_rect) (region_type_t *dest,
region_type_t *source,
const region_type_t *source,
int x,
int y,
unsigned int width,
@ -1368,9 +1368,9 @@ PREFIX (_union_rect) (region_type_t *dest,
}
PIXMAN_EXPORT pixman_bool_t
PREFIX (_union) (region_type_t *new_reg,
region_type_t *reg1,
region_type_t *reg2)
PREFIX (_union) (region_type_t * new_reg,
const region_type_t *reg1,
const region_type_t *reg2)
{
/* Return TRUE if some overlap
* between reg1, reg2
@ -1954,9 +1954,9 @@ pixman_region_subtract_o (region_type_t * region,
*-----------------------------------------------------------------------
*/
PIXMAN_EXPORT pixman_bool_t
PREFIX (_subtract) (region_type_t *reg_d,
region_type_t *reg_m,
region_type_t *reg_s)
PREFIX (_subtract) (region_type_t * reg_d,
const region_type_t *reg_m,
const region_type_t *reg_s)
{
GOOD (reg_m);
GOOD (reg_s);
@ -2019,9 +2019,9 @@ PREFIX (_subtract) (region_type_t *reg_d,
*-----------------------------------------------------------------------
*/
PIXMAN_EXPORT pixman_bool_t
PREFIX (_inverse) (region_type_t *new_reg, /* Destination region */
region_type_t *reg1, /* Region to invert */
box_type_t * inv_rect) /* Bounding box for inversion */
PREFIX (_inverse) (region_type_t * new_reg, /* Destination region */
const region_type_t *reg1, /* Region to invert */
const box_type_t * inv_rect) /* Bounding box for inversion */
{
region_type_t inv_reg; /* Quick and dirty region made from the
* bounding box */
@ -2113,8 +2113,8 @@ find_box_for_y (box_type_t *begin, box_type_t *end, int y)
* that doesn't overlap the box at all and part_in is false)
*/
PIXMAN_EXPORT pixman_region_overlap_t
PREFIX (_contains_rectangle) (region_type_t * region,
box_type_t * prect)
PREFIX (_contains_rectangle) (const region_type_t * region,
const box_type_t * prect)
{
box_type_t * pbox;
box_type_t * pbox_end;
@ -2318,7 +2318,7 @@ PREFIX (_translate) (region_type_t *region, int x, int y)
}
PIXMAN_EXPORT void
PREFIX (_reset) (region_type_t *region, box_type_t *box)
PREFIX (_reset) (region_type_t *region, const box_type_t *box)
{
GOOD (region);
@ -2343,7 +2343,7 @@ PREFIX (_clear) (region_type_t *region)
/* box is "return" value */
PIXMAN_EXPORT int
PREFIX (_contains_point) (region_type_t * region,
PREFIX (_contains_point) (const region_type_t * region,
int x, int y,
box_type_t * box)
{
@ -2387,7 +2387,7 @@ PREFIX (_contains_point) (region_type_t * region,
}
PIXMAN_EXPORT int
PREFIX (_not_empty) (region_type_t * region)
PREFIX (_not_empty) (const region_type_t * region)
{
GOOD (region);
@ -2395,11 +2395,11 @@ PREFIX (_not_empty) (region_type_t * region)
}
PIXMAN_EXPORT box_type_t *
PREFIX (_extents) (region_type_t * region)
PREFIX (_extents) (const region_type_t * region)
{
GOOD (region);
return(&region->extents);
return(box_type_t *)(&region->extents);
}
/*

Просмотреть файл

@ -32,10 +32,10 @@
#endif
#define PIXMAN_VERSION_MAJOR 0
#define PIXMAN_VERSION_MINOR 40
#define PIXMAN_VERSION_MICRO 0
#define PIXMAN_VERSION_MINOR 42
#define PIXMAN_VERSION_MICRO 2
#define PIXMAN_VERSION_STRING "0.40.0"
#define PIXMAN_VERSION_STRING "0.42.2"
#define PIXMAN_VERSION_ENCODE(major, minor, micro) ( \
((major) * 10000) \

Просмотреть файл

@ -518,8 +518,8 @@ pixman_bool_t pixman_region_init_rects (pixman_region16_t *reg
int count);
PIXMAN_API
void pixman_region_init_with_extents (pixman_region16_t *region,
pixman_box16_t *extents);
void pixman_region_init_with_extents (pixman_region16_t *region,
const pixman_box16_t *extents);
PIXMAN_API
void pixman_region_init_from_image (pixman_region16_t *region,
@ -536,78 +536,78 @@ void pixman_region_translate (pixman_region16_t *reg
int y);
PIXMAN_API
pixman_bool_t pixman_region_copy (pixman_region16_t *dest,
pixman_region16_t *source);
pixman_bool_t pixman_region_copy (pixman_region16_t *dest,
const pixman_region16_t *source);
PIXMAN_API
pixman_bool_t pixman_region_intersect (pixman_region16_t *new_reg,
pixman_region16_t *reg1,
pixman_region16_t *reg2);
pixman_bool_t pixman_region_intersect (pixman_region16_t *new_reg,
const pixman_region16_t *reg1,
const pixman_region16_t *reg2);
PIXMAN_API
pixman_bool_t pixman_region_union (pixman_region16_t *new_reg,
pixman_region16_t *reg1,
pixman_region16_t *reg2);
pixman_bool_t pixman_region_union (pixman_region16_t *new_reg,
const pixman_region16_t *reg1,
const pixman_region16_t *reg2);
PIXMAN_API
pixman_bool_t pixman_region_union_rect (pixman_region16_t *dest,
pixman_region16_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
pixman_bool_t pixman_region_union_rect (pixman_region16_t *dest,
const pixman_region16_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
PIXMAN_API
pixman_bool_t pixman_region_intersect_rect (pixman_region16_t *dest,
pixman_region16_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
pixman_bool_t pixman_region_intersect_rect (pixman_region16_t *dest,
const pixman_region16_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
PIXMAN_API
pixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d,
pixman_region16_t *reg_m,
pixman_region16_t *reg_s);
pixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d,
const pixman_region16_t *reg_m,
const pixman_region16_t *reg_s);
PIXMAN_API
pixman_bool_t pixman_region_inverse (pixman_region16_t *new_reg,
pixman_region16_t *reg1,
pixman_box16_t *inv_rect);
pixman_bool_t pixman_region_inverse (pixman_region16_t *new_reg,
const pixman_region16_t *reg1,
const pixman_box16_t *inv_rect);
PIXMAN_API
pixman_bool_t pixman_region_contains_point (pixman_region16_t *region,
int x,
int y,
pixman_box16_t *box);
pixman_bool_t pixman_region_contains_point (const pixman_region16_t *region,
int x,
int y,
pixman_box16_t *box);
PIXMAN_API
pixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *region,
pixman_box16_t *prect);
pixman_region_overlap_t pixman_region_contains_rectangle (const pixman_region16_t *region,
const pixman_box16_t *prect);
PIXMAN_API
pixman_bool_t pixman_region_not_empty (pixman_region16_t *region);
pixman_bool_t pixman_region_not_empty (const pixman_region16_t *region);
PIXMAN_API
pixman_box16_t * pixman_region_extents (pixman_region16_t *region);
pixman_box16_t * pixman_region_extents (const pixman_region16_t *region);
PIXMAN_API
int pixman_region_n_rects (pixman_region16_t *region);
int pixman_region_n_rects (const pixman_region16_t *region);
PIXMAN_API
pixman_box16_t * pixman_region_rectangles (pixman_region16_t *region,
int *n_rects);
pixman_box16_t * pixman_region_rectangles (const pixman_region16_t *region,
int *n_rects);
PIXMAN_API
pixman_bool_t pixman_region_equal (pixman_region16_t *region1,
pixman_region16_t *region2);
pixman_bool_t pixman_region_equal (const pixman_region16_t *region1,
const pixman_region16_t *region2);
PIXMAN_API
pixman_bool_t pixman_region_selfcheck (pixman_region16_t *region);
PIXMAN_API
void pixman_region_reset (pixman_region16_t *region,
pixman_box16_t *box);
void pixman_region_reset (pixman_region16_t *region,
const pixman_box16_t *box);
PIXMAN_API
void pixman_region_clear (pixman_region16_t *region);
@ -659,8 +659,8 @@ pixman_bool_t pixman_region32_init_rects (pixman_region32_t *r
int count);
PIXMAN_API
void pixman_region32_init_with_extents (pixman_region32_t *region,
pixman_box32_t *extents);
void pixman_region32_init_with_extents (pixman_region32_t *region,
const pixman_box32_t *extents);
PIXMAN_API
void pixman_region32_init_from_image (pixman_region32_t *region,
@ -677,78 +677,78 @@ void pixman_region32_translate (pixman_region32_t *r
int y);
PIXMAN_API
pixman_bool_t pixman_region32_copy (pixman_region32_t *dest,
pixman_region32_t *source);
pixman_bool_t pixman_region32_copy (pixman_region32_t *dest,
const pixman_region32_t *source);
PIXMAN_API
pixman_bool_t pixman_region32_intersect (pixman_region32_t *new_reg,
pixman_region32_t *reg1,
pixman_region32_t *reg2);
pixman_bool_t pixman_region32_intersect (pixman_region32_t *new_reg,
const pixman_region32_t *reg1,
const pixman_region32_t *reg2);
PIXMAN_API
pixman_bool_t pixman_region32_union (pixman_region32_t *new_reg,
pixman_region32_t *reg1,
pixman_region32_t *reg2);
pixman_bool_t pixman_region32_union (pixman_region32_t *new_reg,
const pixman_region32_t *reg1,
const pixman_region32_t *reg2);
PIXMAN_API
pixman_bool_t pixman_region32_intersect_rect (pixman_region32_t *dest,
pixman_region32_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
pixman_bool_t pixman_region32_intersect_rect (pixman_region32_t *dest,
const pixman_region32_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
PIXMAN_API
pixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest,
pixman_region32_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
pixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest,
const pixman_region32_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
PIXMAN_API
pixman_bool_t pixman_region32_subtract (pixman_region32_t *reg_d,
pixman_region32_t *reg_m,
pixman_region32_t *reg_s);
pixman_bool_t pixman_region32_subtract (pixman_region32_t *reg_d,
const pixman_region32_t *reg_m,
const pixman_region32_t *reg_s);
PIXMAN_API
pixman_bool_t pixman_region32_inverse (pixman_region32_t *new_reg,
pixman_region32_t *reg1,
pixman_box32_t *inv_rect);
pixman_bool_t pixman_region32_inverse (pixman_region32_t *new_reg,
const pixman_region32_t *reg1,
const pixman_box32_t *inv_rect);
PIXMAN_API
pixman_bool_t pixman_region32_contains_point (pixman_region32_t *region,
int x,
int y,
pixman_box32_t *box);
pixman_bool_t pixman_region32_contains_point (const pixman_region32_t *region,
int x,
int y,
pixman_box32_t *box);
PIXMAN_API
pixman_region_overlap_t pixman_region32_contains_rectangle (pixman_region32_t *region,
pixman_box32_t *prect);
pixman_region_overlap_t pixman_region32_contains_rectangle (const pixman_region32_t *region,
const pixman_box32_t *prect);
PIXMAN_API
pixman_bool_t pixman_region32_not_empty (pixman_region32_t *region);
pixman_bool_t pixman_region32_not_empty (const pixman_region32_t *region);
PIXMAN_API
pixman_box32_t * pixman_region32_extents (pixman_region32_t *region);
pixman_box32_t * pixman_region32_extents (const pixman_region32_t *region);
PIXMAN_API
int pixman_region32_n_rects (pixman_region32_t *region);
int pixman_region32_n_rects (const pixman_region32_t *region);
PIXMAN_API
pixman_box32_t * pixman_region32_rectangles (pixman_region32_t *region,
int *n_rects);
pixman_box32_t * pixman_region32_rectangles (const pixman_region32_t *region,
int *n_rects);
PIXMAN_API
pixman_bool_t pixman_region32_equal (pixman_region32_t *region1,
pixman_region32_t *region2);
pixman_bool_t pixman_region32_equal (const pixman_region32_t *region1,
const pixman_region32_t *region2);
PIXMAN_API
pixman_bool_t pixman_region32_selfcheck (pixman_region32_t *region);
PIXMAN_API
void pixman_region32_reset (pixman_region32_t *region,
pixman_box32_t *box);
void pixman_region32_reset (pixman_region32_t *region,
const pixman_box32_t *box);
PIXMAN_API
void pixman_region32_clear (pixman_region32_t *region);