summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pixman/.cvsignore19
-rw-r--r--pixman/AUTHORS19
-rw-r--r--pixman/COPYING92
-rw-r--r--pixman/ChangeLog738
-rw-r--r--pixman/ChangeLog.libic300
-rw-r--r--pixman/ChangeLog.libpixregion47
-rw-r--r--pixman/ChangeLog.slim39
-rw-r--r--pixman/INSTALL9
-rw-r--r--pixman/Makefile.am60
-rw-r--r--pixman/NEWS93
-rw-r--r--pixman/README47
-rw-r--r--pixman/RELEASING81
-rw-r--r--pixman/TODO10
-rwxr-xr-xpixman/autogen.sh53
-rw-r--r--pixman/configure.in59
-rw-r--r--pixman/libpixman.pc.in10
-rw-r--r--pixman/src/.cvsignore6
-rw-r--r--pixman/src/Makefile.am35
-rw-r--r--pixman/src/fbedge.c126
-rw-r--r--pixman/src/fbedgeimp.h138
-rw-r--r--pixman/src/fbtrap.c236
-rw-r--r--pixman/src/ic.c1145
-rw-r--r--pixman/src/icblt.c925
-rw-r--r--pixman/src/icbltone.c742
-rw-r--r--pixman/src/iccolor.c84
-rw-r--r--pixman/src/iccompose.c2745
-rw-r--r--pixman/src/icformat.c193
-rw-r--r--pixman/src/icimage.c681
-rw-r--r--pixman/src/icimage.h335
-rw-r--r--pixman/src/icint.h1047
-rw-r--r--pixman/src/icpixels.c117
-rw-r--r--pixman/src/icrect.c294
-rw-r--r--pixman/src/icrop.h137
-rw-r--r--pixman/src/icstipple.c79
-rw-r--r--pixman/src/ictransform.c64
-rw-r--r--pixman/src/ictrap.c212
-rw-r--r--pixman/src/ictri.c362
-rw-r--r--pixman/src/icutil.c286
-rw-r--r--pixman/src/pixman-xserver-compat.h108
-rw-r--r--pixman/src/pixman.h476
-rw-r--r--pixman/src/pixregion.c2547
-rw-r--r--pixman/src/pixregionint.h83
-rw-r--r--pixman/src/renderedge.c197
-rw-r--r--pixman/src/renderedge.h159
-rw-r--r--pixman/src/slim_internal.h100
-rw-r--r--pixman/update.pl159
46 files changed, 0 insertions, 15494 deletions
diff --git a/pixman/.cvsignore b/pixman/.cvsignore
deleted file mode 100644
index a3d5a36ac..000000000
--- a/pixman/.cvsignore
+++ /dev/null
@@ -1,19 +0,0 @@
-Makefile
-Makefile.in
-aclocal.m4
-autom4te.cache
-config.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-libpixman.pc
-libtool
-ltmain.sh
-releases
-stamp-h
-stamp-h.in
-stamp-h1
diff --git a/pixman/AUTHORS b/pixman/AUTHORS
deleted file mode 100644
index d858e59ba..000000000
--- a/pixman/AUTHORS
+++ /dev/null
@@ -1,19 +0,0 @@
-David R Bacon <dbacon@cis.ksu.edu> Fixes to compile on x86_64.
-Billy Biggs <vektor@dumbterm.net> Fix to use stdint datatypes.
-Dave Beckett <Dave.Beckett@bristol.ac.uk> Combined libpixregion, libic, and slim.
-Jakub Bogusz <qboosh@pld-linux.org> Fixes for 64-bit machines.
-Anders Carlsson <andersca@gnome.org> Build fixes. New accessor functions.
-Richard Henderson <rth@twiddle.net> "slim" macros for better shared libraries
-Owen Taylor <otaylor@redhat.com> Support for both transform and repeat
-Keith Packard <keithp@keithp.com> The original implementation of the compositing code.
-David Reveman <c99drn@cs.umu.se> Byte-order, clipping and format fixes.
-Vladimir Vukicevic <vladimir@pobox.com> Bug fix.
-Bryan Worth <bryan@theworths.org> Cleanups to not depend on X header files.
-Carl Worth <carl@theworths.org> General maintenance. Original port from X server code.
-Richard Worth <richard@theworths.org> Build fixes for cygwin.
-
-and the "X Window System authors" (pixregion code)
-
-(Please let us know if we have missed anyone. I would be interested in
-having more precise attribution for the pixregion code if anyone knows
-who wrote that.)
diff --git a/pixman/COPYING b/pixman/COPYING
deleted file mode 100644
index 5d8dca6d6..000000000
--- a/pixman/COPYING
+++ /dev/null
@@ -1,92 +0,0 @@
-libpixregion
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-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
-OPEN GROUP 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.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-----------------------------------------------------------------------
-libic
-
-Copyright © 2001 Keith Packard
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation, and that the name of Keith Packard not be used in
-advertising or publicity pertaining to distribution of the software without
-specific, written prior permission. Keith Packard makes no
-representations about the suitability of this software for any purpose. It
-is provided "as is" without express or implied warranty.
-
-KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-
-----------------------------------------------------------------------
-slim
-
-slim is Copyright © 2003 Richard Henderson
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Richard Henderson not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission. Richard Henderson
-makes no representations about the suitability of this software for
-any purpose. It is provided "as is" without express or implied
-warranty.
-
-RICHARD HENDERSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-EVENT SHALL RICHARD HENDERSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-
diff --git a/pixman/ChangeLog b/pixman/ChangeLog
deleted file mode 100644
index af0b96cf1..000000000
--- a/pixman/ChangeLog
+++ /dev/null
@@ -1,738 +0,0 @@
-2005-05-12 Keith Packard <keithp@keithp.com>
-
- reviewed by: cworth
-
- * src/ictrap.c: (pixman_composite_trapezoids):
- libpixman creates an A8 format object and sometimes forgets to
- destroy (when the bounds of the trapezoids are empty).
- Avoids creating the format object in that case.
-
-2005-04-27 Owen Taylor <otaylor@redhat.com>
-
- * src/icimage.c (pixman_image_set_clip_region): Set
- image->pCompositeClip here.
- (IcComputeCompositeRegion) src/icrect.c (pixman_color_rects):
- Remove workaround clipping to the clientClip.
-
-2005-04-27 Owen Taylor <otaylor@redhat.com>
-
- * src/ic.c: Don't use pixman_compositeSrc_8888x8888 when
- the source is x8r8g8b8 or x8b8g8r8.
-
-2005-03-29 T Rowley <tim.rowley@gmail.com>
-
- * src/pixman.h: add AIX to the test for inttypes.h
-
-2005-03-11 Owen Taylor <otaylor@redhat.com>
-
- * src/icformat.c (pixman_format_init): Set format->depth
- correctly instead of just using the bpp.
-
-2005-03-07 Carl Worth <cworth@cworth.org>
-
- * configure.in: Increment version to 0.1.4-head post-snapshot.
-
- * RELEASING: Add notes on using -head suffix for PIXMAN_VERSION.
-
- * NEWS: Add notes for snapshot 0.1.4.
-
- * configure.in: Increment version to 0.1.4.
-
-2005-03-04 Carl Worth <cworth@cworth.org>
-
- * src/ictrap.c (pixman_composite_trapezoids): Intersect bounds of
- trapezoids with the bounds of the destination surface before
- creating an intermediate surface.
-
-2005-03-04 Carl Worth <cworth@cworth.org>
-
- * src/ictrap.c (pixman_composite_trapezoids): Add comment from
- xserver's mitrap.c.
-
-2005-03-04 David Reveman <davidr@novell.com>
-
- * src/pixman.h:
- * src/ictrap.c: Add pixman_add_trapezoids.
-
-2005-03-03 Carl Worth <cworth@cworth.org>
-
- * src/icimage.c (miIsSolidAlpha): Port from render/mipict.c.
-
- * src/ictrap.c (pixman_composite_trapezoids): Merge in
- optimization from render/mitrap.c for op==ADD and solid alpha src.
-
-2005-03-03 Carl Worth <cworth@cworth.org>
-
- * src/pixman-xserver-compat.h (BoxRec, BoxPtr, Bool, TRUE, FALSE):
- Add a few more things that might be helpful when moving more files
- over from xserver.
-
-2005-03-03 Carl Worth <cworth@cworth.org>
-
- * src/icint.h:
- * src/ictrap.c: Move definitions of MIN and MAX macros from
- ictrap.c to icint.h.
-
-2005-03-03 Carl Worth <cworth@cworth.org>
-
- * src/ictrap.c (pixman_composite_trapezoids): Remove dead "if
- (!format)" code which also makes things more in synch with the
- server's mitrap.c.
-
-2005-03-03 Carl Worth <cworth@cworth.org>
-
- * src/ictrap.c: Restore original copyright and license which must
- have been inadvertently changed.
-
-2005-03-02 Carl Worth <cworth@cworth.org>
-
- * src/pixman-xserver-compat.h: Fix comment to clarify that
- libpixman regards the xserver repository as its canonical upstream
- for some files.
-
- * src/ic.c, src/icblt.c, src/icbltone.c, src/iccolor.c,
- src/iccompose.c, src/icformat.c, src/icimage.c, src/icimage.h,
- src/icint.h, src/icpixels.c, src/icrect.c, src/icrop.h,
- src/icstipple.c, src/ictransform.c, src/ictrap.c, src/ictri.c,
- src/icutil.c, src/pixman.h, src/slim_internal.h: Convert file
- encodings from ISO-8859 to UTF-8.
-
-2005-02-21 Carl Worth <cworth@cworth.org>
-
- * src/renderedge.h: Add only-just-better-than-ASCII-art diagram
- showing all macros used in locating sub-pixel sample rows/columns.
-
- * src/renderedge.h (RenderEdgeStepSmall, RenderEdgeStepBig): Add
- missing protective parentheses around macro parameter usage.
-
-2005-02-21 Carl Worth <cworth@cworth.org>
-
- * src/ic.c:
- * src/icint.h: Move definition of __inline for non-gcc from ic.c
- to icint.h so it applies to more code in the implementation.
-
-2005-02-06 Owen Taylor <otaylor@redhat.com>
-
- * configure.in: Add AC_PREREQ(2.54) to help the Debian
- auto-guess-which-configure-version hack.
-
-2005-01-26 Carl Worth <cworth@cworth.org>
-
- * src/pixman.h: Use 32-bits for pixman_bits_t, even on 64-bit
- platforms. This should fix bug #2335 as well as rendering problems
- seen on 64-bit platforms.
-
-2005-01-21 Carl Worth <cworth@cworth.org>
-
- * NEWS: Add notes for snapshot 0.1.3.
-
- * configure.in: Increment version to 0.1.3
-
- * RELEASING: Add reminder to diff pixman.h to look for API changes
- since the last snapshot.
-
- * src/Makefile.am (libpixman_la_SOURCES): Add missing files to
- satisfy make distcheck.
-
- * Makefile.am (RELEASE_UPLOAD_DIR): Update for changed www
- directory on server.
-
- * src/pixman-xserver-compat.h): Add pixman-xserver-compat.h, (that
- was supposed to go in a couple of commits ago).
-
- * src/fbedgeimp.h (rasterizeEdges): Avoid buffer ovverrun when
- trapezoid's right edge is on a pixel boundary.
-
- * src/ictri.c (IcRasterizeTriangle):
- * src/ictrap.c (pixman_composite_trapezoids): Switch to use new
- fbRasterizeTrapezoid. Gut old IcRasterizeTrapezoid
- implementation. Remove lots of code, (and all the bugs with it).
-
- * src/icint.h: Replace IcRasterizeTrapezoid with
- fbRasterizeTrapezoid. Add a couple of missing typedefs.
-
- * src/renderedge.h:
- * src/renderedge.c (RenderLineFixedEdgeInit):
- * src/fbtrap.c:
-
- * src/fbedge.c: Minor changes to allow things to compile within
- libpixman tree, (replace xserver include directives with
- pixman-xserver-compat.h and sprinkle a few const qualifiers).
-
- * src/Makefile.am (libpixman_la_SOURCES): Add sources for new
- point-sampling rasterization.
-
- * src/fbtrap.c: Merge in changes from xserver, (mostly just
- whitespace).
-
-2005-01-18 Carl Worth <cworth@cworth.org>
-
- * src/fbedge.c:
- * src/fbedgeimp.h:
- * src/fbtrap.c:
- * src/renderedge.c:
- * src/renderedge.h: Add pristine files from the X server
- containing Keith's newer point-sampling implementation of
- trapezoid rasterization. The plan is to munge these files as
- little as possible to make them work within libpixman, (so that it
- will be easier to share patches between libpixman and the X
- server).
-
-2005-01-13 Carl Worth <cworth@cworth.org>
-
- * src/ictrap.c (IcRasterizeTrapezoid): Force alpha to 0 when the
- left edge is entirely above top. (This is a workaround for some
- bizarre edge effects in the current algorithm).
- (IcRasterizeTrapezoid): Fix the above correction so that it
- doesn't force 0 alpha when the left edge is positioned above but
- slopes so as to contain some of the pixel.
-
-2005-01-07 Carl Worth <cworth@cworth.org>
-
- * src/icrop.h:
- * src/icint.h: Restore extern tag for variable declarations,
- (accidentally removed when recently removing extern from function
- prototypes).
-
-2005-01-04 Carl Worth <cworth@cworth.org>
-
- * src/ic.c (pixman_composite): Do nothing if src image has width
- or height == 0 to avoid potential divide-by-zero.
-
-2004-12-23 Carl Worth <cworth@cworth.org>
-
- * src/slim_internal.h: Rename __internal_linkage to
- pixman_private.
-
- * src/icrop.h:
- * src/icint.h:
- * src/icimage.h: Track rename to pixman_private and move it to
- before the function return value to quiet gcc warnings about
- visibility attribute ignored for non-class type.
-
- * configure.in:
- * src/Makefile.am (INCLUDES): Add the following warnings when
- compiling with gcc: -Wall -Wpointer-arith -Wstrict-prototypes
- -Wmissing-prototypes -Wmissing-declarations -Wnested-externs
- -fno-strict-aliasing
-
- * src/icrect.c (pixman_color_rects): Fix to actually call
- pixman_fill_rect_32bpp in the 32 bpp case. Thanks to
- TOKUNAGA Hiroyuki <tkng@xem.jp>.
- (pixman_fill_rect_8bpp, pixman_fill_rect_32bpp): Fix typo in
- naming: bbp -> bpp.
-
-2004-12-20 Alexander Larsson <alexl@redhat.com>
-
- * src/icrect.c: (pixman_fill_rect_8bbp), (pixman_fill_rect_32bbp),
- (pixman_fill_rect_general), (pixman_color_rects),
- (pixman_fill_rectangles):
- Special case solid color rectangle fills.
-
-2004-10-28 Carl Worth <cworth@cworth.org>
-
- * Makefile.am (release-verify-newer): Abort release-publish if
- there's already a published tar file with the current version.
- (release-publish): Add code to update the LATEST-package-version
- file.
-
-2004-10-27 Carl Worth <cworth@cworth.org>
-
- * RELEASING: Put the tag command back which was accidentally
- removed from the instructions.
-
- * NEWS: Update date since 0.1.2 release didn't get pushed out
- until today.
-
- * RELEASING: Update release instructions to include new
- release-publish target.
- Suggest "cvs -q update -Ad" as an alternative to checkout.
-
- * Makefile.am (release-publish): Add release-check and
- release-publish targets to simplify the release process.
-
-2004-10-13 Carl Worth <cworth@cworth.org>
-
- * NEWS: Add notes for snapshot 0.1.2
-
- * configure.in: Increment version to 0.1.2
-
- * src/icint.h (MOD):
- * src/iccompose.c (IcFetch_transform):
- * src/ic.c (pixman_composite): Switch from two different buggy mod
- macros to a new MOD macro which should work in C89 or C99.
-
-2004-09-12 David Reveman <c99drn@cs.umu.se>
-
- * src/icformat.c (pixman_format_init): pixman_format_init expects
- that all variables not touched are zero. We need to add a memset
- here to make that true.
- Added pixman_format_get_masks, which allow clients to get the
- masks from a format.
-
- * src/icimage.c: Added the implementation of pixman_image_get_format,
- which was missing.
-
- * src/icint.h: slim_hidden_proto pixman_image_set_component_alpha.
-
- * src/pixman.h: Added pixman_image_set_component_alpha, making it
- possible to use component alpha.
-
- * src/icimage.c (pixman_image_set_clip_region): Make a copy of
- the client owned region.
- (IcComputeCompositeRegion): Intersect possible client region.
- Added pixman_image_set_component_alpha.
-
- * src/icint.h: Include "../config.h".
- Define IMAGE_BYTE_ORDER and BITMAP_BIT_ORDER correctly.
-
- * configure.in: Added AC_C_BIGENDIAN.
-
- * src/ic.c (pixman_composite):
- * src/iccompose.c (IcFetch_transform, IcFetcha_transform):
- * src/icimage.h: Added support for both transform and repeat
- (thanks to Owen Taylor <otaylor@redhat.com>).
-
-2004-05-06 Carl Worth <cworth@isi.edu>
-
- * src/icimage.c (pixman_image_set_clip_region): Leave
- clientClipType as CT_NONE if region is NULL (thanks to Vladimir
- Vukicevic <vladimir@pobox.com>).
-
-2004-04-16 Carl Worth <cworth@isi.edu>
-
- * NEWS: Add notes for snapshot 0.1.1
-
- * configure.in: Increment LIBPIXMAN_VERSION to 0.1.1
-
- * src/ictrap.c (IcCreateAlphaPicture):
- * src/icrect.c (pixman_color_rects):
- * src/pixregion.c (pixman_region16_print, pixman_region16_valid):
- * src/icint.h (IcBitsMask):
- * src/icimage.h:
- * src/icimage.c (pixman_image_change):
- * src/icformat.c (pixman_format_create):
- * src/pixman.h: Fix bogus names such as PIXMAN_FORMAT_NAME_AR_GB32
- that were left over from a broken search-and-replace. Normalize
- structure defintions, (eg. struct _pixman_region16_t -> struct
- pixman_region16). Normalize indentation.
-
- * AUTHORS: Fix alphabetization.
-
-2004-02-24 Carl Worth <cworth@isi.edu>
-
- * AUTHORS: Added attribution for several authors after sifting
- through the ChangeLog.
- Fix email address for Anders Carlsson.
-
-2004-01-24 Carl Worth <cworth@isi.edu>
-
- * src/iccompose.c (IcFetch_transform):
- (IcFetcha_transform): Remove dead-code (useless n++).
-
-2004-01-22 Richard Worth <richard@theworths.org>
-
- * src/Makefile.am: Add '-no-undefined' to end of
- libpixman_la_LDFLAGS tp enable building shared libary under
- cygwin.
-
- * src/pixman.h: Remove all 'extern ' and ' __external_linkage'
- (macro for __declspec(dllexport) and __declspec(dllimport))
- from function declarations. These are no longer needed for cygwin.
-
-2003-12-17 Carl Worth <cworth@east.isi.edu>
-
- * src/pixman.h: Remove trailing commas from enum, (some compilers
- like to complain about this).
-
-2003-12-12 Dave Beckett <Dave.Beckett@bristol.ac.uk>
-
- * src/Makefile.am: Remove LIBPIXMAN_CFLAGS/LIBS cruft.
- (libpixman_la_SOURCES): slim_export.h slim_import.h gone.
-
-2003-12-12 Carl Worth <cworth@east.isi.edu>
-
- * src/pixman.h: Fold contents of slim_export/import.h directly
- into this file to avoid dependence on external slim package.
-
- * src/icint.h:
- * src/pixregionint.h: Use quote-based include now that
- slim_internal is an internal file.
-
- * src/icint.h: Follow convention of other files for
- multi-inclusion guard (_IC_INT_H_)
-
-
- * configure.in: Remove cruft.
-
-2003-12-10 Dave Beckett <Dave.Beckett@bristol.ac.uk>
-
- * update.pl: fixes for wrong order of renames
-
- * src/pixregion.c, src/pixman.h, src/ictri.c, src/ictrap.c, src/icimage.c, src/icformat.c, src/ic.c:
- Correct some more renames where the order of the renaming
- caused later renames to fail due to earlier prefixes failing.
-
- * update.pl: Add rename fixes
-
- * src/pixregionint.h, src/pixregion.c, src/pixman.h, src/ictri.c, src/ictrap.c, src/ictransform.c, src/icrect.c, src/icpixels.c, src/icint.h, src/icimage.h, src/icimage.c, src/icformat.c, src/iccompose.c, src/iccolor.c:
- Correct over-eager renames of the form pixman_thing_tName into
- pixman_thing_name. It was inevitable really this would happen!
-
- * update.pl: Added helper script for updating names in source.
-
- * src/pixregionint.h, src/pixregion.c, src/pixman.h, src/icutil.c, src/ictri.c, src/ictrap.c, src/ictransform.c, src/icstipple.c, src/icrop.h, src/icrect.c, src/icpixels.c, src/icint.h, src/icimage.h, src/icimage.c, src/icformat.c, src/iccompose.c, src/iccolor.c, src/icbltone.c, src/icblt.c, src/ic.c:
- Rename exported Ic* and PixRegion* functions, types, enums
- to be prefixed pixman (or PIXMAN for enum values)
-
- * libpixman.pc.in, README: libpixman is the pixel manipulation library
-
- * src/pixregionint.h, src/icint.h:
- Change ic.h/pixregion.h headers inclusions to be pixman.h
-
- * src/ic.h: Removed ic.h, merged into pixman.h
-
- * src/pixman.h:
- Merged pixregion.h (former name and CVS history of this file)
- and ic.h (now CVS deleted here).
-
- * src/Makefile.am:
- Updated for libpixregion,libic to libpixman source merges.
- Added -I$(srcdir) so we get internal headers from here even
- when srcdir != builddir.
-
- * libpixman.pc.in, configure.in, Makefile.am:
- Updated for libpixregion,libic to libpixman package name, dependencies.
-
- * README, COPYING, AUTHORS:
- Merge of libic, slim AUTHORS, COPYING, README
-
- * Initial repository copy of libpixregion, libic, slim CVS.
-
- * Constructed a merged ChangeLog below via emacs VC mode (which rocks!)
-
-2003-12-09 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libpixregion, autogen.sh, ChangeLog.libic:
- * autogen.sh: Allow names of all autofoo programs to be
- overridden via environment variables.
-
-2003-11-25 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/icutil.c:
- * configure.in: Bump version to 0.1.5 for new 64-bit fixes.
-
- * src/icutil.c (icStipple8Bits): One more fix needed for 64-bit
- machine (alpha in this case). Thanks to Jakub Bogusz
- <qboosh@pld-linux.org>.
-
-2003-11-17 Carl Worth <cworth@isi.edu>
-
- * src/icrop.h, src/icutil.c, ChangeLog.libic:
- * src/icutil.c (icStipple1Bits):
- * src/icrop.h (IcStipple16Bits): Fixes needed to compile libic on
- x86_64. Many thanks to David R Bacon <dbacon@cis.ksu.edu>.
-
-2003-11-06 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/ic.h: Removed stale version from ic.h.
- Better to have no version listed than the wrong one.
-
-2003-11-01 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/ic.h, src/icimage.c:
- Add IcImageGetDepth. Bump version to 0.1.3
-
-2003-10-29 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libpixregion, configure.in, ChangeLog.libic:
- Drop AC_CONFIG_AUX_DIR(config) as it was confusing "make distcheck"
-
- * ChangeLog.libic, src/icimage.c, src/icimage.h:
- Fix memory leak of image->transform.
- Remove currently unused DevUnion type and IcImageChange function.
-
- * ChangeLog.libic:
- Bumped version to 0.1.2 to indicate new IcOperator type.
-
- * ChangeLog.libic, src/ic.c, src/ic.h, src/icblt.c, src/icbltone.c, src/iccolor.c, src/iccompose.c, src/icimage.c, src/icimage.h, src/icint.h, src/icrect.c, src/ictransform.c, src/ictrap.c, src/ictri.c:
- Patch from Bryan Worth <bryan@theworths.org> to eliminate lots of leftover,
- undesired dependencies on X header files.
-
-2003-09-24 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.slim:
- Require __GNUC__ >= 3 before defining slim_hidden_def macro
-
-2003-09-23 Carl Worth <cworth@isi.edu>
-
- * src/slim_internal.h:
- Require __GNUC__ >= 3 before defining slim_hidden_def macro
-
-2003-09-10 Carl Worth <cworth@isi.edu>
-
- * src/ic.c, src/iccolor.c, src/icformat.c, src/icimage.c, src/icrect.c, ChangeLog.libic, ChangeLog.libpixregion, configure.in, src/pixregion.c:
- Updated calls to slim_hidden_def to track cahnges in slim 0.2.0
-
- * ChangeLog.slim: Bump version number to 0.2.0
-
- * ChangeLog.slim, src/slim_internal.h:
- Remove ';' from slim_hidden_def. Bump version to 0.1.1
-
-2003-09-05 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/ic.c, src/ic.h, src/icblt.c, src/icbltone.c, src/iccolor.c, src/iccompose.c, src/icformat.c, src/icimage.c, src/icimage.h, src/icint.h, src/icpixels.c, src/icrect.c, src/icrop.h, src/icstipple.c, src/ictransform.c, src/ictrap.c, src/ictri.c, src/icutil.c:
- Expose functions for creating IcFormat based on IcFormatName or masks.
- The actual IcFormat struct is no longer exposed.
- Bump version number to 0.1.1
-
- * ChangeLog.libic: Portability fix for OpenBSD (from Michael Schubert)
-
-2003-09-02 Carl Worth <cworth@isi.edu>
-
- * src/ic.h: Portability fix for OpenBSD (from Michael Schubert)
-
-2003-08-19 Carl Worth <cworth@isi.edu>
-
- * autogen.sh: Add --enable-maintainer-mode to autogen.sh
-
- * autogen.sh:
- Fixed to give a better warning if pkg-config is not installed
-
-2003-08-01 Richard Henderson <rth@twiddle.net>
-
- * ChangeLog.libic, src/iccolor.c:
- * src/iccolor.c (Ones): Define as __builtin_popcount when available.
-
-2003-07-31 Richard Henderson <rth@twiddle.net>
-
- * src/ic.c, src/ic.h, src/iccolor.c, src/iccompose.c, src/icformat.c, src/icimage.c, src/icimage.h, src/icint.h, src/icrect.c, src/icrop.h, src/ictri.c, ChangeLog.libic:
- * configure.in: Check for slim revision.
- * libic.pc.in: Depend on slim.
-
- * src/ic.c, src/iccompose.c: Don't include icimage.h.
- * src/icimage.h: Don't include ic.h.
-
- * src/ic.h: Include slim_{export,import}.h as appropriate. Mark all
- symbols __external_linkage.
- * src/icint.h: Include slim_import.h; mark symbols __internal_linkage;
- add slim hidden_proto declarations.
- * src/icimage.h: Mark all symbols __internal_linkage.
- * src/icrop.h: Likewise.
-
- * src/ic.c (IcComposite): Provide hidden definition.
- * src/iccolor.c (IcColorToPixel): Likewise.
- * src/icformat.c (IcFormatInit): Likewise.
- * src/icimage.c (IcImageCreate, IcImageDestroy): Likewise.
- (IcImageSetRepeat): Likewise.
- * src/icrect.c (IcFillRectangles): Likewise.
- * src/tri.c (IcRasterizeTriangle): Make static.
-
- * ChangeLog.slim, src/slim_internal.h:
- * src/slim_internal.h (__internal_linkage): Attribute visibility
- not present until gcc 3.3.
-
- * src/icimage.h, src/icrop.h, src/icutil.c, ChangeLog.libic, src/ic.c, src/icbltone.c, src/iccompose.c:
- * src/ic.c: Make everything but IcComposite static.
- * src/iccompose.c: Make everything except IcBuildCompositeOperand
- and IcCompositeGeneral static.
- * src/icbltone.c (Ic8Lane, Ic16Lane, Ic32Lane): Make static.
- (IcLaneTable): Turn into a function.
- (IcBltOne): Make IcLane const.
- (icStipple24Bits): Make static.
- * src/icimage.h: Remove lots of now static declarations.
- * src/icrop.h: Likewise.
- * src/icutil.c (icStipple8Bits, icStipple4Bits): Make static.
- (icStipple2Bits, icStipple1Bits): Make static.
- (IcStippleTable): Turn into a function.
-
-2003-07-30 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/ic.h: Committing missed ChangeLog entry
-
- * ChangeLog.libic, src/ic.h:
- Fixed IcRectangle to be compatible with XRectangle.
-
- * ChangeLog.libpixregion, configure.in, src/pixman.h:
- Removed false dependency on X.
-
-2003-07-30 Richard Henderson <rth@twiddle.net>
-
- * ChangeLog.slim:
- * Makefile.am (EXTRA_DIST, pkgconfigdir, pkgconfig_DATA): New.
- * configure.in (AC_OUTPUT): Add slim.pc.
- * slim.pc.in: New file.
-
- * ChangeLog.libpixregion, configure.in, libpixman.pc.in, src/pixman.h, src/pixregion.c, src/pixregionint.h:
- * configure.in: Run PKG_CHECK_MODULES on slim.
- * libpixregion.pc.in: Require slim.
- * src/pixregion.c (PixRegionCreateSimple): Mark hidden.
- (PixRegionCopy, PixRegionUnion): Mark hidden.
- * src/pixregion.h: Include and use X11/Xfuncproto.h. Include
- slim_{export,import}.h as appropriate. Mark all functions with
- __external_linkage.
- * src/pixregionint.h: Rename include protect to _PIXREGIONINT_H_.
-
- * src/slim_export.h, src/slim_import.h, src/slim_internal.h, ChangeLog.slim:
- * src/slim_internal.h: New file.
- * src/slim_export.h: New file.
- * src/slim_import.h: New file.
- * src/Makefile.am (include_HEADERS): Add them.
- * configure.in (AC_INIT): Check for src/slim_export.h
-
-2003-07-30 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.slim: Initial commit of slim shell
-
-2003-07-29 Carl Worth <cworth@isi.edu>
-
- * src/ic.c, src/ic.h, src/iccompose.c, src/icimage.h, src/icint.h:
- Replaced CARD*/INT* datatypes with stdint types (vektor@dumbterm.net).
-
-2003-07-10 Anders Carlsson <andersca@codefactory.se>
-
- * ChangeLog.libic:
- 2003-07-10 Anders Carlsson <andersca@codefactory.se>
-
- * autogen.sh:
- Pass --enable-maintainer-mode to configure
-
- * configure.in:
- Add compiler warning flags to CFLAGS.
-
-2003-07-09 Anders Carlsson <andersca@codefactory.se>
-
- * src/ic.h, src/icimage.c, ChangeLog.libic:
- 2003-07-09 Anders Carlsson <andersca@codefactory.se>
-
- * src/ic.h:
- * src/icimage.c: (IcImageGetData):
- Add accessor for getting a pointer to the image data.
-
-2003-07-08 Anders Carlsson <andersca@codefactory.se>
-
- * src/ic.h, src/icimage.c, ChangeLog.libic:
- 2003-07-09 Anders Carlsson <andersca@codefactory.se>
-
- * src/ic.h:
- * src/icimage.c: (IcImageGetWidth), (IcImageGetHeight),
- (IcImageGetStride):
- Add accessors.
-
-2003-05-29 Carl Worth <cworth@isi.edu>
-
- * src/ic.c, src/iccompose.c: Cleanup of some stale unused code.
-
-2003-05-15 Carl Worth <cworth@isi.edu>
-
- * src/ic.h, src/iccompose.c, src/icimage.c, src/icimage.h,
- src/icint.h, src/ictransform.c, ChangeLog.libic: Fixed
- transform/filter support
-
-2003-05-05 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/ictrap.c:
- Avoid crash in IcCompositeTrapezoids when there's nothing to draw.
-
-2003-04-26 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/icimage.c, src/icimage.h: Fixed memory leak
-
-2003-04-25 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/ic.h, src/icint.h, src/icrect.c,
- src/ictrap.c, src/ictri.c: Remove X datatypes from public
- interface
-
- * configure.in, src/Makefile.am, src/pixman.h, src/pixregionint.h:
- Fixed libtool versioning
-
- * ChangeLog.libic, src/ic.h:
- Fixed to not reference XFixed. Fixed libtool versioning
-
-2003-04-23 Carl Worth <cworth@isi.edu>
-
- * src/ic.h: extern "C" stuff to support C++ (Fredrik Hφglund)
-
-2003-04-22 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libpixregion, configure.in: Fixed typo (Owen Taylor)
-
-2003-04-17 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/ic.c, src/ic.h, src/iccolor.c,
- src/iccompose.c, src/icformat.c, src/icimage.c, src/icimage.h,
- src/icint.h, src/icpixels.c, src/icrect.c, src/ictrap.c,
- src/ictri.c: Removed reliance on server headers. Reowrked IcFormat
-
-2003-03-05 Carl Worth <cworth@isi.edu>
-
- * ChangeLog.libic, src/ic.h, src/icimage.h, src/icint.h:
- Updated to use libpixregion
-
-2003-02-25 Carl Worth <cworth@isi.edu>
-
- * src/ic.c, src/ic.h, src/iccompose.c, src/icimage.c,
- src/icimage.h, src/icint.h, src/ictrap.c, src/ictri.c: updated to
- use libpixregion instead of Xlib region code
-
- * ChangeLog.libpixregion, src/pixman.h, src/pixregion.c: API cleanup
-
- * src/.cvsignore, src/Makefile.am, src/pixman.h, src/pixregion.c,
- src/pixregionint.h: Initial import of libpixregion
-
- * src/.cvsignore, src/Makefile.am, src/pixman.h, src/pixregion.c,
- src/pixregionint.h: New file.
-
- * .cvsignore, AUTHORS, COPYING, ChangeLog.libpixregion, INSTALL,
- Makefile.am, NEWS, README, autogen.sh, configure.in,
- libpixman.pc.in: Initial import of libpixregion
-
- * .cvsignore, AUTHORS, COPYING, ChangeLog.libpixregion, INSTALL,
- Makefile.am, NEWS, README, autogen.sh, configure.in,
- libpixman.pc.in: New file.
-
-2003-02-21 Carl Worth <cworth@isi.edu>
-
- * src/ic.h, src/icimage.h, src/icint.h, src/ictrap.c, src/ictri.c:
- Added triangle support
-
- * src/ictransform.c, ChangeLog.libic, src/ic.c, src/icbltone.c,
- src/iccompose.c, src/icformat.c, src/icimage.c, src/icimage.h,
- src/icint.h, src/icutil.c: Some reorganization and cruft removal
-
- * src/ic.c, src/ic.h, src/icimage.c, src/icint.h, src/icpixels.c,
- src/icstipple.c, src/ictrap.c: Started cleaning up public libic
- interface
-
- * src/icimage.h, src/icint.h, src/icrop.h:
- Initial import of libic code, (still very preliminary).
-
- * src/icimage.h, src/icint.h, src/icrop.h: New file.
-
- * src/ictrap.c, src/ictri.c, src/icutil.c:
- Initial import of libic code, (still very preliminary).
-
- * src/ictrap.c, src/ictri.c, src/icutil.c: New file.
-
- * src/iccompose.c, src/icformat.c, src/icimage.c, src/icpixels.c, src/icrect.c, src/icstipple.c:
- Initial import of libic code, (still very preliminary).
-
- * src/iccompose.c, src/icformat.c, src/icimage.c, src/icpixels.c, src/icrect.c, src/icstipple.c:
- New file.
-
- * src/icbltone.c:
- Initial import of libic code, (still very preliminary).
-
- * src/icbltone.c: New file.
-
- * src/ic.c, src/ic.h, src/icblt.c:
- Initial import of libic code, (still very preliminary).
-
- * src/ic.c, src/ic.h, src/icblt.c: New file.
-
- * ChangeLog.libic:
- Initial import of libic code, (still very preliminary).
-
- * ChangeLog.libic: New file.
-
diff --git a/pixman/ChangeLog.libic b/pixman/ChangeLog.libic
deleted file mode 100644
index d6d709f62..000000000
--- a/pixman/ChangeLog.libic
+++ /dev/null
@@ -1,300 +0,0 @@
-2003-12-08 Carl Worth <cworth@isi.edu>
-
- * autogen.sh: Allow names of all autofoo programs to be
- overridden via environment variables.
-
-2003-11-25 Carl Worth <cworth@east.isi.edu>
-
- * configure.in: Bump version to 0.1.5 for new 64-bit fixes.
-
- * src/icutil.c (icStipple8Bits): One more fix needed for 64-bit
- machine (alpha in this case). Thanks to Jakub Bogusz
- <qboosh@pld-linux.org>.
-
-2003-11-17 Carl Worth <cworth@isi.edu>
-
- * src/icutil.c (icStipple1Bits):
- * src/icrop.h (IcStipple16Bits): Fixes needed to compile libic on
- x86_64. Many thanks to David R Bacon <dbacon@cis.ksu.edu>.
-
-2003-11-06 Carl Worth <cworth@east.isi.edu>
-
- * configure.in: Bump version to 0.1.4 just to mark removal of the
- version from ic.h, (so not an interesting change and nothing worth
- upgrading to).
-
- * src/ic.h: Remove IC_MAJOR, IC_MINOR, and IC_REVISION, (which
- were stale anyway so less than useful).
-
-2003-10-31 Carl Worth <cworth@isi.edu>
-
- * configure.in (LIBIC_VERSION): Bump version to 0.1.3 for new IcImageGetDepth.
-
- * src/icimage.c (IcImageGetDepth): Add IcImageGetDepth.
-
-2003-10-29 Carl Worth <cworth@isi.edu>
-
- * src/icimage.h: Remove currently unused DevUnion datatype to
- squelch compiler warning. Remove prototype for currently
- unimplemented IcImageChange function.
-
- * src/icimage.c (IcImageDestroy): Fixed memory leak of
- image->transform.
-
-2003-10-29 Carl Worth <cworth@east.isi.edu>
-
- * configure.in: Drop AC_CONFIG_AUX_DIR(config) as it was confusing
- "make distcheck"
-
-2003-10-29 Carl Worth <cworth@east.isi.edu>
-
- * configure.in: Bumped version to 0.1.2 to indicate new IcOperator
- type.
-
- * Everywhere: A large patch from Bryan Worth <bryan@theworths.org>
- to eliminate lots of leftover, undesired dependencies on X header
- files. More details below:
-
- * src/ictransform.c:
- * src/ictrap.c:
- * src/ictri.c:
- * src/icrect.c:
- * src/iccompose.c:
- * src/iccolor.c:
- * src/icbltone.c:
- * src/icblt.c:
- * src/icimage.h:
- * src/icimage.c:
- * src/ic.c:
- Replace CARD8/16/32 with uint8/16/32_t.
- Replace INT16 with int16_t.
- Use IcOperator in place of char or uint8_t.
- Replace Bool/FALSE/TRUE with int/0/1.
-
- * src/icint.h: Remove includes of X11/X.h, X11/Xmd.h,
- X11/Xprotostr.h and X11/extensions/Xrender.h. Add IcPoint. Lift
- definitions from X headers for Mask, GXor, ClipByChildren,
- PolyEdgeSharp, PolyModePrecise, CPClipMask, and CPLastBit.
-
- * src/icimage.h: Remove includes of X11/Xdefs.h and X11/Xprotostr.h.
- Replace "pointer" with "void *".
- Remove include of X11/Xutil.h.
- Replace DDXPointRec with IcPoint.
- Replace Atom/XID with unsigned long.
-
- * src/icimage.c: Remove instances of BadAlloc and Success.
- Replace XID with unsigned int.
- Replace "pointer" with "void *".
- Replace Atom with unsigned long.
-
- * src/ic.h: Introduce new IcOperator enum, rather than using char
- or uint8_t.
-
-2003-09-09 Carl Worth <cworth@isi.edu>
-
- * configure.in (SLIM_REQUIRED): Updated calls to slim_hidden_def
- to track changes in slim 0.2.0.
-
-2003-09-05 Carl Worth <cworth@isi.edu>
-
- * configure.in (LIBIC_VERSION): Bumped version to 0.1.1.
-
- * src/ictrap.c (IcCreateAlphaPicture): Fixed memory leak.
-
- * src/icimage.h: icimage->image_format now a struct not a
- pointer. Rename integral format_name to format_code.
-
- * src/iccompose.c: Remove unused functions: IcCombineSaturateU,
- IcCombineSaturateC, IcFetch_a2b2g2r2, IcFetch_c8, IcFetch_c4,
- IcFetch_g1, IcStore_c8, IcStore_g8, IcStore_c4, IcStore_g4,
- IcStore_g1.
-
- * src/iccolor.c (_IcOnes): Rename Ones to _IcOnes and expose it
- for internal use.
-
- * src/ic.h: Changed IcFormatName from an int to an enum.
- Changed IcFormat from an exposed struct to an opaque type.
- Now expose IcFormatCreate, IcFormatCreateMasks, and
- IcFormatDestroy.
-
-2003-09-02 Carl Worth <cworth@isi.edu>
-
- * src/ic.h: Include inttypes.h rather than stdint.h on OpenBSD,
- (Michael Schubert <michael@schubert.cx>)
-
-2003-07-31 Richard Henderson <rth@twiddle.net>
-
- * src/iccolor.c (Ones): Define as __builtin_popcount when available.
-
-2003-07-31 Richard Henderson <rth@twiddle.net>
-
- * configure.in: Check for slim revision.
- * libic.pc.in: Depend on slim.
-
- * src/ic.c, src/iccompose.c: Don't include icimage.h.
- * src/icimage.h: Don't include ic.h.
-
- * src/ic.h: Include slim_{export,import}.h as appropriate. Mark all
- symbols __external_linkage.
- * src/icint.h: Include slim_import.h; mark symbols __internal_linkage;
- add slim hidden_proto declarations.
- * src/icimage.h: Mark all symbols __internal_linkage.
- * src/icrop.h: Likewise.
-
- * src/ic.c (IcComposite): Provide hidden definition.
- * src/iccolor.c (IcColorToPixel): Likewise.
- * src/icformat.c (IcFormatInit): Likewise.
- * src/icimage.c (IcImageCreate, IcImageDestroy): Likewise.
- (IcImageSetRepeat): Likewise.
- * src/icrect.c (IcFillRectangles): Likewise.
- * src/tri.c (IcRasterizeTriangle): Make static.
-
-2003-07-31 Richard Henderson <rth@twiddle.net>
-
- * src/ic.c: Make everything but IcComposite static.
- * src/iccompose.c: Make everything except IcBuildCompositeOperand
- and IcCompositeGeneral static.
- * src/icbltone.c (Ic8Lane, Ic16Lane, Ic32Lane): Make static.
- (IcLaneTable): Turn into a function.
- (IcBltOne): Make IcLane const.
- (icStipple24Bits): Make static.
- * src/icimage.h: Remove lots of now static declarations.
- * src/icrop.h: Likewise.
- * src/icutil.c (icStipple8Bits, icStipple4Bits): Make static.
- (icStipple2Bits, icStipple1Bits): Make static.
- (IcStippleTable): Turn into a function.
-
-2003-07-30 Carl Worth <cworth@isi.edu>
-
- * src/ic.h: Fixed IcRectangle to be compatible with XRectangle.
-
-2003-07-29 Billy Biggs <vektor@dumbterm.net>
-
- * src/ic.h: Changed all references to CARD*/INT* to use stdint
- names, (eg. uint32_t, int32_t).
-
-2003-07-10 Anders Carlsson <andersca@codefactory.se>
-
- * autogen.sh:
- Pass --enable-maintainer-mode to configure
-
- * configure.in:
- Add compiler warning flags to CFLAGS.
-
-2003-07-09 Anders Carlsson <andersca@codefactory.se>
-
- * src/ic.h:
- * src/icimage.c: (IcImageGetData):
- Add accessor for getting a pointer to the image data.
-
-2003-07-09 Anders Carlsson <andersca@codefactory.se>
-
- * src/ic.h:
- * src/icimage.c: (IcImageGetWidth), (IcImageGetHeight),
- (IcImageGetStride):
- Add accessors.
-
-2003-05-14 Carl Worth <cworth@isi.edu>
-
- * src/ic.h: Add IcImageSetFilter. Fixed transform support.
-
-2003-05-05 Carl Worth <cworth@isi.edu>
-
- * src/ictrap.c (IcCompositeTrapezoids): Avoid crash if there's
- nothing to draw.
-
-2003-04-26 Carl Worth <cworth@isi.edu>
-
- * src/icimage.c (IcImageDestroy): Fix memory leak of image->pixels
- when owns_pixels == 1;
-
-2003-04-25 Carl Worth <cworth@east.isi.edu>
-
- * src/ic.h (IC_REVISION): Added #defines for version.
- Don't reference undefined XFixed datatype.
- Added IcFixed16_16, IcPointFixed, IcLineFixed, IcRectangle,
- IcTriangle, and IcTrapzezoid to eliminate X datatypes in public
- interface.
-
- * configure.in: Fixed libtool versioning.
-
-2003-04-17 Carl Worth <cworth@isi.edu>
-
- * src/icint.h: Removed reliance on some server include files,
- (this included copy and paste of Xserver/render/picture.h into
- icint.h)
-
- * src/icformat.c (IcFormatInit): Replaced public
- IcFormatCreate/IcFormatDestroy with IcFormatInit and an exposed
- IcFormat structure.
- (_IcFormatCreate): Tracked changes now that IcFormat no longer has
- direct and indexed sub-structure.
-
- * src/iccompose.c: Commented out all code supporting indexed
- formats.
-
- * src/ic.h: Expose IcFormat structure, (with no support for
- indexed formats).
-
- * src/ic.c (IcComposite): Track changes in IcImage structure
- (format vs. format_name)
-
-2003-03-10 Carl Worth <cworth@isi.edu>
-
- * src/Makefile.am (INCLUDES): Cleaned up to no longer require
- includes from X server source tree.
-
-2003-03-05 Carl Worth <cworth@isi.edu>
-
- * src/ictri.c (IcTriangles):
- (IcTriStrip):
- (IcTriFan): fixed argument order to match XRender
-
- * src/icrect.c (IcRectangle): Add IcRectangle convenience function.
- (IcRectangles): fixed argument order to match XRender
-
- * src/ictri.c (IcTriangles):
- (IcTriStrip):
- (IcTriFan): Removed format argument from IcTri* functions.
-
- * src/ictrap.c (IcTrapezoids): Removed format argument from
- IcTrapezoids.
-
- * src/icrect.c (IcRectangles): Initial (painfully slow)
- implementation of IcRectangles.
-
- * src/icimage.c (IcImageCreate): Simplified IcImageCreate, (no
- longer requires mask/vlist/error/error_value)
- (IcImageSetRepeat): Added IcImageSetRepeat
- (IcImageSetClipRegion): Implemented simple IcImageSetClipRegion.
-
-2003-02-25 Carl Worth <cworth@isi.edu>
-
- * src/icimage.c (IcImageInit):
- (IcImageDestroy):
- (IcImageDestroyClip):
- (IcClipImageReg):
- (IcClipImageSrc):
- (IcClipImageSrc):
- (SetPictureClipRects):
- (IcComputeCompositeRegion): Converted to use libpixregion rather
- than region code from Xlib.
-
- * src/iccompose.c (IcFetch_transform): Converted to use
- libpixregion rather than region code from Xlib.
-
- * src/ic.c (IcComposite): Converted to use libpixregion rather
- than region code from Xlib.
-
-2003-02-21 Carl Worth <cworth@isi.edu>
-
- * src/ictri.c (IcRasterizeTriangle): Added triangle support to
- libic.
-
- * src/ic.h: Started cleaning up the public interface of
- libic. Moved most of the cruft into icint.h.
-
-2003-02-20 Carl Worth <cworth@isi.edu>
-
- * AUTHORS: Added AUTHORS, NEWS, ChangeLog.
-
diff --git a/pixman/ChangeLog.libpixregion b/pixman/ChangeLog.libpixregion
deleted file mode 100644
index 75b071ebf..000000000
--- a/pixman/ChangeLog.libpixregion
+++ /dev/null
@@ -1,47 +0,0 @@
-2003-12-08 Carl Worth <cworth@isi.edu>
-
- * autogen.sh: Allow names of all autofoo programs to be
- overridden via environment variables.
-
-2003-10-29 Carl Worth <cworth@east.isi.edu>
-
- * configure.in: Drop AC_CONFIG_AUX_DIR(config) as it was confusing
- "make distcheck"
-
-2003-09-09 Carl Worth <cworth@isi.edu>
-
- * configure.in (SLIM_REQUIRED): Updated calls to slim_hidden_def
- to track changes in slim 0.2.0.
-
-2003-07-30 Carl Worth <cworth@east.isi.edu>
-
- * src/pixregion.h: Implement our own 'extern "C"' block to avoid
- false dependency on X.
-
- * configure.in: Remove unnecessary AC_PATH_XTRA check for X
- headers.
-
-2003-07-30 Richard Henderson <rth@twiddle.net>
-
- * configure.in: Run PKG_CHECK_MODULES on slim.
- * libpixregion.pc.in: Require slim.
- * src/pixregion.c (PixRegionCreateSimple): Mark hidden.
- (PixRegionCopy, PixRegionUnion): Mark hidden.
- * src/pixregion.h: Include and use X11/Xfuncproto.h. Include
- slim_{export,import}.h as appropriate. Mark all functions with
- __external_linkage.
- * src/pixregionint.h: Rename include protect to _PIXREGIONINT_H_.
-
-2003-04-22 Carl Worth <cworth@isi.edu>
-
- * configure.in (LIBPIXREGION_MAJOR_VERSION): Fixed typo (Owen Taylor)
-
-2003-02-25 Carl Worth <cworth@isi.edu>
-
- * src/pixregion.c (PixRegionCreateSimple): Eliminated useless size
- parameter from PixRegionCreateSized, (the server only ever calls
- it with a value of 1 or 0).
- (PixRegionInit):
- (PixRegionUninit):
- (PixRegionBreak): Changed these three functions to be static.
-
diff --git a/pixman/ChangeLog.slim b/pixman/ChangeLog.slim
deleted file mode 100644
index c830bf7e1..000000000
--- a/pixman/ChangeLog.slim
+++ /dev/null
@@ -1,39 +0,0 @@
-2003-09-23 Carl Worth <cworth@east.isi.edu>
-
- * src/slim_internal.h: The slim_hidden_def macros were causing
- build failures with gcc 2.95.4. I've bumped the test for these
- macros up to: __GNUC__ >= 3. We'll see if that's sufficient.
-
-2003-09-09 Carl Worth <cworth@isi.edu>
-
- * configure.in (SLIM_VERSION): Bump version number to 0.2.0
- instead, (this is an incompatible change after all).
-
- * configure.in (SLIM_VERSION): Bump version number to 0.1.1
-
- * src/slim_internal.h (slim_hidden_def): Remove ';' from macro
- definition, (forcing the user to provide it which looks better
- anyway). This also helps to avoid confusing etags.
-
-2003-07-31 Richard Henderson <rth@twiddle.net>
-
- * src/slim_internal.h (__internal_linkage): Attribute visibility
- not present until gcc 3.3.
-
-2003-07-30 Richard Henderson <rth@twiddle.net>
-
- * Makefile.am (EXTRA_DIST, pkgconfigdir, pkgconfig_DATA): New.
- * configure.in (AC_OUTPUT): Add slim.pc.
- * slim.pc.in: New file.
-
-2003-07-30 Richard Henderson <rth@twiddle.net>
-
- * src/slim_internal.h: New file.
- * src/slim_export.h: New file.
- * src/slim_import.h: New file.
- * src/Makefile.am (include_HEADERS): Add them.
- * configure.in (AC_INIT): Check for src/slim_export.h
-
-2003-07-29 Carl Worth <cworth@isi.edu>
-
- * Create package skeleton.
diff --git a/pixman/INSTALL b/pixman/INSTALL
deleted file mode 100644
index 5ccf1c308..000000000
--- a/pixman/INSTALL
+++ /dev/null
@@ -1,9 +0,0 @@
-This code uses automake, in order to generate the Makefiles use:
-
- $ autogen.sh
-
-After that, standard build procedures apply:
-
- $ make
- # make install
-
diff --git a/pixman/Makefile.am b/pixman/Makefile.am
deleted file mode 100644
index ceaf68e35..000000000
--- a/pixman/Makefile.am
+++ /dev/null
@@ -1,60 +0,0 @@
-SUBDIRS = . src
-
-EXTRA_DIST = \
- COPYING \
- ChangeLog.libic \
- ChangeLog.libpixregion \
- ChangeLog.slim \
- libpixman.pc.in
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libpixman.pc
-
-# Some custom targets to make it easier to release things.
-# Use either:
-# make release-check
-# or make release-publish
-
-RELEASE_UPLOAD_HOST = cairographics.org
-RELEASE_UPLOAD_DIR = /srv/cairo.freedesktop.org/www/snapshots
-RELEASE_URL_BASE = http://cairographics.org/snapshots
-RELEASE_ANNOUNCE_LIST = cairo-announce@cairographics.org
-
-tar_file = $(PACKAGE)-$(VERSION).tar.gz
-md5_file = $(tar_file).md5
-
-$(md5_file): $(tar_file)
- md5sum $^ > $@
-
-release-remove-old:
- rm -f $(tar_file) $(md5_file)
-
-release-check: release-remove-old distcheck $(md5_file)
-
-release-verify-newer:
- @echo -n "Checking that no $(VERSION) release already exists..."
- @ssh $(RELEASE_UPLOAD_HOST) test ! -e $(RELEASE_UPLOAD_DIR)/$(tar_file) \
- || (echo "Ouch." && echo "Found: $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)/$(tar_file)" \
- && echo "The version in configure.in must be incremented before a new release." \
- && false)
- @echo "Good."
-
-release-publish: release-verify-newer release-check
- mkdir -p releases
- scp $(tar_file) $(md5_file) $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)
- mv $(tar_file) $(md5_file) releases
- ssh $(RELEASE_UPLOAD_HOST) "rm -f $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-[0-9]* && touch $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
- @echo ""
- @echo "Please send an announcement to $(RELEASE_ANNOUNCE_LIST)"
- @echo "including the following:"
- @echo ""
- @echo "Subject: $(PACKAGE) snapshot $(VERSION) now available"
- @echo ""
- @echo "A new $(PACKAGE) snapshot $(VERSION) is now available from:"
- @echo ""
- @echo " $(RELEASE_URL_BASE)/$(tar_file)"
- @echo " $(RELEASE_URL_BASE)/$(md5_file)"
- @echo -n " "
- @cat releases/$(md5_file)
- @echo ""
- @echo "Also, please include the new entries from the NEWS file."
diff --git a/pixman/NEWS b/pixman/NEWS
deleted file mode 100644
index 62d005546..000000000
--- a/pixman/NEWS
+++ /dev/null
@@ -1,93 +0,0 @@
-Snapshot 0.1.4 (2005-03-07 Carl Worth <cworth@cworth.org>)
-==========================================================
-API Addition
-------------
-Add new function:
-
- void
- pixman_add_trapezoids (pixman_image_t *dst,
- int x_off,
- int y_off,
- const pixman_trapezoid_t *traps,
- int ntraps);
-
-Performance improvement
------------------------
-Restrict size of intermediate surface used while compositing
-trapezoids based on the bounds of the desination surface.
-
-Bug fixes
----------
-Fix rendering on 64-bit platforms.
-
-Snapshot 0.1.3 (2005-01-21 Carl Worth <cworth@cworth.org>)
-==========================================================
-Performance improvements
-------------------------
-Solid fills are now much faster, (thanks to Alexander Larsson).
-
-Bug fixes
----------
-Fixed to quiet warnings in newer versions of gcc.
-
-Don't divide-by-zero if given an image of size 0x0.
-
-Fixed several corner cases where values outside a trapezoid would be
-drawn with alpha 1/255 (in the 8-bit case).
-
-Internal changes
-----------------
-Imported the newer point-sampling trapezoid rasterization code that
-Keith Packard wrote for the X server. This provide pixel-perfect
-matching with the Render extension as well as code that is simpler,
-more robust, and easier to maintain.
-
-Snapshot 0.1.2 (2004-10-27 Carl Worth <cworth@cworth.org>)
-==========================================================
-New functionality
------------------
-Added three new functions:
-
- pixman_image_set_component_alpha
- pixman_format_get_masks
- pixman_image_get_format
-
-The first enables component-alpha compositing which can be used for
-optimizing sub-pixel rendering of text and other geometry. This is
-useful when the geometrical relationship of the sub-pixel components
-of the display device are known, (eg. with flat-panel monitors rather
-than CRTs).
-
-The other two functions are simple query functions that were missing.
-
-Bug fixes
----------
-Enabling both transform and repeat simultaneously now works.
-Some byte-order fixes.
-Clipping fixes: pixman now takes a copy of the client clipping region
- client clipping is now actually used, it wasn't earlier.
-
-Snapshot 0.1.1 (2004-04-16 Carl Worth <cworth@east.isi.edu>)
-============================================================
-Build fixes for cygwin
-----------------------
-This snapshot adds the -no-undefined flag during compilation which is
-necessart for building a shared library under cygwin.
-
-Cleanup of the public API
--------------------------
-We recently noticed that there were a coupld of bugs in the script
-that renamed libic to libpixman. Fixing this requires the following
-changes in the public API:
-
- PIXMAN_FORMAT_AR_GB32 -> PIXMAN_FORMAT_ARGB32
- PIXMAN_FORMAT_RG_B24 -> PIXMAN_FORMAT_RGB24
-
-While we're changing that, we also normalized the names of structure
-tags, for example:
-
- struct _pixman_region16_t -> struct pixman_region16
- etc.
-
-but users are expected to use typedefs such as pixman_region16_t
-anyway.
diff --git a/pixman/README b/pixman/README
deleted file mode 100644
index 621ab94bf..000000000
--- a/pixman/README
+++ /dev/null
@@ -1,47 +0,0 @@
-libpixman - Pixel manipulation library
-
-libpixman is a merge of libpixregion and libic.
-It also includes the slim headers.
-
-----------------------------------------------------------------------
-libpixregion - Pixel region Library
-
-libpixregion is a generic library for manipulating pixel regions. A
-PixRegion is a set of Y-X banded rectangles that cover the desired
-region.
-
-The original code for libxregion was part of the reference X server
-implementation of the X Window System. A modified copy of the code
-also exists in the Xlib client library. libpixregion was formed so
-that both the X server and client libraries could share common code
-for region manipulation.
-
-libpixregion is also intended to be applicable outside of the X Window
-System. The public interface of libpixregion does not depend on any
-part of the X Window System.
-
-----------------------------------------------------------------------
-libic - Image compositing library
-
-libic is a generic image compositing library. libic provides
-Porter/Duff compositing of images and implicit mask generation for
-geometric primitives including trapezoids, triangles, and rectangles.
-
-The semantics of libic are designed to precisely match the
-specification of the X Render extension. In fact, the initial
-implementation of libic was lifted from the reference implementation
-of RENDER from the X server.
-
-However, libic is intended to be useful independent of the X Window
-System. The public interface exported by libic does not contain any
-X-specific data structures.
-
-Carl Worth
-cworth@isi.edu
-
-Keith Packard (keithp@keithp.com) originally wrote all the original
-RENDER code that was yanked out to become libic. Keith also provided
-impetus and guidance in the development of libic.
-
-----------------------------------------------------------------------
-slim - Shared Library Interface Macros
diff --git a/pixman/RELEASING b/pixman/RELEASING
deleted file mode 100644
index 84349a99f..000000000
--- a/pixman/RELEASING
+++ /dev/null
@@ -1,81 +0,0 @@
-So far, libpixman hasn't reached an initial release. But we can still form
-good habits now by practicing the release process with the current
-snapshots.
-
-A new snapshot is needed whenever significant new features or bug
-fixes are committed. Here are the steps to follow:
-
-1) Ensure that there are no local, uncommitted modifications. The best
- thing to do here may be to begin with a fresh checkout from CVS:
-
- cvs -d cairographics.org:/cvs/cairo co libpixman
-
- But it's probably good enough if "cvs -q update -Ad" generates no
- output.
-
-2) Verify that the code passes "make distcheck"
-
- Running "make distcheck" should result in no warnings or
- errors and end with a message of the form:
-
- ================================================
- libpixman-X.Y.Z.tar.gz is ready for distribution
- ================================================
-
- (But the tar file isn't actually ready yet, as we still have
- some more steps to follow).
-
-3) Fill out an entry in the NEWS file
-
- Sift through the information in ChangeLog since the last
- snapshot. Summarize major changes briefly in a style similar
- to other entries in NEWS. Take special care to note any
- incompatible changes in the API. These should be easy to find
- by looking for pixman.h in the ChangeLog. Additionally, the
- output of the following command should be examined using the
- previous snapshot tag:
-
- cvs diff -r SNAPSHOT_X_Y_Z src/pixman.h
-
-4) Increment LIBPIXMAN_VERSION in configure.in
-
- First, remove the "-head" suffix, then increment the version
- as follows:
-
- If there are backward-incompatible changes in the API,
- (function removals, or semantic changes), increment the minor
- number and reset the sub-minor number to 0.
-
- Otherwise, (that is, if there are only bug fixes and perhaps
- API additions), then increment only the sub-minor number.
-
- Prior to the initial "1.0" release of cairo, leave the major
- number at 0. Also, do not modify the "libtool shared library
- version" variables, (LT_CURRENT, LT_VERSION, LT_AGE).
-
-5) Commit the changes to NEWS and configure.in
-
- Don't forget to fill out the ChangeLog just like with any
- other commit. It's especially important to mention the new
- version number in the ChangeLog.
-
-6) Run "make release-publish" which will perform the following steps
- for you:
-
- * Check that no release exists with the current version
- * Verify that make distcheck completes successfully
- * Generate the final tar file
- * Generate an md5sum file
- * scp both files to appear on http://cairographics.org/snapshots
- * Create a LATEST-package-version file (after deleting any old one)
- * Place local copies of both files in the releases directory
- * Provide some text for the release announcement (see below).
-
-7) Tag the entire source tree with a tag of the form SNAPSHOT_X_Y_Z:
-
- cvs tag SNAPSHOT_X_Y_Z
-
-8) Add a "-head" to CAIRO_VERSION in configure, and commit.
-
-9) Send a message to cairo-announce@cairographics.org to announce the
- new snapshot using the text provided from "make release-publish".
diff --git a/pixman/TODO b/pixman/TODO
deleted file mode 100644
index 5560d8de4..000000000
--- a/pixman/TODO
+++ /dev/null
@@ -1,10 +0,0 @@
-Need to finish up libpixman to the point where there X server can use
-it in place of its original copy of all this code (eg. in fb). This
-means merging features that have happened in either tree since the
-birth of libpixman. Off-hand I can think of the following things that
-have happened:
-
- * libpixman has fix for transform + repeat
- * X server has some (MMX? SSE?) optimized compositing code
-
-But see the logs for more details.
diff --git a/pixman/autogen.sh b/pixman/autogen.sh
deleted file mode 100755
index fe847d9eb..000000000
--- a/pixman/autogen.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-
-set -e
-
-LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
-LIBTOOLIZE_FLAGS="--copy --force"
-ACLOCAL=${ACLOCAL-aclocal}
-AUTOHEADER=${AUTOHEADER-autoheader}
-AUTOMAKE=${AUTOMAKE-automake}
-AUTOMAKE_FLAGS="--add-missing"
-AUTOCONF=${AUTOCONF-autoconf}
-
-ARGV0=$0
-
-if test -z "$ACLOCAL_FLAGS"; then
- acdir=`aclocal --print-ac-dir`
- if [ ! -f $acdir/pkg.m4 ]; then
- echo "$ARGV0: Error: Could not find pkg-config macros."
- echo " (Looked in $acdir/pkg.m4)"
- echo " If pkg.m4 is available in /another/directory, please set"
- echo " ACLOCAL_FLAGS=\"-I /another/directory\""
- echo " Otherwise, please install pkg-config."
- echo ""
- echo "pkg-config is available from:"
- echo "http://www.freedesktop.org/software/pkgconfig/"
- exit 1
- fi
-fi
-
-if test -z "$*"; then
- echo "$ARGV0: Note: \`./configure' will be run with no arguments."
- echo " If you wish to pass any to it, please specify them on the"
- echo " \`$0' command line."
- echo
-fi
-
-do_cmd() {
- echo "$ARGV0: running \`$@'"
- $@
-}
-
-do_cmd $LIBTOOLIZE $LIBTOOLIZE_FLAGS
-
-do_cmd $ACLOCAL $ACLOCAL_FLAGS
-
-do_cmd $AUTOHEADER
-
-do_cmd $AUTOMAKE $AUTOMAKE_FLAGS
-
-do_cmd $AUTOCONF
-
-do_cmd ./configure --enable-maintainer-mode ${1+"$@"} && echo "Now type \`make' to compile" || exit 1
diff --git a/pixman/configure.in b/pixman/configure.in
deleted file mode 100644
index 9fb24e7aa..000000000
--- a/pixman/configure.in
+++ /dev/null
@@ -1,59 +0,0 @@
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.54)
-
-AC_INIT(src/pixman.h)
-
-dnl ===========================================================================
-
-# Package version number, (as distinct from shared library version)
-LIBPIXMAN_VERSION=0.1.4-head
-
-# libtool shared library version
-
-# Increment if the interface has additions, changes, removals.
-LT_CURRENT=1
-
-# Increment any time the source changes; set to
-# 0 if you increment CURRENT
-LT_REVISION=0
-
-# Increment if any interfaces have been added; set to 0
-# if any interfaces have been removed. removal has
-# precedence over adding, so set to 0 if both happened.
-LT_AGE=0
-
-VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
-AC_SUBST(VERSION_INFO)
-
-dnl ===========================================================================
-
-AM_INIT_AUTOMAKE(libpixman, $LIBPIXMAN_VERSION)
-AM_CONFIG_HEADER(config.h)
-
-AM_MAINTAINER_MODE
-
-AC_PROG_CC
-AM_PROG_LIBTOOL
-
-AC_C_BIGENDIAN
-
-dnl Use lots of warning flags with GCC
-
-WARN_CFLAGS=""
-
-if test "x$GCC" = "xyes"; then
- WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
- -Wmissing-prototypes -Wmissing-declarations \
- -Wnested-externs -fno-strict-aliasing"
-fi
-
-AC_SUBST(WARN_CFLAGS)
-
-dnl ===========================================================================
-
-AC_OUTPUT([
-libpixman.pc
-Makefile
-src/Makefile
-])
diff --git a/pixman/libpixman.pc.in b/pixman/libpixman.pc.in
deleted file mode 100644
index 006018aa1..000000000
--- a/pixman/libpixman.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libpixman
-Description: Pixel manipulation library
-Version: @VERSION@
-Libs: -L${libdir} -lpixman
-Cflags: -I${includedir}
diff --git a/pixman/src/.cvsignore b/pixman/src/.cvsignore
deleted file mode 100644
index dce75bf1e..000000000
--- a/pixman/src/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile
-Makefile.in
-*.la
-*.lo
-.libs
-.deps
diff --git a/pixman/src/Makefile.am b/pixman/src/Makefile.am
deleted file mode 100644
index cde3c3f85..000000000
--- a/pixman/src/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-lib_LTLIBRARIES = libpixman.la
-include_HEADERS = pixman.h
-
-libpixman_la_SOURCES = \
- pixman.h \
- pixman-xserver-compat.h \
- pixregion.c \
- pixregionint.h \
- ic.c \
- icblt.c \
- icbltone.c \
- iccolor.c \
- iccompose.c \
- icformat.c \
- icimage.c \
- icimage.h \
- icint.h \
- icpixels.c \
- icrect.c \
- icrop.h \
- icstipple.c \
- ictrap.c \
- ictransform.c \
- ictri.c \
- icutil.c \
- fbedge.c \
- fbedgeimp.h \
- fbtrap.c \
- renderedge.c \
- renderedge.h \
- slim_internal.h
-
-libpixman_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined
-
-INCLUDES = -I$(srcdir) $(WARN_CFLAGS)
diff --git a/pixman/src/fbedge.c b/pixman/src/fbedge.c
deleted file mode 100644
index 6839317d8..000000000
--- a/pixman/src/fbedge.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * $Id: fbedge.c,v 1.2 2005-01-21 18:26:28 cworth Exp $
- *
- * Copyright Β© 2004 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "pixman-xserver-compat.h"
-
-#ifdef RENDER
-
-/*
- * 8 bit alpha
- */
-
-#define N_BITS 8
-#define rasterizeEdges fbRasterizeEdges8
-
-#define DefineAlpha(line,x) \
- CARD8 *__ap = (CARD8 *) line + (x)
-
-#define StepAlpha __ap++
-
-#define AddAlpha(a) { \
- CARD16 __a = a + *__ap; \
- *__ap = ((CARD8) ((__a) | (0 - ((__a) >> 8)))); \
-}
-
-#include "fbedgeimp.h"
-
-#undef AddAlpha
-#undef StepAlpha
-#undef DefineAlpha
-#undef rasterizeEdges
-#undef N_BITS
-
-/*
- * 4 bit alpha
- */
-
-#define N_BITS 4
-#define rasterizeEdges fbRasterizeEdges4
-
-#if BITMAP_BIT_ORDER == LSBFirst
-#define Shift4(o) ((o) << 2)
-#else
-#define Shift4(o) ((1-(o)) << 2)
-#endif
-
-#define Get4(x,o) (((x) >> Shift4(o)) & 0xf)
-#define Put4(x,o,v) (((x) & ~(0xf << Shift4(o))) | (((v) & 0xf) << Shift4(o)))
-
-#define DefineAlpha(line,x) \
- CARD8 *__ap = (CARD8 *) line + ((x) >> 1); \
- int __ao = (x) & 1
-
-#define StepAlpha ((__ap += __ao), (__ao ^= 1))
-
-#define AddAlpha(a) { \
- CARD8 __o = *__ap; \
- CARD8 __a = (a) + Get4(__o, __ao); \
- *__ap = Put4 (__o, __ao, __a | (0 - ((__a) >> 4))); \
-}
-
-#include "fbedgeimp.h"
-
-#undef AddAlpha
-#undef StepAlpha
-#undef DefineAlpha
-#undef rasterizeEdges
-#undef N_BITS
-
-
-/*
- * 1 bit alpha
- */
-
-#define N_BITS 1
-#define rasterizeEdges fbRasterizeEdges1
-
-#include "fbedgeimp.h"
-
-#undef rasterizeEdges
-#undef N_BITS
-
-void
-fbRasterizeEdges (FbBits *buf,
- int bpp,
- int width,
- int stride,
- RenderEdge *l,
- RenderEdge *r,
- xFixed t,
- xFixed b)
-{
- switch (bpp) {
- case 1:
- fbRasterizeEdges1 (buf, width, stride, l, r, t, b);
- break;
- case 4:
- fbRasterizeEdges4 (buf, width, stride, l, r, t, b);
- break;
- case 8:
- fbRasterizeEdges8 (buf, width, stride, l, r, t, b);
- break;
- }
-}
-
-#endif /* RENDER */
diff --git a/pixman/src/fbedgeimp.h b/pixman/src/fbedgeimp.h
deleted file mode 100644
index 87691faf2..000000000
--- a/pixman/src/fbedgeimp.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * $Id: fbedgeimp.h,v 1.2 2005-01-21 18:38:42 cworth Exp $
- *
- * Copyright Β© 2004 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef rasterizeSpan
-#endif
-
-static void
-rasterizeEdges (FbBits *buf,
- int width,
- int stride,
- RenderEdge *l,
- RenderEdge *r,
- xFixed t,
- xFixed b)
-{
- xFixed y = t;
- FbBits *line;
-
- line = buf + xFixedToInt (y) * stride;
-
- for (;;)
- {
- xFixed lx, rx;
- int lxi, rxi;
-
- /* clip X */
- lx = l->x;
- if (lx < 0)
- lx = 0;
- rx = r->x;
- if (xFixedToInt (rx) >= width)
- rx = IntToxFixed (width);
-
- /* Skip empty (or backwards) sections */
- if (rx > lx)
- {
-
- /* Find pixel bounds for span. */
- lxi = xFixedToInt (lx);
- rxi = xFixedToInt (rx);
-
-#if N_BITS == 1
- {
- FbBits *a = line;
- FbBits startmask, endmask;
- int nmiddle;
- int width = rxi - lxi;
- int x = lxi;
-
- a += x >> FB_SHIFT;
- x &= FB_MASK;
-
- FbMaskBits (x, width, startmask, nmiddle, endmask);
- if (startmask)
- *a++ |= startmask;
- while (nmiddle--)
- *a++ = FB_ALLONES;
- if (endmask)
- *a |= endmask;
- }
-#else
- {
- DefineAlpha(line,lxi);
- int lxs, rxs;
-
- /* Sample coverage for edge pixels */
- lxs = RenderSamplesX (lx, N_BITS);
- rxs = RenderSamplesX (rx, N_BITS);
-
- /* Add coverage across row */
- if (lxi == rxi)
- {
- AddAlpha (rxs - lxs);
- }
- else
- {
- int xi;
-
- AddAlpha (N_X_FRAC(N_BITS) - lxs);
- StepAlpha;
- for (xi = lxi + 1; xi < rxi; xi++)
- {
- AddAlpha (N_X_FRAC(N_BITS));
- StepAlpha;
- }
- /* Do not add in a 0 alpha here. This check is
- * necessary to avoid a buffer overrun, (when rx
- * is exactly on a pixel boundary). */
- if (rxs)
- AddAlpha (rxs);
- }
- }
-#endif
- }
-
- if (y == b)
- break;
-
-#if N_BITS > 1
- if (xFixedFrac (y) != Y_FRAC_LAST(N_BITS))
- {
- RenderEdgeStepSmall (l);
- RenderEdgeStepSmall (r);
- y += STEP_Y_SMALL(N_BITS);
- }
- else
-#endif
- {
- RenderEdgeStepBig (l);
- RenderEdgeStepBig (r);
- y += STEP_Y_BIG(N_BITS);
- line += stride;
- }
- }
-}
-
-#undef rasterizeSpan
diff --git a/pixman/src/fbtrap.c b/pixman/src/fbtrap.c
deleted file mode 100644
index e23b97d32..000000000
--- a/pixman/src/fbtrap.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * $Id: fbtrap.c,v 1.3 2005-01-21 18:26:28 cworth Exp $
- *
- * Copyright Β© 2004 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "pixman-xserver-compat.h"
-
-#ifdef RENDER
-
-/* XXX: Haven't added addTraps to libpixman yet. */
-#if 0
-void
-fbAddTraps (PicturePtr pPicture,
- INT16 x_off,
- INT16 y_off,
- int ntrap,
- xTrap *traps)
-{
- FbBits *buf;
- int bpp;
- int width;
- int stride;
- int height;
- int pxoff, pyoff;
-
- xFixed x_off_fixed;
- xFixed y_off_fixed;
- RenderEdge l, r;
- xFixed t, b;
-
- fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
-
- width = pPicture->pDrawable->width;
- height = pPicture->pDrawable->height;
- x_off += pxoff;
- y_off += pyoff;
-
- x_off_fixed = IntToxFixed(y_off);
- y_off_fixed = IntToxFixed(y_off);
-
- while (ntrap--)
- {
- t = traps->top.y + y_off_fixed;
- if (t < 0)
- t = 0;
- t = RenderSampleCeilY (t, bpp);
-
- b = traps->bot.y + y_off_fixed;
- if (xFixedToInt (b) >= height)
- b = IntToxFixed (height) - 1;
- b = RenderSampleFloorY (b, bpp);
-
- if (b >= t)
- {
- /* initialize edge walkers */
- RenderEdgeInit (&l, bpp, t,
- traps->top.l + x_off_fixed,
- traps->top.y + y_off_fixed,
- traps->bot.l + x_off_fixed,
- traps->bot.y + y_off_fixed);
-
- RenderEdgeInit (&r, bpp, t,
- traps->top.r + x_off_fixed,
- traps->top.y + y_off_fixed,
- traps->bot.r + x_off_fixed,
- traps->bot.y + y_off_fixed);
-
- fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
- }
- traps++;
- }
-}
-#endif
-
-void
-fbRasterizeTrapezoid (PicturePtr pPicture,
- const xTrapezoid *trap,
- int x_off,
- int y_off)
-{
- FbBits *buf;
- int bpp;
- int width;
- int stride;
- int height;
- int pxoff, pyoff;
-
- xFixed x_off_fixed;
- xFixed y_off_fixed;
- RenderEdge l, r;
- xFixed t, b;
-
- fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
-
- width = pPicture->pDrawable->width;
- height = pPicture->pDrawable->height;
- x_off += pxoff;
- y_off += pyoff;
-
- x_off_fixed = IntToxFixed(x_off);
- y_off_fixed = IntToxFixed(y_off);
- t = trap->top + y_off_fixed;
- if (t < 0)
- t = 0;
- t = RenderSampleCeilY (t, bpp);
-
- b = trap->bottom + y_off_fixed;
- if (xFixedToInt (b) >= height)
- b = IntToxFixed (height) - 1;
- b = RenderSampleFloorY (b, bpp);
-
- if (b >= t)
- {
- /* initialize edge walkers */
- RenderLineFixedEdgeInit (&l, bpp, t, &trap->left, x_off, y_off);
- RenderLineFixedEdgeInit (&r, bpp, t, &trap->right, x_off, y_off);
-
- fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
- }
-}
-
-/* XXX: Haven't add addTriangles to libpixman yet. */
-#if 0
-static int
-_GreaterY (xPointFixed *a, xPointFixed *b)
-{
- if (a->y == b->y)
- return a->x > b->x;
- return a->y > b->y;
-}
-
-/*
- * Note that the definition of this function is a bit odd because
- * of the X coordinate space (y increasing downwards).
- */
-static int
-_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b)
-{
- xPointFixed ad, bd;
-
- ad.x = a->x - ref->x;
- ad.y = a->y - ref->y;
- bd.x = b->x - ref->x;
- bd.y = b->y - ref->y;
-
- return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0;
-}
-
-/* FIXME -- this could be made more efficient */
-void
-fbAddTriangles (PicturePtr pPicture,
- INT16 x_off,
- INT16 y_off,
- int ntri,
- xTriangle *tris)
-{
- xPointFixed *top, *left, *right, *tmp;
- xTrapezoid trap;
-
- for (; ntri; ntri--, tris++)
- {
- top = &tris->p1;
- left = &tris->p2;
- right = &tris->p3;
- if (_GreaterY (top, left)) {
- tmp = left; left = top; top = tmp;
- }
- if (_GreaterY (top, right)) {
- tmp = right; right = top; top = tmp;
- }
- if (_Clockwise (top, right, left)) {
- tmp = right; right = left; left = tmp;
- }
-
- /*
- * Two cases:
- *
- * + +
- * / \ / \
- * / \ / \
- * / + + \
- * / -- -- \
- * / -- -- \
- * / --- --- \
- * +-- --+
- */
-
- trap.top = top->y;
- trap.left.p1 = *top;
- trap.left.p2 = *left;
- trap.right.p1 = *top;
- trap.right.p2 = *right;
- if (right->y < left->y)
- trap.bottom = right->y;
- else
- trap.bottom = left->y;
- fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
- if (right->y < left->y)
- {
- trap.top = right->y;
- trap.bottom = left->y;
- trap.right.p1 = *right;
- trap.right.p2 = *left;
- }
- else
- {
- trap.top = left->y;
- trap.bottom = right->y;
- trap.left.p1 = *left;
- trap.left.p2 = *right;
- }
- fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
- }
-}
-#endif
-
-#endif /* RENDER */
diff --git a/pixman/src/ic.c b/pixman/src/ic.c
deleted file mode 100644
index 231fb57db..000000000
--- a/pixman/src/ic.c
+++ /dev/null
@@ -1,1145 +0,0 @@
-/*
- * Copyright Β© 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "icint.h"
-
-#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \
- (((s) >> 5) & 0x07e0) | \
- (((s) >> 8) & 0xf800))
-#define cvt0565to8888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
- ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
- ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Fetch24(a) ((unsigned long) (a) & 1 ? \
- ((*(a) << 16) | *((uint16_t *) ((a)+1))) : \
- ((*((uint16_t *) (a)) << 8) | *((a)+2)))
-#define Store24(a,v) ((unsigned long) (a) & 1 ? \
- ((*(a) = (uint8_t) ((v) >> 16)), \
- (*((uint16_t *) ((a)+1)) = (uint16_t) (v))) : \
- ((*((uint16_t *) (a)) = (uint16_t) ((v) >> 8)), \
- (*((a)+2) = (uint8_t) (v))))
-#else
-#define Fetch24(a) ((unsigned long) (a) & 1 ? \
- ((*(a)) | (*((uint16_t *) ((a)+1)) << 8)) : \
- ((*((uint16_t *) (a))) | (*((a)+2) << 16)))
-#define Store24(a,v) ((unsigned long) (a) & 1 ? \
- ((*(a) = (uint8_t) (v)), \
- (*((uint16_t *) ((a)+1)) = (uint16_t) ((v) >> 8))) : \
- ((*((uint16_t *) (a)) = (uint16_t) (v)),\
- (*((a)+2) = (uint8_t) ((v) >> 16))))
-#endif
-
-static uint32_t
-IcOver (uint32_t x, uint32_t y)
-{
- uint16_t a = ~x >> 24;
- uint16_t t;
- uint32_t m,n,o,p;
-
- m = IcOverU(x,y,0,a,t);
- n = IcOverU(x,y,8,a,t);
- o = IcOverU(x,y,16,a,t);
- p = IcOverU(x,y,24,a,t);
- return m|n|o|p;
-}
-
-static uint32_t
-IcOver24 (uint32_t x, uint32_t y)
-{
- uint16_t a = ~x >> 24;
- uint16_t t;
- uint32_t m,n,o;
-
- m = IcOverU(x,y,0,a,t);
- n = IcOverU(x,y,8,a,t);
- o = IcOverU(x,y,16,a,t);
- return m|n|o;
-}
-
-static uint32_t
-IcIn (uint32_t x, uint8_t y)
-{
- uint16_t a = y;
- uint16_t t;
- uint32_t m,n,o,p;
-
- m = IcInU(x,0,a,t);
- n = IcInU(x,8,a,t);
- o = IcInU(x,16,a,t);
- p = IcInU(x,24,a,t);
- return m|n|o|p;
-}
-
-#define IcComposeGetSolid(image, bits) { \
- pixman_bits_t *__bits__; \
- IcStride __stride__; \
- int __bpp__; \
- int __xoff__,__yoff__; \
-\
- IcGetPixels((image)->pixels,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
- switch (__bpp__) { \
- case 32: \
- (bits) = *(uint32_t *) __bits__; \
- break; \
- case 24: \
- (bits) = Fetch24 ((uint8_t *) __bits__); \
- break; \
- case 16: \
- (bits) = *(uint16_t *) __bits__; \
- (bits) = cvt0565to8888(bits); \
- break; \
- default: \
- return; \
- } \
- /* manage missing src alpha */ \
- if ((image)->image_format.alphaMask == 0) \
- (bits) |= 0xff000000; \
-}
-
-#define IcComposeGetStart(image,x,y,type,stride,line,mul) {\
- pixman_bits_t *__bits__; \
- IcStride __stride__; \
- int __bpp__; \
- int __xoff__,__yoff__; \
-\
- IcGetPixels((image)->pixels,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
- (stride) = __stride__ * sizeof (pixman_bits_t) / sizeof (type); \
- (line) = ((type *) __bits__) + (stride) * ((y) - __yoff__) + (mul) * ((x) - __xoff__); \
-}
-
-/*
- * Naming convention:
- *
- * opSRCxMASKxDST
- */
-
-static void
-pixman_compositeSolidMask_nx8x8888 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint32_t src, srca;
- uint32_t *dstLine, *dst, d, dstMask;
- uint8_t *maskLine, *mask, m;
- IcStride dstStride, maskStride;
- uint16_t w;
-
- IcComposeGetSolid(iSrc, src);
-
- dstMask = IcFullMask (iDst->pixels->depth);
- srca = src >> 24;
- if (src == 0)
- return;
-
- IcComposeGetStart (iDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
- IcComposeGetStart (iMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- *dst = src & dstMask;
- else
- *dst = IcOver (src, *dst) & dstMask;
- }
- else if (m)
- {
- d = IcIn (src, m);
- *dst = IcOver (d, *dst) & dstMask;
- }
- dst++;
- }
- }
-}
-
-static void
-pixman_compositeSolidMask_nx8888x8888C (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint32_t src, srca;
- uint32_t *dstLine, *dst, d, dstMask;
- uint32_t *maskLine, *mask, ma;
- IcStride dstStride, maskStride;
- uint16_t w;
- uint32_t m, n, o, p;
-
- IcComposeGetSolid(iSrc, src);
-
- dstMask = IcFullMask (iDst->pixels->depth);
- srca = src >> 24;
- if (src == 0)
- return;
-
- IcComposeGetStart (iDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
- IcComposeGetStart (iMask, xMask, yMask, uint32_t, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- ma = *mask++;
- if (ma == 0xffffffff)
- {
- if (srca == 0xff)
- *dst = src & dstMask;
- else
- *dst = IcOver (src, *dst) & dstMask;
- }
- else if (ma)
- {
- d = *dst;
-#define IcInOverC(src,srca,msk,dst,i,result) { \
- uint16_t __a = IcGet8(msk,i); \
- uint32_t __t, __ta; \
- uint32_t __i; \
- __t = IcIntMult (IcGet8(src,i), __a,__i); \
- __ta = (uint8_t) ~IcIntMult (srca, __a,__i); \
- __t = __t + IcIntMult(IcGet8(dst,i),__ta,__i); \
- __t = (uint32_t) (uint8_t) (__t | (-(__t >> 8))); \
- result = __t << (i); \
-}
- IcInOverC (src, srca, ma, d, 0, m);
- IcInOverC (src, srca, ma, d, 8, n);
- IcInOverC (src, srca, ma, d, 16, o);
- IcInOverC (src, srca, ma, d, 24, p);
- *dst = m|n|o|p;
- }
- dst++;
- }
- }
-}
-
-static void
-pixman_compositeSolidMask_nx8x0888 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint32_t src, srca;
- uint8_t *dstLine, *dst;
- uint32_t d;
- uint8_t *maskLine, *mask, m;
- IcStride dstStride, maskStride;
- uint16_t w;
-
- IcComposeGetSolid(iSrc, src);
-
- srca = src >> 24;
- if (src == 0)
- return;
-
- IcComposeGetStart (iDst, xDst, yDst, uint8_t, dstStride, dstLine, 3);
- IcComposeGetStart (iMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- d = src;
- else
- {
- d = Fetch24(dst);
- d = IcOver24 (src, d);
- }
- Store24(dst,d);
- }
- else if (m)
- {
- d = IcOver24 (IcIn(src,m), Fetch24(dst));
- Store24(dst,d);
- }
- dst += 3;
- }
- }
-}
-
-static void
-pixman_compositeSolidMask_nx8x0565 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint32_t src, srca;
- uint16_t *dstLine, *dst;
- uint32_t d;
- uint8_t *maskLine, *mask, m;
- IcStride dstStride, maskStride;
- uint16_t w;
-
- IcComposeGetSolid(iSrc, src);
-
- srca = src >> 24;
- if (src == 0)
- return;
-
- IcComposeGetStart (iDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
- IcComposeGetStart (iMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- m = *mask++;
- if (m == 0xff)
- {
- if (srca == 0xff)
- d = src;
- else
- {
- d = *dst;
- d = IcOver24 (src, cvt0565to8888(d));
- }
- *dst = cvt8888to0565(d);
- }
- else if (m)
- {
- d = *dst;
- d = IcOver24 (IcIn(src,m), cvt0565to8888(d));
- *dst = cvt8888to0565(d);
- }
- dst++;
- }
- }
-}
-
-static void
-pixman_compositeSolidMask_nx8888x0565C (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint32_t src, srca;
- uint16_t src16;
- uint16_t *dstLine, *dst;
- uint32_t d;
- uint32_t *maskLine, *mask, ma;
- IcStride dstStride, maskStride;
- uint16_t w;
- uint32_t m, n, o;
-
- IcComposeGetSolid(iSrc, src);
-
- srca = src >> 24;
- if (src == 0)
- return;
-
- src16 = cvt8888to0565(src);
-
- IcComposeGetStart (iDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
- IcComposeGetStart (iMask, xMask, yMask, uint32_t, maskStride, maskLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- mask = maskLine;
- maskLine += maskStride;
- w = width;
-
- while (w--)
- {
- ma = *mask++;
- if (ma == 0xffffffff)
- {
- if (srca == 0xff)
- {
- *dst = src16;
- }
- else
- {
- d = *dst;
- d = IcOver24 (src, cvt0565to8888(d));
- *dst = cvt8888to0565(d);
- }
- }
- else if (ma)
- {
- d = *dst;
- d = cvt0565to8888(d);
- IcInOverC (src, srca, ma, d, 0, m);
- IcInOverC (src, srca, ma, d, 8, n);
- IcInOverC (src, srca, ma, d, 16, o);
- d = m|n|o;
- *dst = cvt8888to0565(d);
- }
- dst++;
- }
- }
-}
-
-static void
-pixman_compositeSrc_8888x8888 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint32_t *dstLine, *dst, dstMask;
- uint32_t *srcLine, *src, s;
- IcStride dstStride, srcStride;
- uint8_t a;
- uint16_t w;
-
- IcComposeGetStart (iDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
- IcComposeGetStart (iSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
-
- dstMask = IcFullMask (iDst->pixels->depth);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- a = s >> 24;
- if (a == 0xff)
- *dst = s & dstMask;
- else if (a)
- *dst = IcOver (s, *dst) & dstMask;
- dst++;
- }
- }
-}
-
-static void
-pixman_compositeSrc_8888x0888 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint8_t *dstLine, *dst;
- uint32_t d;
- uint32_t *srcLine, *src, s;
- uint8_t a;
- IcStride dstStride, srcStride;
- uint16_t w;
-
- IcComposeGetStart (iDst, xDst, yDst, uint8_t, dstStride, dstLine, 3);
- IcComposeGetStart (iSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- a = s >> 24;
- if (a)
- {
- if (a == 0xff)
- d = s;
- else
- d = IcOver24 (s, Fetch24(dst));
- Store24(dst,d);
- }
- dst += 3;
- }
- }
-}
-
-static void
-pixman_compositeSrc_8888x0565 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint16_t *dstLine, *dst;
- uint32_t d;
- uint32_t *srcLine, *src, s;
- uint8_t a;
- IcStride dstStride, srcStride;
- uint16_t w;
-
- IcComposeGetStart (iSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
- IcComposeGetStart (iDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- a = s >> 24;
- if (a)
- {
- if (a == 0xff)
- d = s;
- else
- {
- d = *dst;
- d = IcOver24 (s, cvt0565to8888(d));
- }
- *dst = cvt8888to0565(d);
- }
- dst++;
- }
- }
-}
-
-static void
-pixman_compositeSrc_0565x0565 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint16_t *dstLine, *dst;
- uint16_t *srcLine, *src;
- IcStride dstStride, srcStride;
- uint16_t w;
-
- IcComposeGetStart (iSrc, xSrc, ySrc, uint16_t, srcStride, srcLine, 1);
-
- IcComposeGetStart (iDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- *dst++ = *src++;
- }
-}
-
-static void
-pixman_compositeSrcAdd_8000x8000 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint8_t *dstLine, *dst;
- uint8_t *srcLine, *src;
- IcStride dstStride, srcStride;
- uint8_t w;
- uint8_t s, d;
- uint16_t t;
-
- IcComposeGetStart (iSrc, xSrc, ySrc, uint8_t, srcStride, srcLine, 1);
- IcComposeGetStart (iDst, xDst, yDst, uint8_t, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- if (s != 0xff)
- {
- d = *dst;
- t = d + s;
- s = t | (0 - (t >> 8));
- }
- *dst++ = s;
- }
- }
-}
-
-static void
-pixman_compositeSrcAdd_8888x8888 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- uint32_t *dstLine, *dst;
- uint32_t *srcLine, *src;
- IcStride dstStride, srcStride;
- uint16_t w;
- uint32_t s, d;
- uint16_t t;
- uint32_t m,n,o,p;
-
- IcComposeGetStart (iSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
- IcComposeGetStart (iDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
-
- while (height--)
- {
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w--)
- {
- s = *src++;
- if (s != 0xffffffff)
- {
- d = *dst;
- if (d)
- {
- m = IcAdd(s,d,0,t);
- n = IcAdd(s,d,8,t);
- o = IcAdd(s,d,16,t);
- p = IcAdd(s,d,24,t);
- s = m|n|o|p;
- }
- }
- *dst++ = s;
- }
- }
-}
-
-static void
-pixman_compositeSrcAdd_1000x1000 (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- pixman_bits_t *dstBits, *srcBits;
- IcStride dstStride, srcStride;
- int dstBpp, srcBpp;
- int dstXoff, dstYoff;
- int srcXoff, srcYoff;
-
- IcGetPixels(iSrc->pixels, srcBits, srcStride, srcBpp, srcXoff, srcYoff);
-
- IcGetPixels(iDst->pixels, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
-
- IcBlt (srcBits + srcStride * (ySrc + srcYoff),
- srcStride,
- xSrc + srcXoff,
-
- dstBits + dstStride * (yDst + dstYoff),
- dstStride,
- xDst + dstXoff,
-
- width,
- height,
-
- GXor,
- IC_ALLONES,
- srcBpp,
-
- 0,
- 0);
-}
-
-static void
-pixman_compositeSolidMask_nx1xn (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- pixman_bits_t *dstBits;
- IcStip *maskBits;
- IcStride dstStride, maskStride;
- int dstBpp, maskBpp;
- int dstXoff, dstYoff;
- int maskXoff, maskYoff;
- pixman_bits_t src;
-
- IcComposeGetSolid(iSrc, src);
-
- if ((src & 0xff000000) != 0xff000000)
- {
- pixman_compositeGeneral (op, iSrc, iMask, iDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height);
- return;
- }
- IcGetStipPixels (iMask->pixels, maskBits, maskStride, maskBpp, maskXoff, maskYoff);
- IcGetPixels (iDst->pixels, dstBits, dstStride, dstBpp, dstXoff, dstYoff);
-
- switch (dstBpp) {
- case 32:
- break;
- case 24:
- break;
- case 16:
- src = cvt8888to0565(src);
- break;
- }
-
- src = IcReplicatePixel (src, dstBpp);
-
- IcBltOne (maskBits + maskStride * (yMask + maskYoff),
- maskStride,
- xMask + maskXoff,
-
- dstBits + dstStride * (yDst + dstYoff),
- dstStride,
- (xDst + dstXoff) * dstBpp,
- dstBpp,
-
- width * dstBpp,
- height,
-
- 0x0,
- src,
- IC_ALLONES,
- 0x0);
-}
-
-void
-pixman_composite (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int xSrc,
- int ySrc,
- int xMask,
- int yMask,
- int xDst,
- int yDst,
- int width,
- int height)
-{
- pixman_region16_t *region;
- int n;
- pixman_box16_t *pbox;
- CompositeFunc func;
- int srcRepeat = iSrc->repeat;
- int maskRepeat = 0;
- int srcAlphaMap = iSrc->alphaMap != 0;
- int maskAlphaMap = 0;
- int dstAlphaMap = iDst->alphaMap != 0;
- int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
- int w, h, w_this, h_this;
-
- if (iSrc->pixels->width == 0 ||
- iSrc->pixels->height == 0)
- {
- return;
- }
-
- xDst += iDst->pixels->x;
- yDst += iDst->pixels->y;
- xSrc += iSrc->pixels->x;
- ySrc += iSrc->pixels->y;
- if (iMask)
- {
- xMask += iMask->pixels->x;
- yMask += iMask->pixels->y;
- maskRepeat = iMask->repeat;
- maskAlphaMap = iMask->alphaMap != 0;
- }
-
- region = pixman_region_create();
- pixman_region_union_rect (region, region, xDst, yDst, width, height);
-
- if (!IcComputeCompositeRegion (region,
- iSrc,
- iMask,
- iDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height))
- return;
-
- func = pixman_compositeGeneral;
- if (!iSrc->transform && !(iMask && iMask->transform))
- if (!maskAlphaMap && !srcAlphaMap && !dstAlphaMap)
- switch (op) {
- case PIXMAN_OPERATOR_OVER:
- if (iMask)
- {
- if (srcRepeat &&
- iSrc->pixels->width == 1 &&
- iSrc->pixels->height == 1)
- {
- srcRepeat = 0;
- if (PICT_FORMAT_COLOR(iSrc->format_code)) {
- switch (iMask->format_code) {
- case PICT_a8:
- switch (iDst->format_code) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
- func = pixman_compositeSolidMask_nx8x0565;
- break;
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- func = pixman_compositeSolidMask_nx8x0888;
- break;
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = pixman_compositeSolidMask_nx8x8888;
- break;
- }
- break;
- case PICT_a8r8g8b8:
- if (iMask->componentAlpha) {
- switch (iDst->format_code) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- func = pixman_compositeSolidMask_nx8888x8888C;
- break;
- case PICT_r5g6b5:
- func = pixman_compositeSolidMask_nx8888x0565C;
- break;
- }
- }
- break;
- case PICT_a8b8g8r8:
- if (iMask->componentAlpha) {
- switch (iDst->format_code) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = pixman_compositeSolidMask_nx8888x8888C;
- break;
- case PICT_b5g6r5:
- func = pixman_compositeSolidMask_nx8888x0565C;
- break;
- }
- }
- break;
- case PICT_a1:
- switch (iDst->format_code) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = pixman_compositeSolidMask_nx1xn;
- break;
- }
- }
- }
- }
- }
- else
- {
- switch (iSrc->format_code) {
- case PICT_a8r8g8b8:
- switch (iDst->format_code) {
- case PICT_a8r8g8b8:
- case PICT_x8r8g8b8:
- func = pixman_compositeSrc_8888x8888;
- break;
- case PICT_r8g8b8:
- func = pixman_compositeSrc_8888x0888;
- break;
- case PICT_r5g6b5:
- func = pixman_compositeSrc_8888x0565;
- break;
- }
- break;
- case PICT_a8b8g8r8:
- switch (iDst->format_code) {
- case PICT_a8b8g8r8:
- case PICT_x8b8g8r8:
- func = pixman_compositeSrc_8888x8888;
- break;
- case PICT_b8g8r8:
- func = pixman_compositeSrc_8888x0888;
- break;
- case PICT_b5g6r5:
- func = pixman_compositeSrc_8888x0565;
- break;
- }
- break;
- case PICT_r5g6b5:
- switch (iDst->format_code) {
- case PICT_r5g6b5:
- func = pixman_compositeSrc_0565x0565;
- break;
- }
- break;
- case PICT_b5g6r5:
- switch (iDst->format_code) {
- case PICT_b5g6r5:
- func = pixman_compositeSrc_0565x0565;
- break;
- }
- break;
- }
- }
- break;
- case PIXMAN_OPERATOR_ADD:
- if (iMask == 0)
- {
- switch (iSrc->format_code) {
- case PICT_a8r8g8b8:
- switch (iDst->format_code) {
- case PICT_a8r8g8b8:
- func = pixman_compositeSrcAdd_8888x8888;
- break;
- }
- break;
- case PICT_a8b8g8r8:
- switch (iDst->format_code) {
- case PICT_a8b8g8r8:
- func = pixman_compositeSrcAdd_8888x8888;
- break;
- }
- break;
- case PICT_a8:
- switch (iDst->format_code) {
- case PICT_a8:
- func = pixman_compositeSrcAdd_8000x8000;
- break;
- }
- break;
- case PICT_a1:
- switch (iDst->format_code) {
- case PICT_a1:
- func = pixman_compositeSrcAdd_1000x1000;
- break;
- }
- break;
- }
- }
- break;
- default:
- func = pixman_compositeGeneral;
- break;
- }
- /* if we are transforming, we handle repeats in
- * IcFetch[a]_transform
- */
- if (iSrc->transform)
- srcRepeat = 0;
- if (iMask && iMask->transform)
- maskRepeat = 0;
-
- n = pixman_region_num_rects (region);
- pbox = pixman_region_rects (region);
- while (n--)
- {
- h = pbox->y2 - pbox->y1;
- y_src = pbox->y1 - yDst + ySrc;
- y_msk = pbox->y1 - yDst + yMask;
- y_dst = pbox->y1;
- while (h)
- {
- h_this = h;
- w = pbox->x2 - pbox->x1;
- x_src = pbox->x1 - xDst + xSrc;
- x_msk = pbox->x1 - xDst + xMask;
- x_dst = pbox->x1;
- if (maskRepeat)
- {
- y_msk = MOD (y_msk, iMask->pixels->height);
- if (h_this > iMask->pixels->height - y_msk)
- h_this = iMask->pixels->height - y_msk;
- }
- if (srcRepeat)
- {
- y_src = MOD (y_src, iSrc->pixels->height);
- if (h_this > iSrc->pixels->height - y_src)
- h_this = iSrc->pixels->height - y_src;
- }
- while (w)
- {
- w_this = w;
- if (maskRepeat)
- {
- x_msk = MOD (x_msk, iMask->pixels->width);
- if (w_this > iMask->pixels->width - x_msk)
- w_this = iMask->pixels->width - x_msk;
- }
- if (srcRepeat)
- {
- x_src = MOD (x_src, iSrc->pixels->width);
- if (w_this > iSrc->pixels->width - x_src)
- w_this = iSrc->pixels->width - x_src;
- }
- (*func) (op, iSrc, iMask, iDst,
- x_src, y_src, x_msk, y_msk, x_dst, y_dst,
- w_this, h_this);
- w -= w_this;
- x_src += w_this;
- x_msk += w_this;
- x_dst += w_this;
- }
- h -= h_this;
- y_src += h_this;
- y_msk += h_this;
- y_dst += h_this;
- }
- pbox++;
- }
- pixman_region_destroy (region);
-}
-slim_hidden_def(pixman_composite);
diff --git a/pixman/src/icblt.c b/pixman/src/icblt.c
deleted file mode 100644
index a48d1ef78..000000000
--- a/pixman/src/icblt.c
+++ /dev/null
@@ -1,925 +0,0 @@
-/*
- * Id: $
- *
- * Copyright Β© 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "icint.h"
-
-#define InitializeShifts(sx,dx,ls,rs) { \
- if (sx != dx) { \
- if (sx > dx) { \
- ls = sx - dx; \
- rs = IC_UNIT - ls; \
- } else { \
- rs = dx - sx; \
- ls = IC_UNIT - rs; \
- } \
- } \
-}
-
-void
-IcBlt (pixman_bits_t *srcLine,
- IcStride srcStride,
- int srcX,
-
- pixman_bits_t *dstLine,
- IcStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- pixman_bits_t pm,
- int bpp,
-
- int reverse,
- int upsidedown)
-{
- pixman_bits_t *src, *dst;
- int leftShift, rightShift;
- pixman_bits_t startmask, endmask;
- pixman_bits_t bits, bits1;
- int n, nmiddle;
- int destInvarient;
- int startbyte, endbyte;
- IcDeclareMergeRop ();
-
-#ifdef IC_24BIT
- if (bpp == 24 && !IcCheck24Pix (pm))
- {
- IcBlt24 (srcLine, srcStride, srcX, dstLine, dstStride, dstX,
- width, height, alu, pm, reverse, upsidedown);
- return;
- }
-#endif
- IcInitializeMergeRop(alu, pm);
- destInvarient = IcDestInvarientMergeRop();
- if (upsidedown)
- {
- srcLine += (height - 1) * (srcStride);
- dstLine += (height - 1) * (dstStride);
- srcStride = -srcStride;
- dstStride = -dstStride;
- }
- IcMaskBitsBytes (dstX, width, destInvarient, startmask, startbyte,
- nmiddle, endmask, endbyte);
- if (reverse)
- {
- srcLine += ((srcX + width - 1) >> IC_SHIFT) + 1;
- dstLine += ((dstX + width - 1) >> IC_SHIFT) + 1;
- srcX = (srcX + width - 1) & IC_MASK;
- dstX = (dstX + width - 1) & IC_MASK;
- }
- else
- {
- srcLine += srcX >> IC_SHIFT;
- dstLine += dstX >> IC_SHIFT;
- srcX &= IC_MASK;
- dstX &= IC_MASK;
- }
- if (srcX == dstX)
- {
- while (height--)
- {
- src = srcLine;
- srcLine += srcStride;
- dst = dstLine;
- dstLine += dstStride;
- if (reverse)
- {
- if (endmask)
- {
- bits = *--src;
- --dst;
- IcDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- *--dst = IcDoDestInvarientMergeRop(*--src);
- }
- else
- {
- while (n--)
- {
- bits = *--src;
- --dst;
- *dst = IcDoMergeRop (bits, *dst);
- }
- }
- if (startmask)
- {
- bits = *--src;
- --dst;
- IcDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
- }
- }
- else
- {
- if (startmask)
- {
- bits = *src++;
- IcDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
-#if 0
- /*
- * This provides some speedup on screen->screen blts
- * over the PCI bus, usually about 10%. But Ic
- * isn't usually used for this operation...
- */
- if (_ca2 + 1 == 0 && _cx2 == 0)
- {
- pixman_bits_t t1, t2, t3, t4;
- while (n >= 4)
- {
- t1 = *src++;
- t2 = *src++;
- t3 = *src++;
- t4 = *src++;
- *dst++ = t1;
- *dst++ = t2;
- *dst++ = t3;
- *dst++ = t4;
- n -= 4;
- }
- }
-#endif
- while (n--)
- *dst++ = IcDoDestInvarientMergeRop(*src++);
- }
- else
- {
- while (n--)
- {
- bits = *src++;
- *dst = IcDoMergeRop (bits, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits = *src;
- IcDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
- }
- }
- }
- }
- else
- {
- if (srcX > dstX)
- {
- leftShift = srcX - dstX;
- rightShift = IC_UNIT - leftShift;
- }
- else
- {
- rightShift = dstX - srcX;
- leftShift = IC_UNIT - rightShift;
- }
- while (height--)
- {
- src = srcLine;
- srcLine += srcStride;
- dst = dstLine;
- dstLine += dstStride;
-
- bits1 = 0;
- if (reverse)
- {
- if (srcX < dstX)
- bits1 = *--src;
- if (endmask)
- {
- bits = IcScrRight(bits1, rightShift);
- if (IcScrRight(endmask, leftShift))
- {
- bits1 = *--src;
- bits |= IcScrLeft(bits1, leftShift);
- }
- --dst;
- IcDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits = IcScrRight(bits1, rightShift);
- bits1 = *--src;
- bits |= IcScrLeft(bits1, leftShift);
- --dst;
- *dst = IcDoDestInvarientMergeRop(bits);
- }
- }
- else
- {
- while (n--)
- {
- bits = IcScrRight(bits1, rightShift);
- bits1 = *--src;
- bits |= IcScrLeft(bits1, leftShift);
- --dst;
- *dst = IcDoMergeRop(bits, *dst);
- }
- }
- if (startmask)
- {
- bits = IcScrRight(bits1, rightShift);
- if (IcScrRight(startmask, leftShift))
- {
- bits1 = *--src;
- bits |= IcScrLeft(bits1, leftShift);
- }
- --dst;
- IcDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
- }
- }
- else
- {
- if (srcX > dstX)
- bits1 = *src++;
- if (startmask)
- {
- bits = IcScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= IcScrRight(bits1, rightShift);
- IcDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits = IcScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= IcScrRight(bits1, rightShift);
- *dst = IcDoDestInvarientMergeRop(bits);
- dst++;
- }
- }
- else
- {
- while (n--)
- {
- bits = IcScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= IcScrRight(bits1, rightShift);
- *dst = IcDoMergeRop(bits, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits = IcScrLeft(bits1, leftShift);
- if (IcScrLeft(endmask, rightShift))
- {
- bits1 = *src;
- bits |= IcScrRight(bits1, rightShift);
- }
- IcDoRightMaskByteMergeRop (dst, bits, endbyte, endmask);
- }
- }
- }
- }
-}
-
-#ifdef IC_24BIT
-
-#undef DEBUG_BLT24
-#ifdef DEBUG_BLT24
-
-static unsigned long
-getPixel (char *src, int x)
-{
- unsigned long l;
-
- l = 0;
- memcpy (&l, src + x * 3, 3);
- return l;
-}
-#endif
-
-static void
-IcBlt24Line (pixman_bits_t *src,
- int srcX,
-
- pixman_bits_t *dst,
- int dstX,
-
- int width,
-
- int alu,
- pixman_bits_t pm,
-
- int reverse)
-{
-#ifdef DEBUG_BLT24
- char *origDst = (char *) dst;
- pixman_bits_t *origLine = dst + ((dstX >> IC_SHIFT) - 1);
- int origNlw = ((width + IC_MASK) >> IC_SHIFT) + 3;
- int origX = dstX / 24;
-#endif
-
- int leftShift, rightShift;
- pixman_bits_t startmask, endmask;
- int n;
-
- pixman_bits_t bits, bits1;
- pixman_bits_t mask;
-
- int rot;
- IcDeclareMergeRop ();
-
- IcInitializeMergeRop (alu, IC_ALLONES);
- IcMaskBits(dstX, width, startmask, n, endmask);
-#ifdef DEBUG_BLT24
- ErrorF ("dstX %d width %d reverse %d\n", dstX, width, reverse);
-#endif
- if (reverse)
- {
- src += ((srcX + width - 1) >> IC_SHIFT) + 1;
- dst += ((dstX + width - 1) >> IC_SHIFT) + 1;
- rot = IcFirst24Rot (((dstX + width - 8) & IC_MASK));
- rot = IcPrev24Rot(rot);
-#ifdef DEBUG_BLT24
- ErrorF ("dstX + width - 8: %d rot: %d\n", (dstX + width - 8) & IC_MASK, rot);
-#endif
- srcX = (srcX + width - 1) & IC_MASK;
- dstX = (dstX + width - 1) & IC_MASK;
- }
- else
- {
- src += srcX >> IC_SHIFT;
- dst += dstX >> IC_SHIFT;
- srcX &= IC_MASK;
- dstX &= IC_MASK;
- rot = IcFirst24Rot (dstX);
-#ifdef DEBUG_BLT24
- ErrorF ("dstX: %d rot: %d\n", dstX, rot);
-#endif
- }
- mask = IcRot24(pm,rot);
-#ifdef DEBUG_BLT24
- ErrorF ("pm 0x%x mask 0x%x\n", pm, mask);
-#endif
- if (srcX == dstX)
- {
- if (reverse)
- {
- if (endmask)
- {
- bits = *--src;
- --dst;
- *dst = IcDoMaskMergeRop (bits, *dst, mask & endmask);
- mask = IcPrev24Pix (mask);
- }
- while (n--)
- {
- bits = *--src;
- --dst;
- *dst = IcDoMaskMergeRop (bits, *dst, mask);
- mask = IcPrev24Pix (mask);
- }
- if (startmask)
- {
- bits = *--src;
- --dst;
- *dst = IcDoMaskMergeRop(bits, *dst, mask & startmask);
- }
- }
- else
- {
- if (startmask)
- {
- bits = *src++;
- *dst = IcDoMaskMergeRop (bits, *dst, mask & startmask);
- dst++;
- mask = IcNext24Pix(mask);
- }
- while (n--)
- {
- bits = *src++;
- *dst = IcDoMaskMergeRop (bits, *dst, mask);
- dst++;
- mask = IcNext24Pix(mask);
- }
- if (endmask)
- {
- bits = *src;
- *dst = IcDoMaskMergeRop(bits, *dst, mask & endmask);
- }
- }
- }
- else
- {
- if (srcX > dstX)
- {
- leftShift = srcX - dstX;
- rightShift = IC_UNIT - leftShift;
- }
- else
- {
- rightShift = dstX - srcX;
- leftShift = IC_UNIT - rightShift;
- }
-
- bits1 = 0;
- if (reverse)
- {
- if (srcX < dstX)
- bits1 = *--src;
- if (endmask)
- {
- bits = IcScrRight(bits1, rightShift);
- if (IcScrRight(endmask, leftShift))
- {
- bits1 = *--src;
- bits |= IcScrLeft(bits1, leftShift);
- }
- --dst;
- *dst = IcDoMaskMergeRop (bits, *dst, mask & endmask);
- mask = IcPrev24Pix(mask);
- }
- while (n--)
- {
- bits = IcScrRight(bits1, rightShift);
- bits1 = *--src;
- bits |= IcScrLeft(bits1, leftShift);
- --dst;
- *dst = IcDoMaskMergeRop(bits, *dst, mask);
- mask = IcPrev24Pix(mask);
- }
- if (startmask)
- {
- bits = IcScrRight(bits1, rightShift);
- if (IcScrRight(startmask, leftShift))
- {
- bits1 = *--src;
- bits |= IcScrLeft(bits1, leftShift);
- }
- --dst;
- *dst = IcDoMaskMergeRop (bits, *dst, mask & startmask);
- }
- }
- else
- {
- if (srcX > dstX)
- bits1 = *src++;
- if (startmask)
- {
- bits = IcScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= IcScrRight(bits1, rightShift);
- *dst = IcDoMaskMergeRop (bits, *dst, mask & startmask);
- dst++;
- mask = IcNext24Pix(mask);
- }
- while (n--)
- {
- bits = IcScrLeft(bits1, leftShift);
- bits1 = *src++;
- bits |= IcScrRight(bits1, rightShift);
- *dst = IcDoMaskMergeRop(bits, *dst, mask);
- dst++;
- mask = IcNext24Pix(mask);
- }
- if (endmask)
- {
- bits = IcScrLeft(bits1, leftShift);
- if (IcScrLeft(endmask, rightShift))
- {
- bits1 = *src;
- bits |= IcScrRight(bits1, rightShift);
- }
- *dst = IcDoMaskMergeRop (bits, *dst, mask & endmask);
- }
- }
- }
-#ifdef DEBUG_BLT24
- {
- int firstx, lastx, x;
-
- firstx = origX;
- if (firstx)
- firstx--;
- lastx = origX + width/24 + 1;
- for (x = firstx; x <= lastx; x++)
- ErrorF ("%06x ", getPixel (origDst, x));
- ErrorF ("\n");
- while (origNlw--)
- ErrorF ("%08x ", *origLine++);
- ErrorF ("\n");
- }
-#endif
-}
-
-void
-IcBlt24 (pixman_bits_t *srcLine,
- IcStride srcStride,
- int srcX,
-
- pixman_bits_t *dstLine,
- IcStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- pixman_bits_t pm,
-
- int reverse,
- int upsidedown)
-{
- if (upsidedown)
- {
- srcLine += (height-1) * srcStride;
- dstLine += (height-1) * dstStride;
- srcStride = -srcStride;
- dstStride = -dstStride;
- }
- while (height--)
- {
- IcBlt24Line (srcLine, srcX, dstLine, dstX, width, alu, pm, reverse);
- srcLine += srcStride;
- dstLine += dstStride;
- }
-#ifdef DEBUG_BLT24
- ErrorF ("\n");
-#endif
-}
-#endif /* IC_24BIT */
-
-#if IC_SHIFT == IC_STIP_SHIFT + 1
-
-/*
- * Could be generalized to IC_SHIFT > IC_STIP_SHIFT + 1 by
- * creating an ring of values stepped through for each line
- */
-
-void
-IcBltOdd (pixman_bits_t *srcLine,
- IcStride srcStrideEven,
- IcStride srcStrideOdd,
- int srcXEven,
- int srcXOdd,
-
- pixman_bits_t *dstLine,
- IcStride dstStrideEven,
- IcStride dstStrideOdd,
- int dstXEven,
- int dstXOdd,
-
- int width,
- int height,
-
- int alu,
- pixman_bits_t pm,
- int bpp)
-{
- pixman_bits_t *src;
- int leftShiftEven, rightShiftEven;
- pixman_bits_t startmaskEven, endmaskEven;
- int nmiddleEven;
-
- pixman_bits_t *dst;
- int leftShiftOdd, rightShiftOdd;
- pixman_bits_t startmaskOdd, endmaskOdd;
- int nmiddleOdd;
-
- int leftShift, rightShift;
- pixman_bits_t startmask, endmask;
- int nmiddle;
-
- int srcX, dstX;
-
- pixman_bits_t bits, bits1;
- int n;
-
- int destInvarient;
- int even;
- IcDeclareMergeRop ();
-
- IcInitializeMergeRop (alu, pm);
- destInvarient = IcDestInvarientMergeRop();
-
- srcLine += srcXEven >> IC_SHIFT;
- dstLine += dstXEven >> IC_SHIFT;
- srcXEven &= IC_MASK;
- dstXEven &= IC_MASK;
- srcXOdd &= IC_MASK;
- dstXOdd &= IC_MASK;
-
- IcMaskBits(dstXEven, width, startmaskEven, nmiddleEven, endmaskEven);
- IcMaskBits(dstXOdd, width, startmaskOdd, nmiddleOdd, endmaskOdd);
-
- even = 1;
- InitializeShifts(srcXEven, dstXEven, leftShiftEven, rightShiftEven);
- InitializeShifts(srcXOdd, dstXOdd, leftShiftOdd, rightShiftOdd);
- while (height--)
- {
- src = srcLine;
- dst = dstLine;
- if (even)
- {
- srcX = srcXEven;
- dstX = dstXEven;
- startmask = startmaskEven;
- endmask = endmaskEven;
- nmiddle = nmiddleEven;
- leftShift = leftShiftEven;
- rightShift = rightShiftEven;
- srcLine += srcStrideEven;
- dstLine += dstStrideEven;
- even = 0;
- }
- else
- {
- srcX = srcXOdd;
- dstX = dstXOdd;
- startmask = startmaskOdd;
- endmask = endmaskOdd;
- nmiddle = nmiddleOdd;
- leftShift = leftShiftOdd;
- rightShift = rightShiftOdd;
- srcLine += srcStrideOdd;
- dstLine += dstStrideOdd;
- even = 1;
- }
- if (srcX == dstX)
- {
- if (startmask)
- {
- bits = *src++;
- *dst = IcDoMaskMergeRop (bits, *dst, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits = *src++;
- *dst = IcDoDestInvarientMergeRop(bits);
- dst++;
- }
- }
- else
- {
- while (n--)
- {
- bits = *src++;
- *dst = IcDoMergeRop (bits, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits = *src;
- *dst = IcDoMaskMergeRop(bits, *dst, endmask);
- }
- }
- else
- {
- bits = 0;
- if (srcX > dstX)
- bits = *src++;
- if (startmask)
- {
- bits1 = IcScrLeft(bits, leftShift);
- bits = *src++;
- bits1 |= IcScrRight(bits, rightShift);
- *dst = IcDoMaskMergeRop (bits1, *dst, startmask);
- dst++;
- }
- n = nmiddle;
- if (destInvarient)
- {
- while (n--)
- {
- bits1 = IcScrLeft(bits, leftShift);
- bits = *src++;
- bits1 |= IcScrRight(bits, rightShift);
- *dst = IcDoDestInvarientMergeRop(bits1);
- dst++;
- }
- }
- else
- {
- while (n--)
- {
- bits1 = IcScrLeft(bits, leftShift);
- bits = *src++;
- bits1 |= IcScrRight(bits, rightShift);
- *dst = IcDoMergeRop(bits1, *dst);
- dst++;
- }
- }
- if (endmask)
- {
- bits1 = IcScrLeft(bits, leftShift);
- if (IcScrLeft(endmask, rightShift))
- {
- bits = *src;
- bits1 |= IcScrRight(bits, rightShift);
- }
- *dst = IcDoMaskMergeRop (bits1, *dst, endmask);
- }
- }
- }
-}
-
-#ifdef IC_24BIT
-void
-IcBltOdd24 (pixman_bits_t *srcLine,
- IcStride srcStrideEven,
- IcStride srcStrideOdd,
- int srcXEven,
- int srcXOdd,
-
- pixman_bits_t *dstLine,
- IcStride dstStrideEven,
- IcStride dstStrideOdd,
- int dstXEven,
- int dstXOdd,
-
- int width,
- int height,
-
- int alu,
- pixman_bits_t pm)
-{
- int even = 1;
-
- while (height--)
- {
- if (even)
- {
- IcBlt24Line (srcLine, srcXEven, dstLine, dstXEven,
- width, alu, pm, 0);
- srcLine += srcStrideEven;
- dstLine += dstStrideEven;
- even = 0;
- }
- else
- {
- IcBlt24Line (srcLine, srcXOdd, dstLine, dstXOdd,
- width, alu, pm, 0);
- srcLine += srcStrideOdd;
- dstLine += dstStrideOdd;
- even = 1;
- }
- }
-#if 0
- fprintf (stderr, "\n");
-#endif
-}
-#endif
-
-#endif
-
-#if IC_STIP_SHIFT != IC_SHIFT
-void
-IcSetBltOdd (IcStip *stip,
- IcStride stipStride,
- int srcX,
- pixman_bits_t **bits,
- IcStride *strideEven,
- IcStride *strideOdd,
- int *srcXEven,
- int *srcXOdd)
-{
- int srcAdjust;
- int strideAdjust;
-
- /*
- * bytes needed to align source
- */
- srcAdjust = (((int) stip) & (IC_MASK >> 3));
- /*
- * IcStip units needed to align stride
- */
- strideAdjust = stipStride & (IC_MASK >> IC_STIP_SHIFT);
-
- *bits = (pixman_bits_t *) ((char *) stip - srcAdjust);
- if (srcAdjust)
- {
- *strideEven = IcStipStrideToBitsStride (stipStride + 1);
- *strideOdd = IcStipStrideToBitsStride (stipStride);
-
- *srcXEven = srcX + (srcAdjust << 3);
- *srcXOdd = srcX + (srcAdjust << 3) - (strideAdjust << IC_STIP_SHIFT);
- }
- else
- {
- *strideEven = IcStipStrideToBitsStride (stipStride);
- *strideOdd = IcStipStrideToBitsStride (stipStride + 1);
-
- *srcXEven = srcX;
- *srcXOdd = srcX + (strideAdjust << IC_STIP_SHIFT);
- }
-}
-#endif
-
-void
-IcBltStip (IcStip *src,
- IcStride srcStride, /* in IcStip units, not pixman_bits_t units */
- int srcX,
-
- IcStip *dst,
- IcStride dstStride, /* in IcStip units, not pixman_bits_t units */
- int dstX,
-
- int width,
- int height,
-
- int alu,
- pixman_bits_t pm,
- int bpp)
-{
-#if IC_STIP_SHIFT != IC_SHIFT
- if (IC_STIP_ODDSTRIDE(srcStride) || IC_STIP_ODDPTR(src) ||
- IC_STIP_ODDSTRIDE(dstStride) || IC_STIP_ODDPTR(dst))
- {
- IcStride srcStrideEven, srcStrideOdd;
- IcStride dstStrideEven, dstStrideOdd;
- int srcXEven, srcXOdd;
- int dstXEven, dstXOdd;
- pixman_bits_t *s, *d;
- int sx, dx;
-
- src += srcX >> IC_STIP_SHIFT;
- srcX &= IC_STIP_MASK;
- dst += dstX >> IC_STIP_SHIFT;
- dstX &= IC_STIP_MASK;
-
- IcSetBltOdd (src, srcStride, srcX,
- &s,
- &srcStrideEven, &srcStrideOdd,
- &srcXEven, &srcXOdd);
-
- IcSetBltOdd (dst, dstStride, dstX,
- &d,
- &dstStrideEven, &dstStrideOdd,
- &dstXEven, &dstXOdd);
-
-#ifdef IC_24BIT
- if (bpp == 24 && !IcCheck24Pix (pm))
- {
- IcBltOdd24 (s, srcStrideEven, srcStrideOdd,
- srcXEven, srcXOdd,
-
- d, dstStrideEven, dstStrideOdd,
- dstXEven, dstXOdd,
-
- width, height, alu, pm);
- }
- else
-#endif
- {
- IcBltOdd (s, srcStrideEven, srcStrideOdd,
- srcXEven, srcXOdd,
-
- d, dstStrideEven, dstStrideOdd,
- dstXEven, dstXOdd,
-
- width, height, alu, pm, bpp);
- }
- }
- else
-#endif
- {
- IcBlt ((pixman_bits_t *) src, IcStipStrideToBitsStride (srcStride),
- srcX,
- (pixman_bits_t *) dst, IcStipStrideToBitsStride (dstStride),
- dstX,
- width, height,
- alu, pm, bpp, 0, 0);
- }
-}
diff --git a/pixman/src/icbltone.c b/pixman/src/icbltone.c
deleted file mode 100644
index 7d1fd5ff6..000000000
--- a/pixman/src/icbltone.c
+++ /dev/null
@@ -1,742 +0,0 @@
-/*
- * Id: $
- *
- * Copyright Β© 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "icint.h"
-
-/*
- * Example: srcX = 13 dstX = 8 (IC unit 32 dstBpp 8)
- *
- * **** **** **** **** **** **** **** ****
- * ^
- * ******** ******** ******** ********
- * ^
- * leftShift = 12
- * rightShift = 20
- *
- * Example: srcX = 0 dstX = 8 (IC unit 32 dstBpp 8)
- *
- * **** **** **** **** **** **** **** ****
- * ^
- * ******** ******** ******** ********
- * ^
- *
- * leftShift = 24
- * rightShift = 8
- */
-
-#define LoadBits {\
- if (leftShift) { \
- bitsRight = *src++; \
- bits = (IcStipLeft (bitsLeft, leftShift) | \
- IcStipRight(bitsRight, rightShift)); \
- bitsLeft = bitsRight; \
- } else \
- bits = *src++; \
-}
-
-#ifndef ICNOPIXADDR
-
-#define LaneCases1(n,a) case n: (void)IcLaneCase(n,a); break
-#define LaneCases2(n,a) LaneCases1(n,a); LaneCases1(n+1,a)
-#define LaneCases4(n,a) LaneCases2(n,a); LaneCases2(n+2,a)
-#define LaneCases8(n,a) LaneCases4(n,a); LaneCases4(n+4,a)
-#define LaneCases16(n,a) LaneCases8(n,a); LaneCases8(n+8,a)
-#define LaneCases32(n,a) LaneCases16(n,a); LaneCases16(n+16,a)
-#define LaneCases64(n,a) LaneCases32(n,a); LaneCases32(n+32,a)
-#define LaneCases128(n,a) LaneCases64(n,a); LaneCases64(n+64,a)
-#define LaneCases256(n,a) LaneCases128(n,a); LaneCases128(n+128,a)
-
-#if IC_SHIFT == 6
-#define LaneCases(a) LaneCases256(0,a)
-#endif
-
-#if IC_SHIFT == 5
-#define LaneCases(a) LaneCases16(0,a)
-#endif
-
-#if IC_SHIFT == 6
-static uint8_t const Ic8Lane[256] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
-22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
-41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
-60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
-79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
-98, 99, 100, 101, 102,103,104,105,106,107,108,109,110,111,112,113,114,115,
-116, 117, 118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,
-134, 135, 136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,
-152, 153, 154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,
-170, 171, 172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,
-188, 189, 190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,
-206, 207, 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
-224, 225, 226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,
-242, 243, 244,245,246,247,248,249,250,251,252,253,254,255,
-};
-
-static uint8_t const Ic16Lane[256] = {
- 0x00, 0x03, 0x0c, 0x0f,
- 0x30, 0x33, 0x3c, 0x3f,
- 0xc0, 0xc3, 0xcc, 0xcf,
- 0xf0, 0xf3, 0xfc, 0xff,
-};
-
-static uint8_t const Ic32Lane[16] = {
- 0x00, 0x0f, 0xf0, 0xff,
-};
-#endif
-
-#if IC_SHIFT == 5
-static uint8_t const Ic8Lane[16] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
-};
-
-static uint8_t const Ic16Lane[16] = {
- 0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static uint8_t const Ic32Lane[16] = {
- 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-#endif
-
-static const uint8_t *
-IcLaneTable(int bpp)
-{
- switch (bpp) {
- case 8:
- return Ic8Lane;
- case 16:
- return Ic16Lane;
- case 32:
- return Ic32Lane;
- }
- return 0;
-}
-#endif
-
-void
-IcBltOne (IcStip *src,
- IcStride srcStride, /* IcStip units per scanline */
- int srcX, /* bit position of source */
- pixman_bits_t *dst,
- IcStride dstStride, /* pixman_bits_t units per scanline */
- int dstX, /* bit position of dest */
- int dstBpp, /* bits per destination unit */
-
- int width, /* width in bits of destination */
- int height, /* height in scanlines */
-
- pixman_bits_t fgand, /* rrop values */
- pixman_bits_t fgxor,
- pixman_bits_t bgand,
- pixman_bits_t bgxor)
-{
- const pixman_bits_t *icbits;
- int pixelsPerDst; /* dst pixels per pixman_bits_t */
- int unitsPerSrc; /* src patterns per IcStip */
- int leftShift, rightShift; /* align source with dest */
- pixman_bits_t startmask, endmask; /* dest scanline masks */
- IcStip bits=0, bitsLeft, bitsRight;/* source bits */
- IcStip left;
- pixman_bits_t mask;
- int nDst; /* dest longwords (w.o. end) */
- int w;
- int n, nmiddle;
- int dstS; /* stipple-relative dst X coordinate */
- int copy; /* accelerate dest-invariant */
- int transparent; /* accelerate 0 nop */
- int srcinc; /* source units consumed */
- int endNeedsLoad = 0; /* need load for endmask */
-#ifndef ICNOPIXADDR
- const uint8_t *IcLane;
-#endif
- int startbyte, endbyte;
-
-#ifdef IC_24BIT
- if (dstBpp == 24)
- {
- IcBltOne24 (src, srcStride, srcX,
- dst, dstStride, dstX, dstBpp,
- width, height,
- fgand, fgxor, bgand, bgxor);
- return;
- }
-#endif
-
- /*
- * Number of destination units in pixman_bits_t == number of stipple pixels
- * used each time
- */
- pixelsPerDst = IC_UNIT / dstBpp;
-
- /*
- * Number of source stipple patterns in IcStip
- */
- unitsPerSrc = IC_STIP_UNIT / pixelsPerDst;
-
- copy = 0;
- transparent = 0;
- if (bgand == 0 && fgand == 0)
- copy = 1;
- else if (bgand == IC_ALLONES && bgxor == 0)
- transparent = 1;
-
- /*
- * Adjust source and dest to nearest pixman_bits_t boundary
- */
- src += srcX >> IC_STIP_SHIFT;
- dst += dstX >> IC_SHIFT;
- srcX &= IC_STIP_MASK;
- dstX &= IC_MASK;
-
- IcMaskBitsBytes(dstX, width, copy,
- startmask, startbyte, nmiddle, endmask, endbyte);
-
- /*
- * Compute effective dest alignment requirement for
- * source -- must align source to dest unit boundary
- */
- dstS = dstX / dstBpp;
- /*
- * Compute shift constants for effective alignement
- */
- if (srcX >= dstS)
- {
- leftShift = srcX - dstS;
- rightShift = IC_STIP_UNIT - leftShift;
- }
- else
- {
- rightShift = dstS - srcX;
- leftShift = IC_STIP_UNIT - rightShift;
- }
- /*
- * Get pointer to stipple mask array for this depth
- */
- icbits = 0; /* unused */
- if (pixelsPerDst <= 8)
- icbits = IcStippleTable(pixelsPerDst);
-#ifndef ICNOPIXADDR
- IcLane = 0;
- if (transparent && fgand == 0 && dstBpp >= 8)
- IcLane = IcLaneTable(dstBpp);
-#endif
-
- /*
- * Compute total number of destination words written, but
- * don't count endmask
- */
- nDst = nmiddle;
- if (startmask)
- nDst++;
-
- dstStride -= nDst;
-
- /*
- * Compute total number of source words consumed
- */
-
- srcinc = (nDst + unitsPerSrc - 1) / unitsPerSrc;
-
- if (srcX > dstS)
- srcinc++;
- if (endmask)
- {
- endNeedsLoad = nDst % unitsPerSrc == 0;
- if (endNeedsLoad)
- srcinc++;
- }
-
- srcStride -= srcinc;
-
- /*
- * Copy rectangle
- */
- while (height--)
- {
- w = nDst; /* total units across scanline */
- n = unitsPerSrc; /* units avail in single stipple */
- if (n > w)
- n = w;
-
- bitsLeft = 0;
- if (srcX > dstS)
- bitsLeft = *src++;
- if (n)
- {
- /*
- * Load first set of stipple bits
- */
- LoadBits;
-
- /*
- * Consume stipple bits for startmask
- */
- if (startmask)
- {
-#if IC_UNIT > 32
- if (pixelsPerDst == 16)
- mask = IcStipple16Bits(IcLeftStipBits(bits,16));
- else
-#endif
- mask = icbits[IcLeftStipBits(bits,pixelsPerDst)];
-#ifndef ICNOPIXADDR
- if (IcLane)
- {
- IcTransparentSpan (dst, mask & startmask, fgxor, 1);
- }
- else
-#endif
- {
- if (mask || !transparent)
- IcDoLeftMaskByteStippleRRop (dst, mask,
- fgand, fgxor, bgand, bgxor,
- startbyte, startmask);
- }
- bits = IcStipLeft (bits, pixelsPerDst);
- dst++;
- n--;
- w--;
- }
- /*
- * Consume stipple bits across scanline
- */
- for (;;)
- {
- w -= n;
- if (copy)
- {
- while (n--)
- {
-#if IC_UNIT > 32
- if (pixelsPerDst == 16)
- mask = IcStipple16Bits(IcLeftStipBits(bits,16));
- else
-#endif
- mask = icbits[IcLeftStipBits(bits,pixelsPerDst)];
- *dst = IcOpaqueStipple (mask, fgxor, bgxor);
- dst++;
- bits = IcStipLeft(bits, pixelsPerDst);
- }
- }
- else
- {
-#ifndef ICNOPIXADDR
- if (IcLane)
- {
- while (bits && n)
- {
- switch (IcLane[IcLeftStipBits(bits,pixelsPerDst)]) {
- LaneCases((uint8_t *) dst);
- }
- bits = IcStipLeft(bits,pixelsPerDst);
- dst++;
- n--;
- }
- dst += n;
- }
- else
-#endif
- {
- while (n--)
- {
- left = IcLeftStipBits(bits,pixelsPerDst);
- if (left || !transparent)
- {
- mask = icbits[left];
- *dst = IcStippleRRop (*dst, mask,
- fgand, fgxor, bgand, bgxor);
- }
- dst++;
- bits = IcStipLeft(bits, pixelsPerDst);
- }
- }
- }
- if (!w)
- break;
- /*
- * Load another set and reset number of available units
- */
- LoadBits;
- n = unitsPerSrc;
- if (n > w)
- n = w;
- }
- }
- /*
- * Consume stipple bits for endmask
- */
- if (endmask)
- {
- if (endNeedsLoad)
- {
- LoadBits;
- }
-#if IC_UNIT > 32
- if (pixelsPerDst == 16)
- mask = IcStipple16Bits(IcLeftStipBits(bits,16));
- else
-#endif
- mask = icbits[IcLeftStipBits(bits,pixelsPerDst)];
-#ifndef ICNOPIXADDR
- if (IcLane)
- {
- IcTransparentSpan (dst, mask & endmask, fgxor, 1);
- }
- else
-#endif
- {
- if (mask || !transparent)
- IcDoRightMaskByteStippleRRop (dst, mask,
- fgand, fgxor, bgand, bgxor,
- endbyte, endmask);
- }
- }
- dst += dstStride;
- src += srcStride;
- }
-}
-
-#ifdef IC_24BIT
-
-/*
- * Crufty macros to initialize the mask array, most of this
- * is to avoid compile-time warnings about shift overflow
- */
-
-#if BITMAP_BIT_ORDER == MSBFirst
-#define Mask24Pos(x,r) ((x)*24-(r))
-#else
-#define Mask24Pos(x,r) ((x)*24-((r) ? 24 - (r) : 0))
-#endif
-
-#define Mask24Neg(x,r) (Mask24Pos(x,r) < 0 ? -Mask24Pos(x,r) : 0)
-#define Mask24Check(x,r) (Mask24Pos(x,r) < 0 ? 0 : \
- Mask24Pos(x,r) >= IC_UNIT ? 0 : Mask24Pos(x,r))
-
-#define Mask24(x,r) (Mask24Pos(x,r) < IC_UNIT ? \
- (Mask24Pos(x,r) < 0 ? \
- 0xffffff >> Mask24Neg (x,r) : \
- 0xffffff << Mask24Check(x,r)) : 0)
-
-#define SelMask24(b,n,r) ((((b) >> n) & 1) * Mask24(n,r))
-
-/*
- * Untested for MSBFirst or IC_UNIT == 32
- */
-
-#if IC_UNIT == 64
-#define C4_24(b,r) \
- (SelMask24(b,0,r) | \
- SelMask24(b,1,r) | \
- SelMask24(b,2,r) | \
- SelMask24(b,3,r))
-
-#define IcStip24New(rot) (2 + (rot != 0))
-#define IcStip24Len 4
-
-static const pixman_bits_t icStipple24Bits[3][1 << IcStip24Len] = {
- /* rotate 0 */
- {
- C4_24( 0, 0), C4_24( 1, 0), C4_24( 2, 0), C4_24( 3, 0),
- C4_24( 4, 0), C4_24( 5, 0), C4_24( 6, 0), C4_24( 7, 0),
- C4_24( 8, 0), C4_24( 9, 0), C4_24(10, 0), C4_24(11, 0),
- C4_24(12, 0), C4_24(13, 0), C4_24(14, 0), C4_24(15, 0),
- },
- /* rotate 8 */
- {
- C4_24( 0, 8), C4_24( 1, 8), C4_24( 2, 8), C4_24( 3, 8),
- C4_24( 4, 8), C4_24( 5, 8), C4_24( 6, 8), C4_24( 7, 8),
- C4_24( 8, 8), C4_24( 9, 8), C4_24(10, 8), C4_24(11, 8),
- C4_24(12, 8), C4_24(13, 8), C4_24(14, 8), C4_24(15, 8),
- },
- /* rotate 16 */
- {
- C4_24( 0,16), C4_24( 1,16), C4_24( 2,16), C4_24( 3,16),
- C4_24( 4,16), C4_24( 5,16), C4_24( 6,16), C4_24( 7,16),
- C4_24( 8,16), C4_24( 9,16), C4_24(10,16), C4_24(11,16),
- C4_24(12,16), C4_24(13,16), C4_24(14,16), C4_24(15,16),
- }
-};
-
-#endif
-
-#if IC_UNIT == 32
-#define C2_24(b,r) \
- (SelMask24(b,0,r) | \
- SelMask24(b,1,r))
-
-#define IcStip24Len 2
-#if BITMAP_BIT_ORDER == MSBFirst
-#define IcStip24New(rot) (1 + (rot == 0))
-#else
-#define IcStip24New(rot) (1 + (rot == 8))
-#endif
-
-static const pixman_bits_t icStipple24Bits[3][1 << IcStip24Len] = {
- /* rotate 0 */
- {
- C2_24( 0, 0), C2_24 ( 1, 0), C2_24 ( 2, 0), C2_24 ( 3, 0),
- },
- /* rotate 8 */
- {
- C2_24( 0, 8), C2_24 ( 1, 8), C2_24 ( 2, 8), C2_24 ( 3, 8),
- },
- /* rotate 16 */
- {
- C2_24( 0,16), C2_24 ( 1,16), C2_24 ( 2,16), C2_24 ( 3,16),
- }
-};
-#endif
-
-#if BITMAP_BIT_ORDER == LSBFirst
-
-#define IcMergeStip24Bits(left, right, new) \
- (IcStipLeft (left, new) | IcStipRight ((right), (IcStip24Len - (new))))
-
-#define IcMergePartStip24Bits(left, right, llen, rlen) \
- (left | IcStipRight(right, llen))
-
-#else
-
-#define IcMergeStip24Bits(left, right, new) \
- ((IcStipLeft (left, new) & ((1 << IcStip24Len) - 1)) | right)
-
-#define IcMergePartStip24Bits(left, right, llen, rlen) \
- (IcStipLeft(left, rlen) | right)
-
-#endif
-
-#define IcFirstStipBits(len,stip) {\
- int __len = (len); \
- if (len <= remain) { \
- stip = IcLeftStipBits(bits, len); \
- } else { \
- stip = IcLeftStipBits(bits, remain); \
- bits = *src++; \
- __len = (len) - remain; \
- stip = IcMergePartStip24Bits(stip, IcLeftStipBits(bits, __len), \
- remain, __len); \
- remain = IC_STIP_UNIT; \
- } \
- bits = IcStipLeft (bits, __len); \
- remain -= __len; \
-}
-
-#define IcInitStipBits(offset,len,stip) {\
- bits = IcStipLeft (*src++,offset); \
- remain = IC_STIP_UNIT - offset; \
- IcFirstStipBits(len,stip); \
- stip = IcMergeStip24Bits (0, stip, len); \
-}
-
-#define IcNextStipBits(rot,stip) {\
- int __new = IcStip24New(rot); \
- IcStip __right; \
- IcFirstStipBits(__new, __right); \
- stip = IcMergeStip24Bits (stip, __right, __new); \
- rot = IcNext24Rot (rot); \
-}
-
-/*
- * Use deep mask tables that incorporate rotation, pull
- * a variable number of bits out of the stipple and
- * reuse the right bits as needed for the next write
- *
- * Yes, this is probably too much code, but most 24-bpp screens
- * have no acceleration so this code is used for stipples, copyplane
- * and text
- */
-void
-IcBltOne24 (IcStip *srcLine,
- IcStride srcStride, /* IcStip units per scanline */
- int srcX, /* bit position of source */
- pixman_bits_t *dst,
- IcStride dstStride, /* pixman_bits_t units per scanline */
- int dstX, /* bit position of dest */
- int dstBpp, /* bits per destination unit */
-
- int width, /* width in bits of destination */
- int height, /* height in scanlines */
-
- pixman_bits_t fgand, /* rrop values */
- pixman_bits_t fgxor,
- pixman_bits_t bgand,
- pixman_bits_t bgxor)
-{
- IcStip *src;
- pixman_bits_t leftMask, rightMask, mask;
- int nlMiddle, nl;
- IcStip stip, bits;
- int remain;
- int dstS;
- int firstlen;
- int rot0, rot;
- int nDst;
-
- srcLine += srcX >> IC_STIP_SHIFT;
- dst += dstX >> IC_SHIFT;
- srcX &= IC_STIP_MASK;
- dstX &= IC_MASK;
- rot0 = IcFirst24Rot (dstX);
-
- IcMaskBits (dstX, width, leftMask, nlMiddle, rightMask);
-
- dstS = (dstX + 23) / 24;
- firstlen = IcStip24Len - dstS;
-
- nDst = nlMiddle;
- if (leftMask)
- nDst++;
- dstStride -= nDst;
-
- /* opaque copy */
- if (bgand == 0 && fgand == 0)
- {
- while (height--)
- {
- rot = rot0;
- src = srcLine;
- srcLine += srcStride;
- IcInitStipBits (srcX,firstlen, stip);
- if (leftMask)
- {
- mask = icStipple24Bits[rot >> 3][stip];
- *dst = (*dst & ~leftMask) | (IcOpaqueStipple (mask,
- IcRot24(fgxor, rot),
- IcRot24(bgxor, rot))
- & leftMask);
- dst++;
- IcNextStipBits(rot,stip);
- }
- nl = nlMiddle;
- while (nl--)
- {
- mask = icStipple24Bits[rot>>3][stip];
- *dst = IcOpaqueStipple (mask,
- IcRot24(fgxor, rot),
- IcRot24(bgxor, rot));
- dst++;
- IcNextStipBits(rot,stip);
- }
- if (rightMask)
- {
- mask = icStipple24Bits[rot >> 3][stip];
- *dst = (*dst & ~rightMask) | (IcOpaqueStipple (mask,
- IcRot24(fgxor, rot),
- IcRot24(bgxor, rot))
- & rightMask);
- }
- dst += dstStride;
- src += srcStride;
- }
- }
- /* transparent copy */
- else if (bgand == IC_ALLONES && bgxor == 0 && fgand == 0)
- {
- while (height--)
- {
- rot = rot0;
- src = srcLine;
- srcLine += srcStride;
- IcInitStipBits (srcX, firstlen, stip);
- if (leftMask)
- {
- if (stip)
- {
- mask = icStipple24Bits[rot >> 3][stip] & leftMask;
- *dst = (*dst & ~mask) | (IcRot24(fgxor, rot) & mask);
- }
- dst++;
- IcNextStipBits (rot, stip);
- }
- nl = nlMiddle;
- while (nl--)
- {
- if (stip)
- {
- mask = icStipple24Bits[rot>>3][stip];
- *dst = (*dst & ~mask) | (IcRot24(fgxor,rot) & mask);
- }
- dst++;
- IcNextStipBits (rot, stip);
- }
- if (rightMask)
- {
- if (stip)
- {
- mask = icStipple24Bits[rot >> 3][stip] & rightMask;
- *dst = (*dst & ~mask) | (IcRot24(fgxor, rot) & mask);
- }
- }
- dst += dstStride;
- }
- }
- else
- {
- while (height--)
- {
- rot = rot0;
- src = srcLine;
- srcLine += srcStride;
- IcInitStipBits (srcX, firstlen, stip);
- if (leftMask)
- {
- mask = icStipple24Bits[rot >> 3][stip];
- *dst = IcStippleRRopMask (*dst, mask,
- IcRot24(fgand, rot),
- IcRot24(fgxor, rot),
- IcRot24(bgand, rot),
- IcRot24(bgxor, rot),
- leftMask);
- dst++;
- IcNextStipBits(rot,stip);
- }
- nl = nlMiddle;
- while (nl--)
- {
- mask = icStipple24Bits[rot >> 3][stip];
- *dst = IcStippleRRop (*dst, mask,
- IcRot24(fgand, rot),
- IcRot24(fgxor, rot),
- IcRot24(bgand, rot),
- IcRot24(bgxor, rot));
- dst++;
- IcNextStipBits(rot,stip);
- }
- if (rightMask)
- {
- mask = icStipple24Bits[rot >> 3][stip];
- *dst = IcStippleRRopMask (*dst, mask,
- IcRot24(fgand, rot),
- IcRot24(fgxor, rot),
- IcRot24(bgand, rot),
- IcRot24(bgxor, rot),
- rightMask);
- }
- dst += dstStride;
- }
- }
-}
-#endif
-
diff --git a/pixman/src/iccolor.c b/pixman/src/iccolor.c
deleted file mode 100644
index afa52f7e2..000000000
--- a/pixman/src/iccolor.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright Β© 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "icint.h"
-
-#ifdef ICINT_NEED_IC_ONES
-/* Fall back on HACKMEM 169. */
-int
-_IcOnes (unsigned long mask)
-{
- register unsigned long y;
-
- y = (mask >> 1) &033333333333;
- y = mask - y - ((y >>1) & 033333333333);
- return (((y + (y >> 3)) & 030707070707) % 077);
-}
-#endif
-
-void
-pixman_color_to_pixel (const pixman_format_t *format,
- const pixman_color_t *color,
- pixman_bits_t *pixel)
-{
- uint32_t r, g, b, a;
-
- r = color->red >> (16 - _IcOnes (format->redMask));
- g = color->green >> (16 - _IcOnes (format->greenMask));
- b = color->blue >> (16 - _IcOnes (format->blueMask));
- a = color->alpha >> (16 - _IcOnes (format->alphaMask));
- r = r << format->red;
- g = g << format->green;
- b = b << format->blue;
- a = a << format->alpha;
- *pixel = r|g|b|a;
-}
-slim_hidden_def(pixman_color_to_pixel);
-
-static uint16_t
-IcFillColor (uint32_t pixel, int bits)
-{
- while (bits < 16)
- {
- pixel |= pixel << bits;
- bits <<= 1;
- }
- return (uint16_t) pixel;
-}
-
-void
-pixman_pixel_to_color (const pixman_format_t *format,
- const pixman_bits_t pixel,
- pixman_color_t *color)
-{
- uint32_t r, g, b, a;
-
- r = (pixel >> format->red) & format->redMask;
- g = (pixel >> format->green) & format->greenMask;
- b = (pixel >> format->blue) & format->blueMask;
- a = (pixel >> format->alpha) & format->alphaMask;
- color->red = IcFillColor (r, _IcOnes (format->redMask));
- color->green = IcFillColor (r, _IcOnes (format->greenMask));
- color->blue = IcFillColor (r, _IcOnes (format->blueMask));
- color->alpha = IcFillColor (r, _IcOnes (format->alphaMask));
-}
diff --git a/pixman/src/iccompose.c b/pixman/src/iccompose.c
deleted file mode 100644
index 96d23b76b..000000000
--- a/pixman/src/iccompose.c
+++ /dev/null
@@ -1,2745 +0,0 @@
-/*
- * Copyright Β© 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-
-#include "icint.h"
-
-/*
- * General purpose compositing code optimized for minimal memory
- * references
- *
- * All work is done on canonical ARGB values, functions for fetching
- * and storing these exist for each format.
- */
-
-/*
- * Combine src and mask using IN
- */
-
-static uint32_t
-IcCombineMaskU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk)
-{
- uint32_t x;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- if (!msk)
- return (*src->fetch) (src);
-
- a = (*msk->fetch) (msk) >> 24;
- if (!a)
- return 0;
-
- x = (*src->fetch) (src);
- if (a == 0xff)
- return x;
-
- m = IcInU(x,0,a,t);
- n = IcInU(x,8,a,t);
- o = IcInU(x,16,a,t);
- p = IcInU(x,24,a,t);
- return m|n|o|p;
-}
-
-static IcCompSrc
-IcCombineMaskC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk)
-{
- IcCompSrc s;
- uint32_t x;
- uint32_t a;
- uint16_t xa;
- uint16_t t;
- uint32_t m,n,o,p;
-
- if (!msk)
- {
- x = (*src->fetch) (src);
- s.value = x;
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
- s.alpha = x;
- return s;
- }
-
- a = (*msk->fetcha) (msk);
- if (!a)
- {
- s.value = 0;
- s.alpha = 0;
- return s;
- }
-
- x = (*src->fetch) (src);
- if (a == 0xffffffff)
- {
- s.value = x;
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
- s.alpha = x;
- return s;
- }
-
- m = IcInC(x,0,a,t);
- n = IcInC(x,8,a,t);
- o = IcInC(x,16,a,t);
- p = IcInC(x,24,a,t);
- s.value = m|n|o|p;
- xa = x >> 24;
- m = IcInU(a,0,xa,t);
- n = IcInU(a,8,xa,t);
- o = IcInU(a,16,xa,t);
- p = IcInU(a,24,xa,t);
- s.alpha = m|n|o|p;
- return s;
-}
-
-static uint32_t
-IcCombineMaskValueC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk)
-{
- uint32_t x;
- uint32_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- if (!msk)
- {
- return (*src->fetch) (src);
- }
-
- a = (*msk->fetcha) (msk);
- if (!a)
- return a;
-
- x = (*src->fetch) (src);
- if (a == 0xffffffff)
- return x;
-
- m = IcInC(x,0,a,t);
- n = IcInC(x,8,a,t);
- o = IcInC(x,16,a,t);
- p = IcInC(x,24,a,t);
- return m|n|o|p;
-}
-
-/*
- * Combine src and mask using IN, generating only the alpha component
- */
-static uint32_t
-IcCombineMaskAlphaU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk)
-{
- uint32_t x;
- uint16_t a;
- uint16_t t;
-
- if (!msk)
- return (*src->fetch) (src);
-
- a = (*msk->fetch) (msk) >> 24;
- if (!a)
- return 0;
-
- x = (*src->fetch) (src);
- if (a == 0xff)
- return x;
-
- return IcInU(x,24,a,t);
-}
-
-static uint32_t
-IcCombineMaskAlphaC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk)
-{
- uint32_t x;
- uint32_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- if (!msk)
- return (*src->fetch) (src);
-
- a = (*msk->fetcha) (msk);
- if (!a)
- return 0;
-
- x = (*src->fetcha) (src);
- if (a == 0xffffffff)
- return x;
-
- m = IcInC(x,0,a,t);
- n = IcInC(x,8,a,t);
- o = IcInC(x,16,a,t);
- p = IcInC(x,24,a,t);
- return m|n|o|p;
-}
-
-/*
- * All of the composing functions
- */
-static void
-IcCombineClear (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- (*dst->store) (dst, 0);
-}
-
-static void
-IcCombineSrcU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- (*dst->store) (dst, IcCombineMaskU (src, msk));
-}
-
-static void
-IcCombineSrcC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- (*dst->store) (dst, IcCombineMaskValueC (src, msk));
-}
-
-static void
-IcCombineDst (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- /* noop */
-}
-
-static void
-IcCombineOverU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskU (src, msk);
- a = ~s >> 24;
- if (a != 0xff)
- {
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = IcOverU(s,d,0,a,t);
- n = IcOverU(s,d,8,a,t);
- o = IcOverU(s,d,16,a,t);
- p = IcOverU(s,d,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-static void
-IcCombineOverC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCompSrc cs;
- uint32_t s, d;
- uint32_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- cs = IcCombineMaskC (src, msk);
- s = cs.value;
- a = ~cs.alpha;
- if (a != 0xffffffff)
- {
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = IcOverC(s,d,0,a,t);
- n = IcOverC(s,d,8,a,t);
- o = IcOverC(s,d,16,a,t);
- p = IcOverC(s,d,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-static void
-IcCombineOverReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = ~d >> 24;
- if (a)
- {
- s = IcCombineMaskU (src, msk);
- if (a != 0xff)
- {
- m = IcOverU(d,s,0,a,t);
- n = IcOverU(d,s,8,a,t);
- o = IcOverU(d,s,16,a,t);
- p = IcOverU(d,s,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-static void
-IcCombineOverReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint32_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = ~d >> 24;
- if (a)
- {
- s = IcCombineMaskValueC (src, msk);
- if (a != 0xff)
- {
- m = IcOverU(d,s,0,a,t);
- n = IcOverU(d,s,8,a,t);
- o = IcOverU(d,s,16,a,t);
- p = IcOverU(d,s,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-static void
-IcCombineInU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = d >> 24;
- s = 0;
- if (a)
- {
- s = IcCombineMaskU (src, msk);
- if (a != 0xff)
- {
- m = IcInU(s,0,a,t);
- n = IcInU(s,8,a,t);
- o = IcInU(s,16,a,t);
- p = IcInU(s,24,a,t);
- s = m|n|o|p;
- }
- }
- (*dst->store) (dst, s);
-}
-
-static void
-IcCombineInC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = d >> 24;
- s = 0;
- if (a)
- {
- s = IcCombineMaskValueC (src, msk);
- if (a != 0xff)
- {
- m = IcInU(s,0,a,t);
- n = IcInU(s,8,a,t);
- o = IcInU(s,16,a,t);
- p = IcInU(s,24,a,t);
- s = m|n|o|p;
- }
- }
- (*dst->store) (dst, s);
-}
-
-static void
-IcCombineInReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskAlphaU (src, msk);
- a = s >> 24;
- if (a != 0xff)
- {
- d = 0;
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = IcInU(d,0,a,t);
- n = IcInU(d,8,a,t);
- o = IcInU(d,16,a,t);
- p = IcInU(d,24,a,t);
- d = m|n|o|p;
- }
- (*dst->store) (dst, d);
- }
-}
-
-static void
-IcCombineInReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint32_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskAlphaC (src, msk);
- a = s;
- if (a != 0xffffffff)
- {
- d = 0;
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = IcInC(d,0,a,t);
- n = IcInC(d,8,a,t);
- o = IcInC(d,16,a,t);
- p = IcInC(d,24,a,t);
- d = m|n|o|p;
- }
- (*dst->store) (dst, d);
- }
-}
-
-static void
-IcCombineOutU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = ~d >> 24;
- s = 0;
- if (a)
- {
- s = IcCombineMaskU (src, msk);
- if (a != 0xff)
- {
- m = IcInU(s,0,a,t);
- n = IcInU(s,8,a,t);
- o = IcInU(s,16,a,t);
- p = IcInU(s,24,a,t);
- s = m|n|o|p;
- }
- }
- (*dst->store) (dst, s);
-}
-
-static void
-IcCombineOutC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- d = (*dst->fetch) (dst);
- a = ~d >> 24;
- s = 0;
- if (a)
- {
- s = IcCombineMaskValueC (src, msk);
- if (a != 0xff)
- {
- m = IcInU(s,0,a,t);
- n = IcInU(s,8,a,t);
- o = IcInU(s,16,a,t);
- p = IcInU(s,24,a,t);
- s = m|n|o|p;
- }
- }
- (*dst->store) (dst, s);
-}
-
-static void
-IcCombineOutReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskAlphaU (src, msk);
- a = ~s >> 24;
- if (a != 0xff)
- {
- d = 0;
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = IcInU(d,0,a,t);
- n = IcInU(d,8,a,t);
- o = IcInU(d,16,a,t);
- p = IcInU(d,24,a,t);
- d = m|n|o|p;
- }
- (*dst->store) (dst, d);
- }
-}
-
-static void
-IcCombineOutReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint32_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskAlphaC (src, msk);
- a = ~s;
- if (a != 0xffffffff)
- {
- d = 0;
- if (a)
- {
- d = (*dst->fetch) (dst);
- m = IcInC(d,0,a,t);
- n = IcInC(d,8,a,t);
- o = IcInC(d,16,a,t);
- p = IcInC(d,24,a,t);
- d = m|n|o|p;
- }
- (*dst->store) (dst, d);
- }
-}
-
-static void
-IcCombineAtopU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t ad, as;
- uint16_t t,u,v;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskU (src, msk);
- d = (*dst->fetch) (dst);
- ad = ~s >> 24;
- as = d >> 24;
- m = IcGen(s,d,0,as,ad,t,u,v);
- n = IcGen(s,d,8,as,ad,t,u,v);
- o = IcGen(s,d,16,as,ad,t,u,v);
- p = IcGen(s,d,24,as,ad,t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-static void
-IcCombineAtopC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCompSrc cs;
- uint32_t s, d;
- uint32_t ad;
- uint16_t as;
- uint16_t t, u, v;
- uint32_t m,n,o,p;
-
- cs = IcCombineMaskC (src, msk);
- d = (*dst->fetch) (dst);
- s = cs.value;
- ad = cs.alpha;
- as = d >> 24;
- m = IcGen(s,d,0,as,IcGet8(ad,0),t,u,v);
- n = IcGen(s,d,8,as,IcGet8(ad,8),t,u,v);
- o = IcGen(s,d,16,as,IcGet8(ad,16),t,u,v);
- p = IcGen(s,d,24,as,IcGet8(ad,24),t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-static void
-IcCombineAtopReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t ad, as;
- uint16_t t, u, v;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskU (src, msk);
- d = (*dst->fetch) (dst);
- ad = s >> 24;
- as = ~d >> 24;
- m = IcGen(s,d,0,as,ad,t,u,v);
- n = IcGen(s,d,8,as,ad,t,u,v);
- o = IcGen(s,d,16,as,ad,t,u,v);
- p = IcGen(s,d,24,as,ad,t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-static void
-IcCombineAtopReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCompSrc cs;
- uint32_t s, d, ad;
- uint16_t as;
- uint16_t t, u, v;
- uint32_t m,n,o,p;
-
- cs = IcCombineMaskC (src, msk);
- d = (*dst->fetch) (dst);
- s = cs.value;
- ad = cs.alpha;
- as = ~d >> 24;
- m = IcGen(s,d,0,as,IcGet8(ad,0),t,u,v);
- n = IcGen(s,d,8,as,IcGet8(ad,8),t,u,v);
- o = IcGen(s,d,16,as,IcGet8(ad,16),t,u,v);
- p = IcGen(s,d,24,as,IcGet8(ad,24),t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-static void
-IcCombineXorU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t ad, as;
- uint16_t t, u, v;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskU (src, msk);
- d = (*dst->fetch) (dst);
- ad = ~s >> 24;
- as = ~d >> 24;
- m = IcGen(s,d,0,as,ad,t,u,v);
- n = IcGen(s,d,8,as,ad,t,u,v);
- o = IcGen(s,d,16,as,ad,t,u,v);
- p = IcGen(s,d,24,as,ad,t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-static void
-IcCombineXorC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCompSrc cs;
- uint32_t s, d, ad;
- uint16_t as;
- uint16_t t, u, v;
- uint32_t m,n,o,p;
-
- cs = IcCombineMaskC (src, msk);
- d = (*dst->fetch) (dst);
- s = cs.value;
- ad = ~cs.alpha;
- as = ~d >> 24;
- m = IcGen(s,d,0,as,ad,t,u,v);
- n = IcGen(s,d,8,as,ad,t,u,v);
- o = IcGen(s,d,16,as,ad,t,u,v);
- p = IcGen(s,d,24,as,ad,t,u,v);
- (*dst->store) (dst, m|n|o|p);
-}
-
-static void
-IcCombineAddU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t t;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskU (src, msk);
- if (s == ~0)
- (*dst->store) (dst, s);
- else
- {
- d = (*dst->fetch) (dst);
- if (s && d != ~0)
- {
- m = IcAdd(s,d,0,t);
- n = IcAdd(s,d,8,t);
- o = IcAdd(s,d,16,t);
- p = IcAdd(s,d,24,t);
- (*dst->store) (dst, m|n|o|p);
- }
- }
-}
-
-static void
-IcCombineAddC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t t;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskValueC (src, msk);
- if (s == ~0)
- (*dst->store) (dst, s);
- else
- {
- d = (*dst->fetch) (dst);
- if (s && d != ~0)
- {
- m = IcAdd(s,d,0,t);
- n = IcAdd(s,d,8,t);
- o = IcAdd(s,d,16,t);
- p = IcAdd(s,d,24,t);
- (*dst->store) (dst, m|n|o|p);
- }
- }
-}
-
-/*
- * All of the disjoint composing functions
-
- The four entries in the first column indicate what source contributions
- come from each of the four areas of the picture -- areas covered by neither
- A nor B, areas covered only by A, areas covered only by B and finally
- areas covered by both A and B.
-
- Disjoint Conjoint
- Fa Fb Fa Fb
-(0,0,0,0) 0 0 0 0
-(0,A,0,A) 1 0 1 0
-(0,0,B,B) 0 1 0 1
-(0,A,B,A) 1 min((1-a)/b,1) 1 max(1-a/b,0)
-(0,A,B,B) min((1-b)/a,1) 1 max(1-b/a,0) 1
-(0,0,0,A) max(1-(1-b)/a,0) 0 min(1,b/a) 0
-(0,0,0,B) 0 max(1-(1-a)/b,0) 0 min(a/b,1)
-(0,A,0,0) min(1,(1-b)/a) 0 max(1-b/a,0) 0
-(0,0,B,0) 0 min(1,(1-a)/b) 0 max(1-a/b,0)
-(0,0,B,A) max(1-(1-b)/a,0) min(1,(1-a)/b) min(1,b/a) max(1-a/b,0)
-(0,A,0,B) min(1,(1-b)/a) max(1-(1-a)/b,0) max(1-b/a,0) min(1,a/b)
-(0,A,B,0) min(1,(1-b)/a) min(1,(1-a)/b) max(1-b/a,0) max(1-a/b,0)
-
- */
-
-#define CombineAOut 1
-#define CombineAIn 2
-#define CombineBOut 4
-#define CombineBIn 8
-
-#define CombineClear 0
-#define CombineA (CombineAOut|CombineAIn)
-#define CombineB (CombineBOut|CombineBIn)
-#define CombineAOver (CombineAOut|CombineBOut|CombineAIn)
-#define CombineBOver (CombineAOut|CombineBOut|CombineBIn)
-#define CombineAAtop (CombineBOut|CombineAIn)
-#define CombineBAtop (CombineAOut|CombineBIn)
-#define CombineXor (CombineAOut|CombineBOut)
-
-/* portion covered by a but not b */
-static uint8_t
-IcCombineDisjointOutPart (uint8_t a, uint8_t b)
-{
- /* min (1, (1-b) / a) */
-
- b = ~b; /* 1 - b */
- if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */
- return 0xff; /* 1 */
- return IcIntDiv(b,a); /* (1-b) / a */
-}
-
-/* portion covered by both a and b */
-static uint8_t
-IcCombineDisjointInPart (uint8_t a, uint8_t b)
-{
- /* max (1-(1-b)/a,0) */
- /* = - min ((1-b)/a - 1, 0) */
- /* = 1 - min (1, (1-b)/a) */
-
- b = ~b; /* 1 - b */
- if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */
- return 0; /* 1 - 1 */
- return ~IcIntDiv(b,a); /* 1 - (1-b) / a */
-}
-
-static void
-IcCombineDisjointGeneralU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst,
- uint8_t combine)
-{
- uint32_t s, d;
- uint32_t m,n,o,p;
- uint16_t Fa, Fb, t, u, v;
- uint8_t sa, da;
-
- s = IcCombineMaskU (src, msk);
- sa = s >> 24;
-
- d = (*dst->fetch) (dst);
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- Fa = IcCombineDisjointOutPart (sa, da);
- break;
- case CombineAIn:
- Fa = IcCombineDisjointInPart (sa, da);
- break;
- case CombineA:
- Fa = 0xff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = IcCombineDisjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = IcCombineDisjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = IcGen (s,d,0,Fa,Fb,t,u,v);
- n = IcGen (s,d,8,Fa,Fb,t,u,v);
- o = IcGen (s,d,16,Fa,Fb,t,u,v);
- p = IcGen (s,d,24,Fa,Fb,t,u,v);
- s = m|n|o|p;
- (*dst->store) (dst, s);
-}
-
-static void
-IcCombineDisjointGeneralC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst,
- uint8_t combine)
-{
- IcCompSrc cs;
- uint32_t s, d;
- uint32_t m,n,o,p;
- uint32_t Fa;
- uint16_t Fb, t, u, v;
- uint32_t sa;
- uint8_t da;
-
- cs = IcCombineMaskC (src, msk);
- s = cs.value;
- sa = cs.alpha;
-
- d = (*dst->fetch) (dst);
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- m = IcCombineDisjointOutPart ((uint8_t) (sa >> 0), da);
- n = IcCombineDisjointOutPart ((uint8_t) (sa >> 8), da) << 8;
- o = IcCombineDisjointOutPart ((uint8_t) (sa >> 16), da) << 16;
- p = IcCombineDisjointOutPart ((uint8_t) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineAIn:
- m = IcCombineDisjointOutPart ((uint8_t) (sa >> 0), da);
- n = IcCombineDisjointOutPart ((uint8_t) (sa >> 8), da) << 8;
- o = IcCombineDisjointOutPart ((uint8_t) (sa >> 16), da) << 16;
- p = IcCombineDisjointOutPart ((uint8_t) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineA:
- Fa = 0xffffffff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = IcCombineDisjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = IcCombineDisjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = IcGen (s,d,0,IcGet8(Fa,0),Fb,t,u,v);
- n = IcGen (s,d,8,IcGet8(Fa,8),Fb,t,u,v);
- o = IcGen (s,d,16,IcGet8(Fa,16),Fb,t,u,v);
- p = IcGen (s,d,24,IcGet8(Fa,24),Fb,t,u,v);
- s = m|n|o|p;
- (*dst->store) (dst, s);
-}
-
-static void
-IcCombineDisjointOverU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskU (src, msk);
- a = s >> 24;
- if (a != 0x00)
- {
- if (a != 0xff)
- {
- d = (*dst->fetch) (dst);
- a = IcCombineDisjointOutPart (d >> 24, a);
- m = IcOverU(s,d,0,a,t);
- n = IcOverU(s,d,8,a,t);
- o = IcOverU(s,d,16,a,t);
- p = IcOverU(s,d,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
-}
-
-static void
-IcCombineDisjointOverC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralC (src, msk, dst, CombineAOver);
-}
-
-static void
-IcCombineDisjointOverReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralU (src, msk, dst, CombineBOver);
-}
-
-static void
-IcCombineDisjointOverReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralC (src, msk, dst, CombineBOver);
-}
-
-static void
-IcCombineDisjointInU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralU (src, msk, dst, CombineAIn);
-}
-
-static void
-IcCombineDisjointInC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralC (src, msk, dst, CombineAIn);
-}
-
-static void
-IcCombineDisjointInReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralU (src, msk, dst, CombineBIn);
-}
-
-static void
-IcCombineDisjointInReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralC (src, msk, dst, CombineBIn);
-}
-
-static void
-IcCombineDisjointOutU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralU (src, msk, dst, CombineAOut);
-}
-
-static void
-IcCombineDisjointOutC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralC (src, msk, dst, CombineAOut);
-}
-
-static void
-IcCombineDisjointOutReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralU (src, msk, dst, CombineBOut);
-}
-
-static void
-IcCombineDisjointOutReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralC (src, msk, dst, CombineBOut);
-}
-
-static void
-IcCombineDisjointAtopU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralU (src, msk, dst, CombineAAtop);
-}
-
-static void
-IcCombineDisjointAtopC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralC (src, msk, dst, CombineAAtop);
-}
-
-static void
-IcCombineDisjointAtopReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralU (src, msk, dst, CombineBAtop);
-}
-
-static void
-IcCombineDisjointAtopReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralC (src, msk, dst, CombineBAtop);
-}
-
-static void
-IcCombineDisjointXorU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralU (src, msk, dst, CombineXor);
-}
-
-static void
-IcCombineDisjointXorC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineDisjointGeneralC (src, msk, dst, CombineXor);
-}
-
-/* portion covered by a but not b */
-static uint8_t
-IcCombineConjointOutPart (uint8_t a, uint8_t b)
-{
- /* max (1-b/a,0) */
- /* = 1-min(b/a,1) */
-
- /* min (1, (1-b) / a) */
-
- if (b >= a) /* b >= a -> b/a >= 1 */
- return 0x00; /* 0 */
- return ~IcIntDiv(b,a); /* 1 - b/a */
-}
-
-/* portion covered by both a and b */
-static uint8_t
-IcCombineConjointInPart (uint8_t a, uint8_t b)
-{
- /* min (1,b/a) */
-
- if (b >= a) /* b >= a -> b/a >= 1 */
- return 0xff; /* 1 */
- return IcIntDiv(b,a); /* b/a */
-}
-
-static void
-IcCombineConjointGeneralU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst,
- uint8_t combine)
-{
- uint32_t s, d;
- uint32_t m,n,o,p;
- uint16_t Fa, Fb, t, u, v;
- uint8_t sa, da;
-
- s = IcCombineMaskU (src, msk);
- sa = s >> 24;
-
- d = (*dst->fetch) (dst);
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- Fa = IcCombineConjointOutPart (sa, da);
- break;
- case CombineAIn:
- Fa = IcCombineConjointInPart (sa, da);
- break;
- case CombineA:
- Fa = 0xff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = IcCombineConjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = IcCombineConjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = IcGen (s,d,0,Fa,Fb,t,u,v);
- n = IcGen (s,d,8,Fa,Fb,t,u,v);
- o = IcGen (s,d,16,Fa,Fb,t,u,v);
- p = IcGen (s,d,24,Fa,Fb,t,u,v);
- s = m|n|o|p;
- (*dst->store) (dst, s);
-}
-
-static void
-IcCombineConjointGeneralC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst,
- uint8_t combine)
-{
- IcCompSrc cs;
- uint32_t s, d;
- uint32_t m,n,o,p;
- uint32_t Fa;
- uint16_t Fb, t, u, v;
- uint32_t sa;
- uint8_t da;
-
- cs = IcCombineMaskC (src, msk);
- s = cs.value;
- sa = cs.alpha;
-
- d = (*dst->fetch) (dst);
- da = d >> 24;
-
- switch (combine & CombineA) {
- default:
- Fa = 0;
- break;
- case CombineAOut:
- m = IcCombineConjointOutPart ((uint8_t) (sa >> 0), da);
- n = IcCombineConjointOutPart ((uint8_t) (sa >> 8), da) << 8;
- o = IcCombineConjointOutPart ((uint8_t) (sa >> 16), da) << 16;
- p = IcCombineConjointOutPart ((uint8_t) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineAIn:
- m = IcCombineConjointOutPart ((uint8_t) (sa >> 0), da);
- n = IcCombineConjointOutPart ((uint8_t) (sa >> 8), da) << 8;
- o = IcCombineConjointOutPart ((uint8_t) (sa >> 16), da) << 16;
- p = IcCombineConjointOutPart ((uint8_t) (sa >> 24), da) << 24;
- Fa = m|n|o|p;
- break;
- case CombineA:
- Fa = 0xffffffff;
- break;
- }
-
- switch (combine & CombineB) {
- default:
- Fb = 0;
- break;
- case CombineBOut:
- Fb = IcCombineConjointOutPart (da, sa);
- break;
- case CombineBIn:
- Fb = IcCombineConjointInPart (da, sa);
- break;
- case CombineB:
- Fb = 0xff;
- break;
- }
- m = IcGen (s,d,0,IcGet8(Fa,0),Fb,t,u,v);
- n = IcGen (s,d,8,IcGet8(Fa,8),Fb,t,u,v);
- o = IcGen (s,d,16,IcGet8(Fa,16),Fb,t,u,v);
- p = IcGen (s,d,24,IcGet8(Fa,24),Fb,t,u,v);
- s = m|n|o|p;
- (*dst->store) (dst, s);
-}
-
-static void
-IcCombineConjointOverU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralU (src, msk, dst, CombineAOver);
-/*
- uint32_t s, d;
- uint16_t a;
- uint16_t t;
- uint32_t m,n,o,p;
-
- s = IcCombineMaskU (src, msk);
- a = s >> 24;
- if (a != 0x00)
- {
- if (a != 0xff)
- {
- d = (*dst->fetch) (dst);
- a = IcCombineConjointOutPart (d >> 24, a);
- m = IcOverU(s,d,0,a,t);
- n = IcOverU(s,d,8,a,t);
- o = IcOverU(s,d,16,a,t);
- p = IcOverU(s,d,24,a,t);
- s = m|n|o|p;
- }
- (*dst->store) (dst, s);
- }
- */
-}
-
-static void
-IcCombineConjointOverC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralC (src, msk, dst, CombineAOver);
-}
-
-static void
-IcCombineConjointOverReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralU (src, msk, dst, CombineBOver);
-}
-
-static void
-IcCombineConjointOverReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralC (src, msk, dst, CombineBOver);
-}
-
-static void
-IcCombineConjointInU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralU (src, msk, dst, CombineAIn);
-}
-
-static void
-IcCombineConjointInC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralC (src, msk, dst, CombineAIn);
-}
-
-static void
-IcCombineConjointInReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralU (src, msk, dst, CombineBIn);
-}
-
-static void
-IcCombineConjointInReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralC (src, msk, dst, CombineBIn);
-}
-
-static void
-IcCombineConjointOutU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralU (src, msk, dst, CombineAOut);
-}
-
-static void
-IcCombineConjointOutC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralC (src, msk, dst, CombineAOut);
-}
-
-static void
-IcCombineConjointOutReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralU (src, msk, dst, CombineBOut);
-}
-
-static void
-IcCombineConjointOutReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralC (src, msk, dst, CombineBOut);
-}
-
-static void
-IcCombineConjointAtopU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralU (src, msk, dst, CombineAAtop);
-}
-
-static void
-IcCombineConjointAtopC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralC (src, msk, dst, CombineAAtop);
-}
-
-static void
-IcCombineConjointAtopReverseU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralU (src, msk, dst, CombineBAtop);
-}
-
-static void
-IcCombineConjointAtopReverseC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralC (src, msk, dst, CombineBAtop);
-}
-
-static void
-IcCombineConjointXorU (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralU (src, msk, dst, CombineXor);
-}
-
-static void
-IcCombineConjointXorC (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst)
-{
- IcCombineConjointGeneralC (src, msk, dst, CombineXor);
-}
-
-static IcCombineFunc const IcCombineFuncU[] = {
- IcCombineClear,
- IcCombineSrcU,
- IcCombineDst,
- IcCombineOverU,
- IcCombineOverReverseU,
- IcCombineInU,
- IcCombineInReverseU,
- IcCombineOutU,
- IcCombineOutReverseU,
- IcCombineAtopU,
- IcCombineAtopReverseU,
- IcCombineXorU,
- IcCombineAddU,
- IcCombineDisjointOverU, /* Saturate */
- 0,
- 0,
- IcCombineClear,
- IcCombineSrcU,
- IcCombineDst,
- IcCombineDisjointOverU,
- IcCombineDisjointOverReverseU,
- IcCombineDisjointInU,
- IcCombineDisjointInReverseU,
- IcCombineDisjointOutU,
- IcCombineDisjointOutReverseU,
- IcCombineDisjointAtopU,
- IcCombineDisjointAtopReverseU,
- IcCombineDisjointXorU,
- 0,
- 0,
- 0,
- 0,
- IcCombineClear,
- IcCombineSrcU,
- IcCombineDst,
- IcCombineConjointOverU,
- IcCombineConjointOverReverseU,
- IcCombineConjointInU,
- IcCombineConjointInReverseU,
- IcCombineConjointOutU,
- IcCombineConjointOutReverseU,
- IcCombineConjointAtopU,
- IcCombineConjointAtopReverseU,
- IcCombineConjointXorU,
-};
-
-static IcCombineFunc const IcCombineFuncC[] = {
- IcCombineClear,
- IcCombineSrcC,
- IcCombineDst,
- IcCombineOverC,
- IcCombineOverReverseC,
- IcCombineInC,
- IcCombineInReverseC,
- IcCombineOutC,
- IcCombineOutReverseC,
- IcCombineAtopC,
- IcCombineAtopReverseC,
- IcCombineXorC,
- IcCombineAddC,
- IcCombineDisjointOverC, /* Saturate */
- 0,
- 0,
- IcCombineClear, /* 0x10 */
- IcCombineSrcC,
- IcCombineDst,
- IcCombineDisjointOverC,
- IcCombineDisjointOverReverseC,
- IcCombineDisjointInC,
- IcCombineDisjointInReverseC,
- IcCombineDisjointOutC,
- IcCombineDisjointOutReverseC,
- IcCombineDisjointAtopC,
- IcCombineDisjointAtopReverseC,
- IcCombineDisjointXorC, /* 0x1b */
- 0,
- 0,
- 0,
- 0,
- IcCombineClear,
- IcCombineSrcC,
- IcCombineDst,
- IcCombineConjointOverC,
- IcCombineConjointOverReverseC,
- IcCombineConjointInC,
- IcCombineConjointInReverseC,
- IcCombineConjointOutC,
- IcCombineConjointOutReverseC,
- IcCombineConjointAtopC,
- IcCombineConjointAtopReverseC,
- IcCombineConjointXorC,
-};
-
-/*
- * All of the fetch functions
- */
-
-static uint32_t
-IcFetch_a8r8g8b8 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- return ((uint32_t *)line)[offset >> 5];
-}
-
-static uint32_t
-IcFetch_x8r8g8b8 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- return ((uint32_t *)line)[offset >> 5] | 0xff000000;
-}
-
-static uint32_t
-IcFetch_a8b8g8r8 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint32_t *)line)[offset >> 5];
-
- return ((pixel & 0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-static uint32_t
-IcFetch_x8b8g8r8 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint32_t *)line)[offset >> 5];
-
- return ((0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-static uint32_t
-IcFetch_r8g8b8 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint8_t *pixel = ((uint8_t *) line) + (offset >> 3);
-#if IMAGE_BYTE_ORDER == MSBFirst
- return (0xff000000 |
- (pixel[0] << 16) |
- (pixel[1] << 8) |
- (pixel[2]));
-#else
- return (0xff000000 |
- (pixel[2] << 16) |
- (pixel[1] << 8) |
- (pixel[0]));
-#endif
-}
-
-static uint32_t
-IcFetch_b8g8r8 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint8_t *pixel = ((uint8_t *) line) + (offset >> 3);
-#if IMAGE_BYTE_ORDER == MSBFirst
- return (0xff000000 |
- (pixel[2] << 16) |
- (pixel[1] << 8) |
- (pixel[0]));
-#else
- return (0xff000000 |
- (pixel[0] << 16) |
- (pixel[1] << 8) |
- (pixel[2]));
-#endif
-}
-
-static uint32_t
-IcFetch_r5g6b5 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t r,g,b;
-
- r = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) << 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-IcFetch_b5g6r5 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t r,g,b;
-
- b = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) >> 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-IcFetch_a1r5g5b5 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t a,r,g,b;
-
- a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24;
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (a | r | g | b);
-}
-
-static uint32_t
-IcFetch_x1r5g5b5 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t r,g,b;
-
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-IcFetch_a1b5g5r5 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t a,r,g,b;
-
- a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24;
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (a | r | g | b);
-}
-
-static uint32_t
-IcFetch_x1b5g5r5 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t r,g,b;
-
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-IcFetch_a4r4g4b4 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t a,r,g,b;
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (a | r | g | b);
-}
-
-static uint32_t
-IcFetch_x4r4g4b4 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t r,g,b;
-
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-IcFetch_a4b4g4r4 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t a,r,g,b;
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (a | r | g | b);
-}
-
-static uint32_t
-IcFetch_x4b4g4r4 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint16_t *) line)[offset >> 4];
- uint32_t r,g,b;
-
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-IcFetch_a8 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint8_t *) line)[offset>>3];
-
- return pixel << 24;
-}
-
-static uint32_t
-IcFetcha_a8 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint8_t *) line)[offset>>3];
-
- pixel |= pixel << 8;
- pixel |= pixel << 16;
- return pixel;
-}
-
-static uint32_t
-IcFetch_r3g3b2 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint8_t *) line)[offset>>3];
- uint32_t r,g,b;
-
- r = ((pixel & 0xe0) | ((pixel & 0xe0) >> 3) | ((pixel & 0xc0) >> 6)) << 16;
- g = ((pixel & 0x1c) | ((pixel & 0x18) >> 3) | ((pixel & 0x1c) << 3)) << 8;
- b = (((pixel & 0x03) ) |
- ((pixel & 0x03) << 2) |
- ((pixel & 0x03) << 4) |
- ((pixel & 0x03) << 6));
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-IcFetch_b2g3r3 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint8_t *) line)[offset>>3];
- uint32_t r,g,b;
-
- b = (((pixel & 0xc0) ) |
- ((pixel & 0xc0) >> 2) |
- ((pixel & 0xc0) >> 4) |
- ((pixel & 0xc0) >> 6));
- g = ((pixel & 0x38) | ((pixel & 0x38) >> 3) | ((pixel & 0x30) << 2)) << 8;
- r = (((pixel & 0x07) ) |
- ((pixel & 0x07) << 3) |
- ((pixel & 0x06) << 6)) << 16;
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-IcFetch_a2r2g2b2 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint8_t *) line)[offset>>3];
- uint32_t a,r,g,b;
-
- a = ((pixel & 0xc0) * 0x55) << 18;
- r = ((pixel & 0x30) * 0x55) << 12;
- g = ((pixel & 0x0c) * 0x55) << 6;
- b = ((pixel & 0x03) * 0x55);
- return a|r|g|b;
-}
-
-#define Fetch8(l,o) (((uint8_t *) (l))[(o) >> 3])
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4)
-#else
-#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) >> 4 : Fetch8(l,o) & 0xf)
-#endif
-
-static uint32_t
-IcFetch_a4 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = Fetch4(line, offset);
-
- pixel |= pixel << 4;
- return pixel << 24;
-}
-
-static uint32_t
-IcFetcha_a4 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = Fetch4(line, offset);
-
- pixel |= pixel << 4;
- pixel |= pixel << 8;
- pixel |= pixel << 16;
- return pixel;
-}
-
-static uint32_t
-IcFetch_r1g2b1 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = Fetch4(line, offset);
- uint32_t r,g,b;
-
- r = ((pixel & 0x8) * 0xff) << 13;
- g = ((pixel & 0x6) * 0x55) << 7;
- b = ((pixel & 0x1) * 0xff);
- return 0xff000000|r|g|b;
-}
-
-static uint32_t
-IcFetch_b1g2r1 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = Fetch4(line, offset);
- uint32_t r,g,b;
-
- b = ((pixel & 0x8) * 0xff) >> 3;
- g = ((pixel & 0x6) * 0x55) << 7;
- r = ((pixel & 0x1) * 0xff) << 16;
- return 0xff000000|r|g|b;
-}
-
-static uint32_t
-IcFetch_a1r1g1b1 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = Fetch4(line, offset);
- uint32_t a,r,g,b;
-
- a = ((pixel & 0x8) * 0xff) << 21;
- r = ((pixel & 0x4) * 0xff) << 14;
- g = ((pixel & 0x2) * 0xff) << 7;
- b = ((pixel & 0x1) * 0xff);
- return a|r|g|b;
-}
-
-static uint32_t
-IcFetch_a1b1g1r1 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = Fetch4(line, offset);
- uint32_t a,r,g,b;
-
- a = ((pixel & 0x8) * 0xff) << 21;
- r = ((pixel & 0x4) * 0xff) >> 3;
- g = ((pixel & 0x2) * 0xff) << 7;
- b = ((pixel & 0x1) * 0xff) << 16;
- return a|r|g|b;
-}
-
-static uint32_t
-IcFetcha_a1 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint32_t *)line)[offset >> 5];
- uint32_t a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- a |= a << 1;
- a |= a << 2;
- a |= a << 4;
- a |= a << 8;
- a |= a << 16;
- return a;
-}
-
-static uint32_t
-IcFetch_a1 (pixman_compositeOperand *op)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel = ((uint32_t *)line)[offset >> 5];
- uint32_t a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- a |= a << 1;
- a |= a << 2;
- a |= a << 4;
- return a << 24;
-}
-
-/*
- * All the store functions
- */
-
-#define Splita(v) uint32_t a = ((v) >> 24), r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff
-#define Split(v) uint32_t r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff
-
-static void
-IcStore_a8r8g8b8 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- ((uint32_t *)line)[offset >> 5] = value;
-}
-
-static void
-IcStore_x8r8g8b8 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- ((uint32_t *)line)[offset >> 5] = value & 0xffffff;
-}
-
-static void
-IcStore_a8b8g8r8 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- Splita(value);
- ((uint32_t *)line)[offset >> 5] = a << 24 | b << 16 | g << 8 | r;
-}
-
-static void
-IcStore_x8b8g8r8 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- Split(value);
- ((uint32_t *)line)[offset >> 5] = b << 16 | g << 8 | r;
-}
-
-static void
-IcStore_r8g8b8 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint8_t *pixel = ((uint8_t *) line) + (offset >> 3);
- Split(value);
-#if IMAGE_BYTE_ORDER == MSBFirst
- pixel[0] = r;
- pixel[1] = g;
- pixel[2] = b;
-#else
- pixel[0] = b;
- pixel[1] = g;
- pixel[2] = r;
-#endif
-}
-
-static void
-IcStore_b8g8r8 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint8_t *pixel = ((uint8_t *) line) + (offset >> 3);
- Split(value);
-#if IMAGE_BYTE_ORDER == MSBFirst
- pixel[0] = b;
- pixel[1] = g;
- pixel[2] = r;
-#else
- pixel[0] = r;
- pixel[1] = g;
- pixel[2] = b;
-#endif
-}
-
-static void
-IcStore_r5g6b5 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Split(value);
- *pixel = (((r << 8) & 0xf800) |
- ((g << 3) & 0x07e0) |
- ((b >> 3) ));
-}
-
-static void
-IcStore_b5g6r5 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Split(value);
- *pixel = (((b << 8) & 0xf800) |
- ((g << 3) & 0x07e0) |
- ((r >> 3) ));
-}
-
-static void
-IcStore_a1r5g5b5 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Splita(value);
- *pixel = (((a << 8) & 0x8000) |
- ((r << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((b >> 3) ));
-}
-
-static void
-IcStore_x1r5g5b5 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Split(value);
- *pixel = (((r << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((b >> 3) ));
-}
-
-static void
-IcStore_a1b5g5r5 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Splita(value);
- *pixel = (((a << 8) & 0x8000) |
- ((b << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((r >> 3) ));
-}
-
-static void
-IcStore_x1b5g5r5 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Split(value);
- *pixel = (((b << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((r >> 3) ));
-}
-
-static void
-IcStore_a4r4g4b4 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Splita(value);
- *pixel = (((a << 8) & 0xf000) |
- ((r << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((b >> 4) ));
-}
-
-static void
-IcStore_x4r4g4b4 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Split(value);
- *pixel = (((r << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((b >> 4) ));
-}
-
-static void
-IcStore_a4b4g4r4 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Splita(value);
- *pixel = (((a << 8) & 0xf000) |
- ((b << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((r >> 4) ));
-}
-
-static void
-IcStore_x4b4g4r4 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint16_t *pixel = ((uint16_t *) line) + (offset >> 4);
- Split(value);
- *pixel = (((b << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((r >> 4) ));
-}
-
-static void
-IcStore_a8 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint8_t *pixel = ((uint8_t *) line) + (offset >> 3);
- *pixel = value >> 24;
-}
-
-static void
-IcStore_r3g3b2 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint8_t *pixel = ((uint8_t *) line) + (offset >> 3);
- Split(value);
- *pixel = (((r ) & 0xe0) |
- ((g >> 3) & 0x1c) |
- ((b >> 6) ));
-}
-
-static void
-IcStore_b2g3r3 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint8_t *pixel = ((uint8_t *) line) + (offset >> 3);
- Split(value);
- *pixel = (((b ) & 0xe0) |
- ((g >> 3) & 0x1c) |
- ((r >> 6) ));
-}
-
-static void
-IcStore_a2r2g2b2 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint8_t *pixel = ((uint8_t *) line) + (offset >> 3);
- Splita(value);
- *pixel = (((a ) & 0xc0) |
- ((r >> 2) & 0x30) |
- ((g >> 4) & 0x0c) |
- ((b >> 6) ));
-}
-
-#define Store8(l,o,v) (((uint8_t *) l)[(o) >> 3] = (v))
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define Store4(l,o,v) Store8(l,o,((o) & 4 ? \
- (Fetch8(l,o) & 0xf0) | (v) : \
- (Fetch8(l,o) & 0x0f) | ((v) << 4)))
-#else
-#define Store4(l,o,v) Store8(l,o,((o) & 4 ? \
- (Fetch8(l,o) & 0x0f) | ((v) << 4) : \
- (Fetch8(l,o) & 0xf0) | (v)))
-#endif
-
-static void
-IcStore_a4 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- Store4(line,offset,value>>28);
-}
-
-static void
-IcStore_r1g2b1 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel;
-
- Split(value);
- pixel = (((r >> 4) & 0x8) |
- ((g >> 5) & 0x6) |
- ((b >> 7) ));
- Store4(line,offset,pixel);
-}
-
-static void
-IcStore_b1g2r1 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel;
-
- Split(value);
- pixel = (((b >> 4) & 0x8) |
- ((g >> 5) & 0x6) |
- ((r >> 7) ));
- Store4(line,offset,pixel);
-}
-
-static void
-IcStore_a1r1g1b1 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel;
- Splita(value);
- pixel = (((a >> 4) & 0x8) |
- ((r >> 5) & 0x4) |
- ((g >> 6) & 0x2) |
- ((b >> 7) ));
- Store4(line,offset,pixel);
-}
-
-static void
-IcStore_a1b1g1r1 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t pixel;
- Splita(value);
- pixel = (((a >> 4) & 0x8) |
- ((b >> 5) & 0x4) |
- ((g >> 6) & 0x2) |
- ((r >> 7) ));
- Store4(line,offset,pixel);
-}
-
-static void
-IcStore_a1 (pixman_compositeOperand *op, uint32_t value)
-{
- pixman_bits_t *line = op->u.drawable.line; uint32_t offset = op->u.drawable.offset;
- uint32_t *pixel = ((uint32_t *) line) + (offset >> 5);
- uint32_t mask = IcStipMask(offset & 0x1f, 1);
-
- value = value & 0x80000000 ? mask : 0;
- *pixel = (*pixel & ~mask) | value;
-}
-
-static uint32_t
-IcFetch_external (pixman_compositeOperand *op)
-{
- uint32_t rgb = (*op[1].fetch) (&op[1]);
- uint32_t a = (*op[2].fetch) (&op[2]);
-
- return (rgb & 0xffffff) | (a & 0xff000000);
-}
-
-
-static uint32_t
-IcFetcha_external (pixman_compositeOperand *op)
-{
- return (*op[2].fetch) (&op[2]);
-}
-
-static void
-IcStore_external (pixman_compositeOperand *op, uint32_t value)
-{
- (*op[1].store) (&op[1], value | 0xff000000);
- (*op[2].store) (&op[2], value & 0xff000000);
-}
-
-static uint32_t
-IcFetch_transform (pixman_compositeOperand *op)
-{
- pixman_vector_t v;
- int x, y;
- int minx, maxx, miny, maxy;
- uint32_t rtot, gtot, btot, atot;
- uint32_t xerr, yerr;
- uint32_t bits;
- pixman_box16_t box;
-
- v.vector[0] = IntToxFixed(op->u.transform.x);
- v.vector[1] = IntToxFixed(op->u.transform.y);
- v.vector[2] = xFixed1;
- if (!pixman_transform_point (op->u.transform.transform, &v))
- return 0;
- switch (op->u.transform.filter) {
- case PIXMAN_FILTER_FAST:
- case PIXMAN_FILTER_NEAREST:
- y = xFixedToInt (v.vector[1]) + op->u.transform.top_y;
- x = xFixedToInt (v.vector[0]) + op->u.transform.left_x;
- if (op->u.transform.repeat)
- {
- y = MOD (y, op->u.transform.height);
- x = MOD (x, op->u.transform.width);
- }
- if (pixman_region_contains_point (op->clip, x, y, &box))
- {
- (*op[1].set) (&op[1], x, y);
- bits = (*op[1].fetch) (&op[1]);
- }
- else
- bits = 0;
- break;
- case PIXMAN_FILTER_GOOD:
- case PIXMAN_FILTER_BEST:
- case PIXMAN_FILTER_BILINEAR:
- rtot = gtot = btot = atot = 0;
- miny = xFixedToInt (v.vector[1]) + op->u.transform.top_y;
- maxy = xFixedToInt (xFixedCeil (v.vector[1])) + op->u.transform.top_y;
-
- minx = xFixedToInt (v.vector[0]) + op->u.transform.left_x;
- maxx = xFixedToInt (xFixedCeil (v.vector[0])) + op->u.transform.left_x;
-
- yerr = xFixed1 - xFixedFrac (v.vector[1]);
- for (y = miny; y <= maxy; y++)
- {
- uint32_t lrtot = 0, lgtot = 0, lbtot = 0, latot = 0;
- int tx, ty;
-
- if (op->u.transform.repeat)
- ty = MOD (y, op->u.transform.height);
- else
- ty = y;
-
- xerr = xFixed1 - xFixedFrac (v.vector[0]);
- for (x = minx; x <= maxx; x++)
- {
- if (op->u.transform.repeat)
- tx = MOD (x, op->u.transform.width);
- else
- tx = x;
-
- if (pixman_region_contains_point (op->clip, tx, ty, &box))
- {
- (*op[1].set) (&op[1], tx, ty);
- bits = (*op[1].fetch) (&op[1]);
- {
- Splita(bits);
- lrtot += r * xerr;
- lgtot += g * xerr;
- lbtot += b * xerr;
- latot += a * xerr;
- }
- }
- xerr = xFixed1 - xerr;
- }
- rtot += (lrtot >> 10) * yerr;
- gtot += (lgtot >> 10) * yerr;
- btot += (lbtot >> 10) * yerr;
- atot += (latot >> 10) * yerr;
- yerr = xFixed1 - yerr;
- }
- if ((atot >>= 22) > 0xff) atot = 0xff;
- if ((rtot >>= 22) > 0xff) rtot = 0xff;
- if ((gtot >>= 22) > 0xff) gtot = 0xff;
- if ((btot >>= 22) > 0xff) btot = 0xff;
- bits = ((atot << 24) |
- (rtot << 16) |
- (gtot << 8) |
- (btot ));
- break;
- default:
- bits = 0;
- break;
- }
- return bits;
-}
-
-static uint32_t
-IcFetcha_transform (pixman_compositeOperand *op)
-{
- pixman_vector_t v;
- int x, y;
- int minx, maxx, miny, maxy;
- uint32_t rtot, gtot, btot, atot;
- uint32_t xerr, yerr;
- uint32_t bits;
- pixman_box16_t box;
-
- v.vector[0] = IntToxFixed(op->u.transform.x);
- v.vector[1] = IntToxFixed(op->u.transform.y);
- v.vector[2] = xFixed1;
- if (!pixman_transform_point (op->u.transform.transform, &v))
- return 0;
- switch (op->u.transform.filter) {
- case PIXMAN_FILTER_FAST:
- case PIXMAN_FILTER_NEAREST:
- y = xFixedToInt (v.vector[1]) + op->u.transform.left_x;
- x = xFixedToInt (v.vector[0]) + op->u.transform.top_y;
- if (op->u.transform.repeat)
- {
- y = MOD (y, op->u.transform.height);
- x = MOD (x, op->u.transform.width);
- }
- if (pixman_region_contains_point (op->clip, x, y, &box))
- {
- (*op[1].set) (&op[1], x, y);
- bits = (*op[1].fetcha) (&op[1]);
- }
- else
- bits = 0;
- break;
- case PIXMAN_FILTER_GOOD:
- case PIXMAN_FILTER_BEST:
- case PIXMAN_FILTER_BILINEAR:
- rtot = gtot = btot = atot = 0;
-
- miny = xFixedToInt (v.vector[1]) + op->u.transform.top_y;
- maxy = xFixedToInt (xFixedCeil (v.vector[1])) + op->u.transform.top_y;
-
- minx = xFixedToInt (v.vector[0]) + op->u.transform.left_x;
- maxx = xFixedToInt (xFixedCeil (v.vector[0])) + op->u.transform.left_x;
-
- yerr = xFixed1 - xFixedFrac (v.vector[1]);
- for (y = miny; y <= maxy; y++)
- {
- uint32_t lrtot = 0, lgtot = 0, lbtot = 0, latot = 0;
- int tx, ty;
-
- if (op->u.transform.repeat)
- ty = MOD (y, op->u.transform.height);
- else
- ty = y;
-
- xerr = xFixed1 - xFixedFrac (v.vector[0]);
- for (x = minx; x <= maxx; x++)
- {
- if (op->u.transform.repeat)
- tx = MOD (x, op->u.transform.width);
- else
- tx = x;
-
- if (pixman_region_contains_point (op->clip, tx, ty, &box))
- {
- (*op[1].set) (&op[1], tx, ty);
- bits = (*op[1].fetcha) (&op[1]);
- {
- Splita(bits);
- lrtot += r * xerr;
- lgtot += g * xerr;
- lbtot += b * xerr;
- latot += a * xerr;
- }
- }
- x++;
- xerr = xFixed1 - xerr;
- }
- rtot += (lrtot >> 10) * yerr;
- gtot += (lgtot >> 10) * yerr;
- btot += (lbtot >> 10) * yerr;
- atot += (latot >> 10) * yerr;
- y++;
- yerr = xFixed1 - yerr;
- }
- if ((atot >>= 22) > 0xff) atot = 0xff;
- if ((rtot >>= 22) > 0xff) rtot = 0xff;
- if ((gtot >>= 22) > 0xff) gtot = 0xff;
- if ((btot >>= 22) > 0xff) btot = 0xff;
- bits = ((atot << 24) |
- (rtot << 16) |
- (gtot << 8) |
- (btot ));
- break;
- default:
- bits = 0;
- break;
- }
- return bits;
-}
-
-static IcAccessMap const icAccessMap[] = {
- /* 32bpp formats */
- { PICT_a8r8g8b8, IcFetch_a8r8g8b8, IcFetch_a8r8g8b8, IcStore_a8r8g8b8 },
- { PICT_x8r8g8b8, IcFetch_x8r8g8b8, IcFetch_x8r8g8b8, IcStore_x8r8g8b8 },
- { PICT_a8b8g8r8, IcFetch_a8b8g8r8, IcFetch_a8b8g8r8, IcStore_a8b8g8r8 },
- { PICT_x8b8g8r8, IcFetch_x8b8g8r8, IcFetch_x8b8g8r8, IcStore_x8b8g8r8 },
-
- /* 24bpp formats */
- { PICT_r8g8b8, IcFetch_r8g8b8, IcFetch_r8g8b8, IcStore_r8g8b8 },
- { PICT_b8g8r8, IcFetch_b8g8r8, IcFetch_b8g8r8, IcStore_b8g8r8 },
-
- /* 16bpp formats */
- { PICT_r5g6b5, IcFetch_r5g6b5, IcFetch_r5g6b5, IcStore_r5g6b5 },
- { PICT_b5g6r5, IcFetch_b5g6r5, IcFetch_b5g6r5, IcStore_b5g6r5 },
-
- { PICT_a1r5g5b5, IcFetch_a1r5g5b5, IcFetch_a1r5g5b5, IcStore_a1r5g5b5 },
- { PICT_x1r5g5b5, IcFetch_x1r5g5b5, IcFetch_x1r5g5b5, IcStore_x1r5g5b5 },
- { PICT_a1b5g5r5, IcFetch_a1b5g5r5, IcFetch_a1b5g5r5, IcStore_a1b5g5r5 },
- { PICT_x1b5g5r5, IcFetch_x1b5g5r5, IcFetch_x1b5g5r5, IcStore_x1b5g5r5 },
- { PICT_a4r4g4b4, IcFetch_a4r4g4b4, IcFetch_a4r4g4b4, IcStore_a4r4g4b4 },
- { PICT_x4r4g4b4, IcFetch_x4r4g4b4, IcFetch_x4r4g4b4, IcStore_x4r4g4b4 },
- { PICT_a4b4g4r4, IcFetch_a4b4g4r4, IcFetch_a4b4g4r4, IcStore_a4b4g4r4 },
- { PICT_x4b4g4r4, IcFetch_x4b4g4r4, IcFetch_x4b4g4r4, IcStore_x4b4g4r4 },
-
- /* 8bpp formats */
- { PICT_a8, IcFetch_a8, IcFetcha_a8, IcStore_a8 },
- { PICT_r3g3b2, IcFetch_r3g3b2, IcFetch_r3g3b2, IcStore_r3g3b2 },
- { PICT_b2g3r3, IcFetch_b2g3r3, IcFetch_b2g3r3, IcStore_b2g3r3 },
- { PICT_a2r2g2b2, IcFetch_a2r2g2b2, IcFetch_a2r2g2b2, IcStore_a2r2g2b2 },
-
- /* 4bpp formats */
- { PICT_a4, IcFetch_a4, IcFetcha_a4, IcStore_a4 },
- { PICT_r1g2b1, IcFetch_r1g2b1, IcFetch_r1g2b1, IcStore_r1g2b1 },
- { PICT_b1g2r1, IcFetch_b1g2r1, IcFetch_b1g2r1, IcStore_b1g2r1 },
- { PICT_a1r1g1b1, IcFetch_a1r1g1b1, IcFetch_a1r1g1b1, IcStore_a1r1g1b1 },
- { PICT_a1b1g1r1, IcFetch_a1b1g1r1, IcFetch_a1b1g1r1, IcStore_a1b1g1r1 },
-
- /* 1bpp formats */
- { PICT_a1, IcFetch_a1, IcFetcha_a1, IcStore_a1 },
-};
-#define NumAccessMap (sizeof icAccessMap / sizeof icAccessMap[0])
-
-static void
-IcStepOver (pixman_compositeOperand *op)
-{
- op->u.drawable.offset += op->u.drawable.bpp;
-}
-
-static void
-IcStepDown (pixman_compositeOperand *op)
-{
- op->u.drawable.line += op->u.drawable.stride;
- op->u.drawable.offset = op->u.drawable.start_offset;
-}
-
-static void
-IcSet (pixman_compositeOperand *op, int x, int y)
-{
- op->u.drawable.line = op->u.drawable.top_line + y * op->u.drawable.stride;
- op->u.drawable.offset = op->u.drawable.left_offset + x * op->u.drawable.bpp;
-}
-
-static void
-IcStepOver_external (pixman_compositeOperand *op)
-{
- (*op[1].over) (&op[1]);
- (*op[2].over) (&op[2]);
-}
-
-static void
-IcStepDown_external (pixman_compositeOperand *op)
-{
- (*op[1].down) (&op[1]);
- (*op[2].down) (&op[2]);
-}
-
-static void
-IcSet_external (pixman_compositeOperand *op, int x, int y)
-{
- (*op[1].set) (&op[1], x, y);
- (*op[2].set) (&op[2],
- x - op->u.external.alpha_dx,
- y - op->u.external.alpha_dy);
-}
-
-static void
-IcStepOver_transform (pixman_compositeOperand *op)
-{
- op->u.transform.x++;
-}
-
-static void
-IcStepDown_transform (pixman_compositeOperand *op)
-{
- op->u.transform.y++;
- op->u.transform.x = op->u.transform.start_x;
-}
-
-static void
-IcSet_transform (pixman_compositeOperand *op, int x, int y)
-{
- op->u.transform.x = x - op->u.transform.left_x;
- op->u.transform.y = y - op->u.transform.top_y;
-}
-
-
-int
-IcBuildCompositeOperand (pixman_image_t *image,
- pixman_compositeOperand op[4],
- int16_t x,
- int16_t y,
- int transform,
- int alpha)
-{
- /* Check for transform */
- if (transform && image->transform)
- {
- if (!IcBuildCompositeOperand (image, &op[1], 0, 0, 0, alpha))
- return 0;
-
- op->u.transform.top_y = image->pixels->y;
- op->u.transform.left_x = image->pixels->x;
-
- op->u.transform.start_x = x - op->u.transform.left_x;
- op->u.transform.x = op->u.transform.start_x;
- op->u.transform.y = y - op->u.transform.top_y;
- op->u.transform.transform = image->transform;
- op->u.transform.filter = image->filter;
- op->u.transform.repeat = image->repeat;
- op->u.transform.width = image->pixels->width;
- op->u.transform.height = image->pixels->height;
-
- op->fetch = IcFetch_transform;
- op->fetcha = IcFetcha_transform;
- op->store = 0;
- op->over = IcStepOver_transform;
- op->down = IcStepDown_transform;
- op->set = IcSet_transform;
-
- op->clip = op[1].clip;
-
- return 1;
- }
- /* Check for external alpha */
- else if (alpha && image->alphaMap)
- {
- if (!IcBuildCompositeOperand (image, &op[1], x, y, 0, 0))
- return 0;
- if (!IcBuildCompositeOperand (image->alphaMap, &op[2],
- x - image->alphaOrigin.x,
- y - image->alphaOrigin.y,
- 0, 0))
- return 0;
- op->u.external.alpha_dx = image->alphaOrigin.x;
- op->u.external.alpha_dy = image->alphaOrigin.y;
-
- op->fetch = IcFetch_external;
- op->fetcha = IcFetcha_external;
- op->store = IcStore_external;
- op->over = IcStepOver_external;
- op->down = IcStepDown_external;
- op->set = IcSet_external;
-
- op->clip = op[1].clip;
-
- return 1;
- }
- /* Build simple operand */
- else
- {
- int i;
- int xoff, yoff;
-
- for (i = 0; i < NumAccessMap; i++)
- if (icAccessMap[i].format_code == image->format_code)
- {
- pixman_bits_t *bits;
- IcStride stride;
- int bpp;
-
- op->fetch = icAccessMap[i].fetch;
- op->fetcha = icAccessMap[i].fetcha;
- op->store = icAccessMap[i].store;
- op->over = IcStepOver;
- op->down = IcStepDown;
- op->set = IcSet;
-
- op->clip = image->pCompositeClip;
-
- IcGetPixels (image->pixels, bits, stride, bpp,
- xoff, yoff);
- if (image->repeat && image->pixels->width == 1 &&
- image->pixels->height == 1)
- {
- bpp = 0;
- stride = 0;
- }
- /*
- * Coordinates of upper left corner of drawable
- */
- op->u.drawable.top_line = bits + yoff * stride;
- op->u.drawable.left_offset = xoff * bpp;
-
- /*
- * Starting position within drawable
- */
- op->u.drawable.start_offset = op->u.drawable.left_offset + x * bpp;
- op->u.drawable.line = op->u.drawable.top_line + y * stride;
- op->u.drawable.offset = op->u.drawable.start_offset;
-
- op->u.drawable.stride = stride;
- op->u.drawable.bpp = bpp;
- return 1;
- }
- return 0;
- }
-}
-
-void
-pixman_compositeGeneral (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- pixman_compositeOperand src[4],msk[4],dst[4],*pmsk;
- pixman_compositeOperand *srcPict, *srcAlpha;
- pixman_compositeOperand *dstPict, *dstAlpha;
- pixman_compositeOperand *mskPict = 0, *mskAlpha = 0;
- IcCombineFunc f;
- int w;
-
- if (!IcBuildCompositeOperand (iSrc, src, xSrc, ySrc, 1, 1))
- return;
- if (!IcBuildCompositeOperand (iDst, dst, xDst, yDst, 0, 1))
- return;
- if (iSrc->alphaMap)
- {
- srcPict = &src[1];
- srcAlpha = &src[2];
- }
- else
- {
- srcPict = &src[0];
- srcAlpha = 0;
- }
- if (iDst->alphaMap)
- {
- dstPict = &dst[1];
- dstAlpha = &dst[2];
- }
- else
- {
- dstPict = &dst[0];
- dstAlpha = 0;
- }
- f = IcCombineFuncU[op];
- if (iMask)
- {
- if (!IcBuildCompositeOperand (iMask, msk, xMask, yMask, 1, 1))
- return;
- pmsk = msk;
- if (iMask->componentAlpha)
- f = IcCombineFuncC[op];
- if (iMask->alphaMap)
- {
- mskPict = &msk[1];
- mskAlpha = &msk[2];
- }
- else
- {
- mskPict = &msk[0];
- mskAlpha = 0;
- }
- }
- else
- pmsk = 0;
- while (height--)
- {
- w = width;
-
- while (w--)
- {
- (*f) (src, pmsk, dst);
- (*src->over) (src);
- (*dst->over) (dst);
- if (pmsk)
- (*pmsk->over) (pmsk);
- }
- (*src->down) (src);
- (*dst->down) (dst);
- if (pmsk)
- (*pmsk->down) (pmsk);
- }
-}
-
diff --git a/pixman/src/icformat.c b/pixman/src/icformat.c
deleted file mode 100644
index 8e93ca0b4..000000000
--- a/pixman/src/icformat.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright Β© 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "icint.h"
-
-#define Mask(n) ((n) == 32 ? 0xffffffff : ((1 << (n))-1))
-
-pixman_format_t *
-pixman_format_create (pixman_format_name_t name)
-{
- switch (name) {
- case PIXMAN_FORMAT_NAME_ARGB32:
- return pixman_format_create_masks (32,
- 0xff000000,
- 0x00ff0000,
- 0x0000ff00,
- 0x000000ff);
- case PIXMAN_FORMAT_NAME_RGB24:
- return pixman_format_create_masks (32,
- 0x0,
- 0xff0000,
- 0x00ff00,
- 0x0000ff);
- case PIXMAN_FORMAT_NAME_A8:
- return pixman_format_create_masks (8, 0xff,
- 0, 0, 0);
- case PIXMAN_FORMAT_NAME_A1:
- return pixman_format_create_masks (1, 0x1,
- 0, 0, 0);
- }
-
- return NULL;
-}
-
-/* XXX: There's some nonsense going on here. The macros above help
- pixman_format_create_masks to encode a format into an int, while
- immediately afterwards pixman_format_init goes through the effort of
- decoding it. This should all be disentagled, (it's probably
- possible to just eliminate the encoding macros altogether). */
-pixman_format_t *
-pixman_format_create_masks (int bpp,
- int alpha_mask,
- int red_mask,
- int green_mask,
- int blue_mask)
-{
- int type;
- int format_code;
- pixman_format_t *format;
-
- if (red_mask == 0 && green_mask == 0 && blue_mask == 0)
- type = PICT_TYPE_A;
- else if (red_mask > blue_mask)
- type = PICT_TYPE_ARGB;
- else
- type = PICT_TYPE_ABGR;
-
- format_code = PICT_FORMAT (bpp, type,
- _IcOnes (alpha_mask),
- _IcOnes (red_mask),
- _IcOnes (green_mask),
- _IcOnes (blue_mask));
-
- format = malloc (sizeof (pixman_format_t));
- if (format == NULL)
- return NULL;
-
- pixman_format_init (format, format_code);
-
- return format;
-}
-
-void
-pixman_format_init (pixman_format_t *format, int format_code)
-{
- memset (format, 0, sizeof (pixman_format_t));
-
-/* XXX: What do we want to lodge in here?
- format->id = FakeClientID (0);
-*/
- format->format_code = format_code;
-
- switch (PICT_FORMAT_TYPE(format_code)) {
- case PICT_TYPE_ARGB:
-
- format->alphaMask = Mask(PICT_FORMAT_A(format_code));
- if (format->alphaMask)
- format->alpha = (PICT_FORMAT_R(format_code) +
- PICT_FORMAT_G(format_code) +
- PICT_FORMAT_B(format_code));
-
- format->redMask = Mask(PICT_FORMAT_R(format_code));
- format->red = (PICT_FORMAT_G(format_code) +
- PICT_FORMAT_B(format_code));
-
- format->greenMask = Mask(PICT_FORMAT_G(format_code));
- format->green = PICT_FORMAT_B(format_code);
-
- format->blueMask = Mask(PICT_FORMAT_B(format_code));
- format->blue = 0;
- break;
-
- case PICT_TYPE_ABGR:
-
- format->alphaMask = Mask(PICT_FORMAT_A(format_code));
- if (format->alphaMask)
- format->alpha = (PICT_FORMAT_B(format_code) +
- PICT_FORMAT_G(format_code) +
- PICT_FORMAT_R(format_code));
-
- format->blueMask = Mask(PICT_FORMAT_B(format_code));
- format->blue = (PICT_FORMAT_G(format_code) +
- PICT_FORMAT_R(format_code));
-
- format->greenMask = Mask(PICT_FORMAT_G(format_code));
- format->green = PICT_FORMAT_R(format_code);
-
- format->redMask = Mask(PICT_FORMAT_R(format_code));
- format->red = 0;
- break;
-
- case PICT_TYPE_A:
-
- format->alpha = 0;
- format->alphaMask = Mask(PICT_FORMAT_A(format_code));
-
- /* remaining fields already set to zero */
- break;
- }
-
- format->depth = _IcOnes ((format->alphaMask << format->alpha) |
- (format->redMask << format->red) |
- (format->blueMask << format->blue) |
- (format->greenMask << format->green));
-}
-slim_hidden_def(pixman_format_init);
-
-void
-pixman_format_destroy (pixman_format_t *format)
-{
- free (format);
-}
-
-void
-pixman_format_get_masks (pixman_format_t *format,
- int *bpp,
- int *alpha_mask,
- int *red_mask,
- int *green_mask,
- int *blue_mask)
-{
- *bpp = PICT_FORMAT_BPP (format->format_code);
-
- if (format->alphaMask)
- *alpha_mask = format->alphaMask << format->alpha;
- else
- *alpha_mask = 0;
-
- if (format->redMask)
- *red_mask = format->redMask << format->red;
- else
- *red_mask = 0;
-
- if (format->greenMask)
- *green_mask = format->greenMask << format->green;
- else
- *green_mask = 0;
-
- if (format->blueMask)
- *blue_mask = format->blueMask << format->blue;
- else
- *blue_mask = 0;
-}
diff --git a/pixman/src/icimage.c b/pixman/src/icimage.c
deleted file mode 100644
index 24e6e105b..000000000
--- a/pixman/src/icimage.c
+++ /dev/null
@@ -1,681 +0,0 @@
-/*
- * Copyright Β© 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "icint.h"
-
-pixman_image_t *
-pixman_image_create (pixman_format_t *format,
- int width,
- int height)
-{
- pixman_image_t *image;
- IcPixels *pixels;
-
- pixels = IcPixelsCreate (width, height, format->depth);
- if (pixels == NULL)
- return NULL;
-
- image = pixman_image_createForPixels (pixels, format);
- if (image == NULL) {
- IcPixelsDestroy (pixels);
- return NULL;
- }
-
- image->owns_pixels = 1;
-
- return image;
-}
-slim_hidden_def(pixman_image_create);
-
-pixman_image_t *
-pixman_image_create_for_data (pixman_bits_t *data, pixman_format_t *format, int width, int height, int bpp, int stride)
-{
- pixman_image_t *image;
- IcPixels *pixels;
-
- pixels = IcPixelsCreateForData (data, width, height, format->depth, bpp, stride);
- if (pixels == NULL)
- return NULL;
-
- image = pixman_image_createForPixels (pixels, format);
- if (image == NULL) {
- IcPixelsDestroy (pixels);
- return NULL;
- }
-
- image->owns_pixels = 1;
-
- return image;
-}
-
-pixman_image_t *
-pixman_image_createForPixels (IcPixels *pixels,
- pixman_format_t *format)
-{
- pixman_image_t *image;
-
- image = malloc (sizeof (pixman_image_t));
- if (!image)
- {
- return NULL;
- }
-
- image->pixels = pixels;
- image->image_format = *format;
- image->format_code = format->format_code;
-/* XXX: What's all this about?
- if (pDrawable->type == DRAWABLE_PIXMAP)
- {
- ++((PixmapPtr)pDrawable)->refcnt;
- image->pNext = 0;
- }
- else
- {
- image->pNext = GetPictureWindow(((WindowPtr) pDrawable));
- SetPictureWindow(((WindowPtr) pDrawable), image);
- }
-*/
-
- pixman_image_init (image);
-
- return image;
-}
-
-void
-pixman_image_init (pixman_image_t *image)
-{
- image->refcnt = 1;
- image->repeat = 0;
- image->graphicsExposures = 0;
- image->subWindowMode = ClipByChildren;
- image->polyEdge = PolyEdgeSharp;
- image->polyMode = PolyModePrecise;
- /* XXX: In the server this was 0. Why? */
- image->freeCompClip = 1;
- image->clientClipType = CT_NONE;
- image->componentAlpha = 0;
-
- image->alphaMap = 0;
- image->alphaOrigin.x = 0;
- image->alphaOrigin.y = 0;
-
- image->clipOrigin.x = 0;
- image->clipOrigin.y = 0;
- image->clientClip = 0;
-
- image->dither = 0L;
-
- image->stateChanges = (1 << (CPLastBit+1)) - 1;
-/* XXX: What to lodge here?
- image->serialNumber = GC_CHANGE_SERIAL_BIT;
-*/
-
- image->pCompositeClip = pixman_region_create();
- pixman_region_union_rect (image->pCompositeClip, image->pCompositeClip,
- 0, 0, image->pixels->width, image->pixels->height);
-
- image->transform = NULL;
-
- image->filter = PIXMAN_FILTER_NEAREST;
- image->filter_params = 0;
- image->filter_nparams = 0;
-
-
- image->owns_pixels = 0;
-}
-
-void
-pixman_image_set_component_alpha (pixman_image_t *image,
- int component_alpha)
-{
- if (image)
- image->componentAlpha = component_alpha;
-}
-slim_hidden_def(pixman_image_set_component_alpha);
-
-int
-pixman_image_set_transform (pixman_image_t *image,
- pixman_transform_t *transform)
-{
- static const pixman_transform_t identity = { {
- { xFixed1, 0x00000, 0x00000 },
- { 0x00000, xFixed1, 0x00000 },
- { 0x00000, 0x00000, xFixed1 },
- } };
-
- if (transform && memcmp (transform, &identity, sizeof (pixman_transform_t)) == 0)
- transform = 0;
-
- if (transform)
- {
- if (!image->transform)
- {
- image->transform = malloc (sizeof (pixman_transform_t));
- if (!image->transform)
- return 1;
- }
- *image->transform = *transform;
- }
- else
- {
- if (image->transform)
- {
- free (image->transform);
- image->transform = 0;
- }
- }
- return 0;
-}
-
-void
-pixman_image_set_repeat (pixman_image_t *image,
- int repeat)
-{
- if (image)
- image->repeat = repeat;
-}
-slim_hidden_def(pixman_image_set_repeat);
-
-void
-pixman_image_set_filter (pixman_image_t *image,
- pixman_filter_t filter)
-{
- if (image)
- image->filter = filter;
-}
-
-int
-pixman_image_get_width (pixman_image_t *image)
-{
- return image->pixels->width;
-}
-
-int
-pixman_image_get_height (pixman_image_t *image)
-{
- return image->pixels->height;
-}
-
-int
-pixman_image_get_depth (pixman_image_t *image)
-{
- return image->pixels->depth;
-}
-
-int
-pixman_image_get_stride (pixman_image_t *image)
-{
- return image->pixels->stride;
-}
-
-pixman_format_t *
-pixman_image_get_format (pixman_image_t *image)
-{
- return &image->image_format;
-}
-
-pixman_bits_t *
-pixman_image_get_data (pixman_image_t *image)
-{
- return image->pixels->data;
-}
-
-void
-pixman_image_destroy (pixman_image_t *image)
-{
- if (image->freeCompClip)
- pixman_region_destroy (image->pCompositeClip);
-
- if (image->owns_pixels)
- IcPixelsDestroy (image->pixels);
-
- if (image->transform)
- free (image->transform);
-
- free (image);
-}
-slim_hidden_def(pixman_image_destroy);
-
-void
-pixman_image_destroyClip (pixman_image_t *image)
-{
- switch (image->clientClipType) {
- case CT_NONE:
- return;
- case CT_PIXMAP:
- pixman_image_destroy (image->clientClip);
- break;
- default:
- pixman_region_destroy (image->clientClip);
- break;
- }
- image->clientClip = NULL;
- image->clientClipType = CT_NONE;
-}
-
-int
-pixman_image_set_clip_region (pixman_image_t *image,
- pixman_region16_t *region)
-{
- pixman_image_destroyClip (image);
- if (region) {
- image->clientClip = pixman_region_create ();
- pixman_region_copy (image->clientClip, region);
- image->clientClipType = CT_REGION;
- }
-
- image->pCompositeClip = pixman_region_create();
- pixman_region_union_rect (image->pCompositeClip, image->pCompositeClip,
- 0, 0, image->pixels->width, image->pixels->height);
- if (region) {
- pixman_region_translate (image->pCompositeClip,
- - image->clipOrigin.x,
- - image->clipOrigin.y);
- pixman_region_intersect (image->pCompositeClip,
- image->pCompositeClip,
- region);
- pixman_region_translate (image->pCompositeClip,
- image->clipOrigin.x,
- image->clipOrigin.y);
- }
-
- image->stateChanges |= CPClipMask;
- return 0;
-}
-
-#define BOUND(v) (int16_t) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
-
-static __inline int
-IcClipImageReg (pixman_region16_t *region,
- pixman_region16_t *clip,
- int dx,
- int dy)
-{
- if (pixman_region_num_rects (region) == 1 &&
- pixman_region_num_rects (clip) == 1)
- {
- pixman_box16_t *pRbox = pixman_region_rects (region);
- pixman_box16_t *pCbox = pixman_region_rects (clip);
- int v;
-
- if (pRbox->x1 < (v = pCbox->x1 + dx))
- pRbox->x1 = BOUND(v);
- if (pRbox->x2 > (v = pCbox->x2 + dx))
- pRbox->x2 = BOUND(v);
- if (pRbox->y1 < (v = pCbox->y1 + dy))
- pRbox->y1 = BOUND(v);
- if (pRbox->y2 > (v = pCbox->y2 + dy))
- pRbox->y2 = BOUND(v);
- if (pRbox->x1 >= pRbox->x2 ||
- pRbox->y1 >= pRbox->y2)
- {
- pixman_region_empty (region);
- }
- }
- else
- {
- pixman_region_translate (region, dx, dy);
- pixman_region_intersect (region, clip, region);
- pixman_region_translate (region, -dx, -dy);
- }
- return 1;
-}
-
-static __inline int
-IcClipImageSrc (pixman_region16_t *region,
- pixman_image_t *image,
- int dx,
- int dy)
-{
- /* XXX what to do with clipping from transformed pictures? */
- if (image->transform)
- return 1;
- if (image->repeat)
- {
- if (image->clientClipType != CT_NONE)
- {
- pixman_region_translate (region,
- dx - image->clipOrigin.x,
- dy - image->clipOrigin.y);
- pixman_region_intersect (region, image->clientClip, region);
- pixman_region_translate (region,
- - (dx - image->clipOrigin.x),
- - (dy - image->clipOrigin.y));
- }
- return 1;
- }
- else
- {
- return IcClipImageReg (region,
- image->pCompositeClip,
- dx,
- dy);
- }
- return 1;
-}
-
-/* XXX: Need to decide what to do with this
-#define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val)
-
-#define NEXT_PTR(_type) ((_type) ulist++->ptr)
-
-int
-pixman_image_change (pixman_image_t *image,
- Mask vmask,
- unsigned int *vlist,
- DevUnion *ulist,
- int *error_value)
-{
- BITS32 index2;
- int error = 0;
- BITS32 maskQ;
-
- maskQ = vmask;
- while (vmask && !error)
- {
- index2 = (BITS32) lowbit (vmask);
- vmask &= ~index2;
- image->stateChanges |= index2;
- switch (index2)
- {
- case CPRepeat:
- {
- unsigned int newr;
- newr = NEXT_VAL(unsigned int);
- if (newr <= xTrue)
- image->repeat = newr;
- else
- {
- *error_value = newr;
- error = BadValue;
- }
- }
- break;
- case CPAlphaMap:
- {
- pixman_image_t *iAlpha;
-
- iAlpha = NEXT_PTR(pixman_image_t *);
- if (iAlpha)
- iAlpha->refcnt++;
- if (image->alphaMap)
- pixman_image_destroy ((void *) image->alphaMap);
- image->alphaMap = iAlpha;
- }
- break;
- case CPAlphaXOrigin:
- image->alphaOrigin.x = NEXT_VAL(int16_t);
- break;
- case CPAlphaYOrigin:
- image->alphaOrigin.y = NEXT_VAL(int16_t);
- break;
- case CPClipXOrigin:
- image->clipOrigin.x = NEXT_VAL(int16_t);
- break;
- case CPClipYOrigin:
- image->clipOrigin.y = NEXT_VAL(int16_t);
- break;
- case CPClipMask:
- {
- pixman_image_t *mask;
- int clipType;
-
- mask = NEXT_PTR(pixman_image_t *);
- if (mask) {
- clipType = CT_PIXMAP;
- mask->refcnt++;
- } else {
- clipType = CT_NONE;
- }
- error = pixman_image_change_clip (image, clipType,
- (void *)mask, 0);
- break;
- }
- case CPGraphicsExposure:
- {
- unsigned int newe;
- newe = NEXT_VAL(unsigned int);
- if (newe <= xTrue)
- image->graphicsExposures = newe;
- else
- {
- *error_value = newe;
- error = BadValue;
- }
- }
- break;
- case CPSubwindowMode:
- {
- unsigned int news;
- news = NEXT_VAL(unsigned int);
- if (news == ClipByChildren || news == IncludeInferiors)
- image->subWindowMode = news;
- else
- {
- *error_value = news;
- error = BadValue;
- }
- }
- break;
- case CPPolyEdge:
- {
- unsigned int newe;
- newe = NEXT_VAL(unsigned int);
- if (newe == PolyEdgeSharp || newe == PolyEdgeSmooth)
- image->polyEdge = newe;
- else
- {
- *error_value = newe;
- error = BadValue;
- }
- }
- break;
- case CPPolyMode:
- {
- unsigned int newm;
- newm = NEXT_VAL(unsigned int);
- if (newm == PolyModePrecise || newm == PolyModeImprecise)
- image->polyMode = newm;
- else
- {
- *error_value = newm;
- error = BadValue;
- }
- }
- break;
- case CPDither:
- image->dither = NEXT_VAL(unsigned long);
- break;
- case CPComponentAlpha:
- {
- unsigned int newca;
-
- newca = NEXT_VAL (unsigned int);
- if (newca <= xTrue)
- image->componentAlpha = newca;
- else
- {
- *error_value = newca;
- error = BadValue;
- }
- }
- break;
- default:
- *error_value = maskQ;
- error = BadValue;
- break;
- }
- }
- return error;
-}
-*/
-
-/* XXX: Do we need this?
-int
-SetPictureClipRects (PicturePtr pPicture,
- int xOrigin,
- int yOrigin,
- int nRect,
- xRectangle *rects)
-{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- pixman_region16_t *clientClip;
- int result;
-
- clientClip = RECTS_TO_REGION(pScreen,
- nRect, rects, CT_UNSORTED);
- if (!clientClip)
- return 1;
- result =(*ps->ChangePictureClip) (pPicture, CT_REGION,
- (void *) clientClip, 0);
- if (result == 0)
- {
- pPicture->clipOrigin.x = xOrigin;
- pPicture->clipOrigin.y = yOrigin;
- pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask;
- pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
- }
- return result;
-}
-*/
-
-int
-IcComputeCompositeRegion (pixman_region16_t *region,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
-{
- int v;
- int x1, y1, x2, y2;
-
- /* XXX: This code previously directly set the extents of the
- region here. I need to decide whether removing that has broken
- this. Also, it might be necessary to just make the pixman_region16_t
- data structure transparent anyway in which case I can just put
- the code back. */
- x1 = xDst;
- v = xDst + width;
- x2 = BOUND(v);
- y1 = yDst;
- v = yDst + height;
- y2 = BOUND(v);
- /* Check for empty operation */
- if (x1 >= x2 ||
- y1 >= y2)
- {
- pixman_region_empty (region);
- return 1;
- }
- /* clip against src */
- if (!IcClipImageSrc (region, iSrc, xDst - xSrc, yDst - ySrc))
- {
- pixman_region_destroy (region);
- return 0;
- }
- if (iSrc->alphaMap)
- {
- if (!IcClipImageSrc (region, iSrc->alphaMap,
- xDst - (xSrc + iSrc->alphaOrigin.x),
- yDst - (ySrc + iSrc->alphaOrigin.y)))
- {
- pixman_region_destroy (region);
- return 0;
- }
- }
- /* clip against mask */
- if (iMask)
- {
- if (!IcClipImageSrc (region, iMask, xDst - xMask, yDst - yMask))
- {
- pixman_region_destroy (region);
- return 0;
- }
- if (iMask->alphaMap)
- {
- if (!IcClipImageSrc (region, iMask->alphaMap,
- xDst - (xMask + iMask->alphaOrigin.x),
- yDst - (yMask + iMask->alphaOrigin.y)))
- {
- pixman_region_destroy (region);
- return 0;
- }
- }
- }
- if (!IcClipImageReg (region, iDst->pCompositeClip, 0, 0))
- {
- pixman_region_destroy (region);
- return 0;
- }
- if (iDst->alphaMap)
- {
- if (!IcClipImageReg (region, iDst->alphaMap->pCompositeClip,
- -iDst->alphaOrigin.x,
- -iDst->alphaOrigin.y))
- {
- pixman_region_destroy (region);
- return 0;
- }
- }
- return 1;
-}
-
-int
-miIsSolidAlpha (pixman_image_t *src)
-{
- char line[1];
-
- /* Alpha-only */
- if (PICT_FORMAT_TYPE (src->format_code) != PICT_TYPE_A)
- return 0;
- /* repeat */
- if (!src->repeat)
- return 0;
- /* 1x1 */
- if (src->pixels->width != 1 || src->pixels->height != 1)
- return 0;
- line[0] = 1;
- /* XXX: For the next line, fb has:
- (*pScreen->GetImage) (src->pixels, 0, 0, 1, 1, ZPixmap, ~0L, line);
- Is the following simple assignment sufficient?
- */
- line[0] = src->pixels->data[0];
- switch (src->pixels->bpp) {
- case 1:
- return (uint8_t) line[0] == 1 || (uint8_t) line[0] == 0x80;
- case 4:
- return (uint8_t) line[0] == 0xf || (uint8_t) line[0] == 0xf0;
- case 8:
- return (uint8_t) line[0] == 0xff;
- default:
- return 0;
- }
-}
diff --git a/pixman/src/icimage.h b/pixman/src/icimage.h
deleted file mode 100644
index becc7b09a..000000000
--- a/pixman/src/icimage.h
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright Β© 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* XXX: This whole file should be moved up into incint.h (and cleaned
- up considerably as well) */
-
-#ifndef _ICIMAGE_H_
-#define _ICIMAGE_H_
-
-/* #include "glyphstr.h" */
-/* #include "scrnintstr.h" */
-
-/* XXX: Hmmm... what's needed from here?
-#include "resource.h"
-*/
-
-
-#define IcIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
-#define IcIntDiv(a,b) (((uint16_t) (a) * 255) / (b))
-
-#define IcGet8(v,i) ((uint16_t) (uint8_t) ((v) >> i))
-
-/*
- * There are two ways of handling alpha -- either as a single unified value or
- * a separate value for each component, hence each macro must have two
- * versions. The unified alpha version has a 'U' at the end of the name,
- * the component version has a 'C'. Similarly, functions which deal with
- * this difference will have two versions using the same convention.
- */
-
-#define IcOverU(x,y,i,a,t) ((t) = IcIntMult(IcGet8(y,i),(a),(t)) + IcGet8(x,i),\
- (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
-
-#define IcOverC(x,y,i,a,t) ((t) = IcIntMult(IcGet8(y,i),IcGet8(a,i),(t)) + IcGet8(x,i),\
- (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
-
-#define IcInU(x,i,a,t) ((uint32_t) IcIntMult(IcGet8(x,i),(a),(t)) << (i))
-
-#define IcInC(x,i,a,t) ((uint32_t) IcIntMult(IcGet8(x,i),IcGet8(a,i),(t)) << (i))
-
-#define IcGen(x,y,i,ax,ay,t,u,v) ((t) = (IcIntMult(IcGet8(y,i),ay,(u)) + \
- IcIntMult(IcGet8(x,i),ax,(v))),\
- (uint32_t) ((uint8_t) ((t) | \
- (0 - ((t) >> 8)))) << (i))
-
-#define IcAdd(x,y,i,t) ((t) = IcGet8(x,i) + IcGet8(y,i), \
- (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
-
-/*
-typedef struct _IndexFormat {
- VisualPtr pVisual;
- ColormapPtr pColormap;
- int nvalues;
- xIndexValue *pValues;
- void *devPrivate;
-} IndexFormatRec;
-*/
-
-/*
-typedef struct pixman_format {
- uint32_t id;
- uint32_t format;
- unsigned char type;
- unsigned char depth;
- DirectFormatRec direct;
- IndexFormatRec index;
-} pixman_format_t;
-*/
-
-struct pixman_image {
- IcPixels *pixels;
- pixman_format_t image_format;
- int format_code;
- int refcnt;
-
- unsigned int repeat : 1;
- unsigned int graphicsExposures : 1;
- unsigned int subWindowMode : 1;
- unsigned int polyEdge : 1;
- unsigned int polyMode : 1;
- /* XXX: Do we need this field */
- unsigned int freeCompClip : 1;
- unsigned int clientClipType : 2;
- unsigned int componentAlpha : 1;
- unsigned int unused : 23;
-
- struct pixman_image *alphaMap;
- IcPoint alphaOrigin;
-
- IcPoint clipOrigin;
- void *clientClip;
-
- unsigned long dither;
-
- unsigned long stateChanges;
- unsigned long serialNumber;
-
- pixman_region16_t *pCompositeClip;
-
- pixman_transform_t *transform;
-
- pixman_filter_t filter;
- pixman_fixed16_16_t *filter_params;
- int filter_nparams;
-
- int owns_pixels;
-};
-
-#endif /* _ICIMAGE_H_ */
-
-#ifndef _IC_MIPICT_H_
-#define _IC_MIPICT_H_
-
-#define IC_MAX_INDEXED 256 /* XXX depth must be <= 8 */
-
-#if IC_MAX_INDEXED <= 256
-typedef uint8_t IcIndexType;
-#endif
-
-/* XXX: We're not supporting indexed operations, right?
-typedef struct _IcIndexed {
- int color;
- uint32_t rgba[IC_MAX_INDEXED];
- IcIndexType ent[32768];
-} IcIndexedRec, *IcIndexedPtr;
-*/
-
-#define IcCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
- (((s) >> 6) & 0x03e0) | \
- (((s) >> 9) & 0x7c00))
-#define IcIndexToEnt15(icf,rgb15) ((icf)->ent[rgb15])
-#define IcIndexToEnt24(icf,rgb24) IcIndexToEnt15(icf,IcCvtR8G8B8to15(rgb24))
-
-#define IcIndexToEntY24(icf,rgb24) ((icf)->ent[CvtR8G8B8toY15(rgb24)])
-
-/*
-pixman_private int
-IcCreatePicture (PicturePtr pPicture);
-*/
-
-pixman_private void
-pixman_image_init (pixman_image_t *image);
-
-pixman_private void
-pixman_image_destroyClip (pixman_image_t *image);
-
-/*
-pixman_private void
-IcValidatePicture (PicturePtr pPicture,
- Mask mask);
-*/
-
-
-/* XXX: What should this be?
-pixman_private int
-IcClipPicture (pixman_region16_t *region,
- pixman_image_t *image,
- int16_t xReg,
- int16_t yReg,
- int16_t xPict,
- int16_t yPict);
-*/
-
-pixman_private int
-IcComputeCompositeRegion (pixman_region16_t *region,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height);
-
-int
-miIsSolidAlpha (pixman_image_t *src);
-
-/*
-pixman_private int
-IcPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
-*/
-
-/*
-pixman_private void
-IcGlyphs (pixman_operator_t op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- int16_t xSrc,
- int16_t ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs);
-*/
-
-/*
-pixman_private void
-pixman_compositeRects (pixman_operator_t op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect,
- xRectangle *rects);
-*/
-
-pixman_private pixman_image_t *
-IcCreateAlphaPicture (pixman_image_t *dst,
- pixman_format_t *format,
- uint16_t width,
- uint16_t height);
-
-typedef void (*CompositeFunc) (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height);
-
-typedef struct _pixman_compositeOperand pixman_compositeOperand;
-
-typedef uint32_t (*pixman_compositeFetch)(pixman_compositeOperand *op);
-typedef void (*pixman_compositeStore) (pixman_compositeOperand *op, uint32_t value);
-
-typedef void (*pixman_compositeStep) (pixman_compositeOperand *op);
-typedef void (*pixman_compositeSet) (pixman_compositeOperand *op, int x, int y);
-
-struct _pixman_compositeOperand {
- union {
- struct {
- pixman_bits_t *top_line;
- int left_offset;
-
- int start_offset;
- pixman_bits_t *line;
- uint32_t offset;
- IcStride stride;
- int bpp;
- } drawable;
- struct {
- int alpha_dx;
- int alpha_dy;
- } external;
- struct {
- int top_y;
- int left_x;
- int start_x;
- int x;
- int y;
- pixman_transform_t *transform;
- pixman_filter_t filter;
- int repeat;
- int width;
- int height;
- } transform;
- } u;
- pixman_compositeFetch fetch;
- pixman_compositeFetch fetcha;
- pixman_compositeStore store;
- pixman_compositeStep over;
- pixman_compositeStep down;
- pixman_compositeSet set;
-/* XXX: We're not supporting indexed operations, right?
- IcIndexedPtr indexed;
-*/
- pixman_region16_t *clip;
-};
-
-typedef void (*IcCombineFunc) (pixman_compositeOperand *src,
- pixman_compositeOperand *msk,
- pixman_compositeOperand *dst);
-
-typedef struct _IcAccessMap {
- uint32_t format_code;
- pixman_compositeFetch fetch;
- pixman_compositeFetch fetcha;
- pixman_compositeStore store;
-} IcAccessMap;
-
-/* iccompose.c */
-
-typedef struct _IcCompSrc {
- uint32_t value;
- uint32_t alpha;
-} IcCompSrc;
-
-pixman_private int
-IcBuildCompositeOperand (pixman_image_t *image,
- pixman_compositeOperand op[4],
- int16_t x,
- int16_t y,
- int transform,
- int alpha);
-
-pixman_private void
-pixman_compositeGeneral (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height);
-
-#endif /* _IC_MIPICT_H_ */
diff --git a/pixman/src/icint.h b/pixman/src/icint.h
deleted file mode 100644
index a31ddf444..000000000
--- a/pixman/src/icint.h
+++ /dev/null
@@ -1,1047 +0,0 @@
-/*
- * Copyright Β© 2003 Carl Worth
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Carl Worth not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Carl Worth makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * CARL WORTH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL CARL WORTH BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _ICINT_H_
-#define _ICINT_H_
-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
-
-#include "pixman.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-
-#include "slim_internal.h"
-
-#ifndef __GNUC__
-#define __inline
-#endif
-
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
-/* C89 has implementation-defined behavior for % with negative operands.
- C99 has well-defined behavior which is that / with integers rounds toward zero
- and a%b is defined so that (a/b)*b + a%b == a.
-
- The C99 version gives negative remainders rather than the modulus
- in [0 .. b-1] that we want. This macro avoids using % with negative
- operands to avoid both problems.
-
- a and b are integers. b > 0.
-*/
-#define MOD(a, b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-(a) - 1) % (b) - 1)
-
-typedef struct _IcPoint {
- int16_t x,y ;
-} IcPoint;
-
-typedef unsigned int Mask;
-
-
-#define GXor 0x7
-#define ClipByChildren 0
-#define PolyEdgeSharp 0
-#define PolyModePrecise 0
-#define CPClipMask (1 << 6)
-#define CPLastBit 11
-
-
-
-
-/* These few definitions avoid me needing to include servermd.h and misc.h from Xserver/include */
-#ifndef BITMAP_SCANLINE_PAD
-#define BITMAP_SCANLINE_PAD 32
-#define LOG2_BITMAP_PAD 5
-#define LOG2_BYTES_PER_SCANLINE_PAD 2
-#endif
-
-#define LSBFirst 0
-#define MSBFirst 1
-
-#ifdef WORDS_BIGENDIAN
-# define IMAGE_BYTE_ORDER MSBFirst
-# define BITMAP_BIT_ORDER MSBFirst
-#else
-# define IMAGE_BYTE_ORDER LSBFirst
-# define BITMAP_BIT_ORDER LSBFirst
-#endif
-
-
-#define MAXSHORT SHRT_MAX
-#define MINSHORT SHRT_MIN
-
-/* XXX: What do we need from here?
-#include "picture.h"
-*/
-
-
-
-#include "pixman.h"
-
-/* XXX: Most of this file is straight from fb.h and I imagine we can
- drop quite a bit of it. Once the real ic code starts to come
- together I can probably figure out what is not needed here. */
-
-#define IC_UNIT (1 << IC_SHIFT)
-#define IC_HALFUNIT (1 << (IC_SHIFT-1))
-#define IC_MASK (IC_UNIT - 1)
-#define IC_ALLONES ((pixman_bits_t) -1)
-
-/* whether to bother to include 24bpp support */
-#ifndef ICNO24BIT
-#define IC_24BIT
-#endif
-
-/*
- * Unless otherwise instructed, ic includes code to advertise 24bpp
- * windows with 32bpp image format for application compatibility
- */
-
-#ifdef IC_24BIT
-#ifndef ICNO24_32
-#define IC_24_32BIT
-#endif
-#endif
-
-#define IC_STIP_SHIFT LOG2_BITMAP_PAD
-#define IC_STIP_UNIT (1 << IC_STIP_SHIFT)
-#define IC_STIP_MASK (IC_STIP_UNIT - 1)
-#define IC_STIP_ALLONES ((IcStip) -1)
-
-#define IC_STIP_ODDSTRIDE(s) (((s) & (IC_MASK >> IC_STIP_SHIFT)) != 0)
-#define IC_STIP_ODDPTR(p) ((((long) (p)) & (IC_MASK >> 3)) != 0)
-
-#define IcStipStrideToBitsStride(s) (((s) >> (IC_SHIFT - IC_STIP_SHIFT)))
-#define IcBitsStrideToStipStride(s) (((s) << (IC_SHIFT - IC_STIP_SHIFT)))
-
-#define IcFullMask(n) ((n) == IC_UNIT ? IC_ALLONES : ((((pixman_bits_t) 1) << n) - 1))
-
-
-typedef uint32_t IcStip;
-typedef int IcStride;
-
-
-#ifdef IC_DEBUG
-extern void IcValidateDrawable(DrawablePtr d);
-extern void IcInitializeDrawable(DrawablePtr d);
-extern void IcSetBits (IcStip *bits, int stride, IcStip data);
-#define IC_HEAD_BITS (IcStip) (0xbaadf00d)
-#define IC_TAIL_BITS (IcStip) (0xbaddf0ad)
-#else
-#define IcValidateDrawable(d)
-#define fdInitializeDrawable(d)
-#endif
-
-#if BITMAP_BIT_ORDER == LSBFirst
-#define IcScrLeft(x,n) ((x) >> (n))
-#define IcScrRight(x,n) ((x) << (n))
-/* #define IcLeftBits(x,n) ((x) & ((((pixman_bits_t) 1) << (n)) - 1)) */
-#define IcLeftStipBits(x,n) ((x) & ((((IcStip) 1) << (n)) - 1))
-#define IcStipMoveLsb(x,s,n) (IcStipRight (x,(s)-(n)))
-#define IcPatternOffsetBits 0
-#else
-#define IcScrLeft(x,n) ((x) << (n))
-#define IcScrRight(x,n) ((x) >> (n))
-/* #define IcLeftBits(x,n) ((x) >> (IC_UNIT - (n))) */
-#define IcLeftStipBits(x,n) ((x) >> (IC_STIP_UNIT - (n)))
-#define IcStipMoveLsb(x,s,n) (x)
-#define IcPatternOffsetBits (sizeof (pixman_bits_t) - 1)
-#endif
-
-#define IcStipLeft(x,n) IcScrLeft(x,n)
-#define IcStipRight(x,n) IcScrRight(x,n)
-
-#define IcRotLeft(x,n) IcScrLeft(x,n) | (n ? IcScrRight(x,IC_UNIT-n) : 0)
-#define IcRotRight(x,n) IcScrRight(x,n) | (n ? IcScrLeft(x,IC_UNIT-n) : 0)
-
-#define IcRotStipLeft(x,n) IcStipLeft(x,n) | (n ? IcStipRight(x,IC_STIP_UNIT-n) : 0)
-#define IcRotStipRight(x,n) IcStipRight(x,n) | (n ? IcStipLeft(x,IC_STIP_UNIT-n) : 0)
-
-#define IcLeftMask(x) ( ((x) & IC_MASK) ? \
- IcScrRight(IC_ALLONES,(x) & IC_MASK) : 0)
-#define IcRightMask(x) ( ((IC_UNIT - (x)) & IC_MASK) ? \
- IcScrLeft(IC_ALLONES,(IC_UNIT - (x)) & IC_MASK) : 0)
-
-#define IcLeftStipMask(x) ( ((x) & IC_STIP_MASK) ? \
- IcStipRight(IC_STIP_ALLONES,(x) & IC_STIP_MASK) : 0)
-#define IcRightStipMask(x) ( ((IC_STIP_UNIT - (x)) & IC_STIP_MASK) ? \
- IcScrLeft(IC_STIP_ALLONES,(IC_STIP_UNIT - (x)) & IC_STIP_MASK) : 0)
-
-#define IcBitsMask(x,w) (IcScrRight(IC_ALLONES,(x) & IC_MASK) & \
- IcScrLeft(IC_ALLONES,(IC_UNIT - ((x) + (w))) & IC_MASK))
-
-#define IcStipMask(x,w) (IcStipRight(IC_STIP_ALLONES,(x) & IC_STIP_MASK) & \
- IcStipLeft(IC_STIP_ALLONES,(IC_STIP_UNIT - ((x)+(w))) & IC_STIP_MASK))
-
-
-#define IcMaskBits(x,w,l,n,r) { \
- n = (w); \
- r = IcRightMask((x)+n); \
- l = IcLeftMask(x); \
- if (l) { \
- n -= IC_UNIT - ((x) & IC_MASK); \
- if (n < 0) { \
- n = 0; \
- l &= r; \
- r = 0; \
- } \
- } \
- n >>= IC_SHIFT; \
-}
-
-#ifdef ICNOPIXADDR
-#define IcMaskBitsBytes(x,w,copy,l,lb,n,r,rb) IcMaskBits(x,w,l,n,r)
-#define IcDoLeftMaskByteRRop(dst,lb,l,and,xor) { \
- *dst = IcDoMaskRRop(*dst,and,xor,l); \
-}
-#define IcDoRightMaskByteRRop(dst,rb,r,and,xor) { \
- *dst = IcDoMaskRRop(*dst,and,xor,r); \
-}
-#else
-
-#define IcByteMaskInvalid 0x10
-
-#define IcPatternOffset(o,t) ((o) ^ (IcPatternOffsetBits & ~(sizeof (t) - 1)))
-
-#define IcPtrOffset(p,o,t) ((t *) ((uint8_t *) (p) + (o)))
-#define IcSelectPatternPart(xor,o,t) ((xor) >> (IcPatternOffset (o,t) << 3))
-#define IcStorePart(dst,off,t,xor) (*IcPtrOffset(dst,off,t) = \
- IcSelectPart(xor,off,t))
-#ifndef IcSelectPart
-#define IcSelectPart(x,o,t) IcSelectPatternPart(x,o,t)
-#endif
-
-#define IcMaskBitsBytes(x,w,copy,l,lb,n,r,rb) { \
- n = (w); \
- lb = 0; \
- rb = 0; \
- r = IcRightMask((x)+n); \
- if (r) { \
- /* compute right byte length */ \
- if ((copy) && (((x) + n) & 7) == 0) { \
- rb = (((x) + n) & IC_MASK) >> 3; \
- } else { \
- rb = IcByteMaskInvalid; \
- } \
- } \
- l = IcLeftMask(x); \
- if (l) { \
- /* compute left byte length */ \
- if ((copy) && ((x) & 7) == 0) { \
- lb = ((x) & IC_MASK) >> 3; \
- } else { \
- lb = IcByteMaskInvalid; \
- } \
- /* subtract out the portion painted by leftMask */ \
- n -= IC_UNIT - ((x) & IC_MASK); \
- if (n < 0) { \
- if (lb != IcByteMaskInvalid) { \
- if (rb == IcByteMaskInvalid) { \
- lb = IcByteMaskInvalid; \
- } else if (rb) { \
- lb |= (rb - lb) << (IC_SHIFT - 3); \
- rb = 0; \
- } \
- } \
- n = 0; \
- l &= r; \
- r = 0; \
- }\
- } \
- n >>= IC_SHIFT; \
-}
-
-#if IC_SHIFT == 6
-#define IcDoLeftMaskByteRRop6Cases(dst,xor) \
- case (sizeof (pixman_bits_t) - 7) | (1 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 7,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 7) | (2 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 7,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 7) | (3 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 7,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 7) | (4 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 7,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 7) | (5 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 7,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint16_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 7) | (6 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 7,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 2,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 7): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 7,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint32_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 6) | (1 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 6) | (2 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 6) | (3 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 6) | (4 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint16_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 6) | (5 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 2,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 6): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 6,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint32_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 5) | (1 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 5,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 5) | (2 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 5,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 5) | (3 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 5,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint16_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 5) | (4 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 5,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 2,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 5): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 5,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint32_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 4) | (1 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 4) | (2 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint16_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 4) | (3 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint16_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 2,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 4): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 4,uint32_t,xor); \
- break;
-
-#define IcDoRightMaskByteRRop6Cases(dst,xor) \
- case 4: \
- IcStorePart(dst,0,uint32_t,xor); \
- break; \
- case 5: \
- IcStorePart(dst,0,uint32_t,xor); \
- IcStorePart(dst,4,uint8_t,xor); \
- break; \
- case 6: \
- IcStorePart(dst,0,uint32_t,xor); \
- IcStorePart(dst,4,uint16_t,xor); \
- break; \
- case 7: \
- IcStorePart(dst,0,uint32_t,xor); \
- IcStorePart(dst,4,uint16_t,xor); \
- IcStorePart(dst,6,uint8_t,xor); \
- break;
-#else
-#define IcDoLeftMaskByteRRop6Cases(dst,xor)
-#define IcDoRightMaskByteRRop6Cases(dst,xor)
-#endif
-
-#define IcDoLeftMaskByteRRop(dst,lb,l,and,xor) { \
- switch (lb) { \
- IcDoLeftMaskByteRRop6Cases(dst,xor) \
- case (sizeof (pixman_bits_t) - 3) | (1 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 3,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 3) | (2 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 3,uint8_t,xor); \
- IcStorePart(dst,sizeof (pixman_bits_t) - 2,uint8_t,xor); \
- break; \
- case (sizeof (pixman_bits_t) - 2) | (1 << (IC_SHIFT - 3)): \
- IcStorePart(dst,sizeof (pixman_bits_t) - 2,uint8_t,xor); \
- break; \
- case sizeof (pixman_bits_t) - 3: \
- IcStorePart(dst,sizeof (pixman_bits_t) - 3,uint8_t,xor); \
- case sizeof (pixman_bits_t) - 2: \
- IcStorePart(dst,sizeof (pixman_bits_t) - 2,uint16_t,xor); \
- break; \
- case sizeof (pixman_bits_t) - 1: \
- IcStorePart(dst,sizeof (pixman_bits_t) - 1,uint8_t,xor); \
- break; \
- default: \
- *dst = IcDoMaskRRop(*dst, and, xor, l); \
- break; \
- } \
-}
-
-
-#define IcDoRightMaskByteRRop(dst,rb,r,and,xor) { \
- switch (rb) { \
- case 1: \
- IcStorePart(dst,0,uint8_t,xor); \
- break; \
- case 2: \
- IcStorePart(dst,0,uint16_t,xor); \
- break; \
- case 3: \
- IcStorePart(dst,0,uint16_t,xor); \
- IcStorePart(dst,2,uint8_t,xor); \
- break; \
- IcDoRightMaskByteRRop6Cases(dst,xor) \
- default: \
- *dst = IcDoMaskRRop (*dst, and, xor, r); \
- } \
-}
-#endif
-
-#define IcMaskStip(x,w,l,n,r) { \
- n = (w); \
- r = IcRightStipMask((x)+n); \
- l = IcLeftStipMask(x); \
- if (l) { \
- n -= IC_STIP_UNIT - ((x) & IC_STIP_MASK); \
- if (n < 0) { \
- n = 0; \
- l &= r; \
- r = 0; \
- } \
- } \
- n >>= IC_STIP_SHIFT; \
-}
-
-/*
- * These macros are used to transparently stipple
- * in copy mode; the expected usage is with 'n' constant
- * so all of the conditional parts collapse into a minimal
- * sequence of partial word writes
- *
- * 'n' is the bytemask of which bytes to store, 'a' is the address
- * of the pixman_bits_t base unit, 'o' is the offset within that unit
- *
- * The term "lane" comes from the hardware term "byte-lane" which
- */
-
-#define IcLaneCase1(n,a,o) ((n) == 0x01 ? \
- (*(uint8_t *) ((a)+IcPatternOffset(o,uint8_t)) = \
- fgxor) : 0)
-#define IcLaneCase2(n,a,o) ((n) == 0x03 ? \
- (*(uint16_t *) ((a)+IcPatternOffset(o,uint16_t)) = \
- fgxor) : \
- ((void)IcLaneCase1((n)&1,a,o), \
- IcLaneCase1((n)>>1,a,(o)+1)))
-#define IcLaneCase4(n,a,o) ((n) == 0x0f ? \
- (*(uint32_t *) ((a)+IcPatternOffset(o,uint32_t)) = \
- fgxor) : \
- ((void)IcLaneCase2((n)&3,a,o), \
- IcLaneCase2((n)>>2,a,(o)+2)))
-#define IcLaneCase8(n,a,o) ((n) == 0x0ff ? (*(pixman_bits_t *) ((a)+(o)) = fgxor) : \
- ((void)IcLaneCase4((n)&15,a,o), \
- IcLaneCase4((n)>>4,a,(o)+4)))
-
-#if IC_SHIFT == 6
-#define IcLaneCase(n,a) IcLaneCase8(n,(uint8_t *) (a),0)
-#endif
-
-#if IC_SHIFT == 5
-#define IcLaneCase(n,a) IcLaneCase4(n,(uint8_t *) (a),0)
-#endif
-
-/* Rotate a filled pixel value to the specified alignement */
-#define IcRot24(p,b) (IcScrRight(p,b) | IcScrLeft(p,24-(b)))
-#define IcRot24Stip(p,b) (IcStipRight(p,b) | IcStipLeft(p,24-(b)))
-
-/* step a filled pixel value to the next/previous IC_UNIT alignment */
-#define IcNext24Pix(p) (IcRot24(p,(24-IC_UNIT%24)))
-#define IcPrev24Pix(p) (IcRot24(p,IC_UNIT%24))
-#define IcNext24Stip(p) (IcRot24(p,(24-IC_STIP_UNIT%24)))
-#define IcPrev24Stip(p) (IcRot24(p,IC_STIP_UNIT%24))
-
-/* step a rotation value to the next/previous rotation value */
-#if IC_UNIT == 64
-#define IcNext24Rot(r) ((r) == 16 ? 0 : (r) + 8)
-#define IcPrev24Rot(r) ((r) == 0 ? 16 : (r) - 8)
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define IcFirst24Rot(x) (((x) + 8) % 24)
-#else
-#define IcFirst24Rot(x) ((x) % 24)
-#endif
-
-#endif
-
-#if IC_UNIT == 32
-#define IcNext24Rot(r) ((r) == 0 ? 16 : (r) - 8)
-#define IcPrev24Rot(r) ((r) == 16 ? 0 : (r) + 8)
-
-#if IMAGE_BYTE_ORDER == MSBFirst
-#define IcFirst24Rot(x) (((x) + 16) % 24)
-#else
-#define IcFirst24Rot(x) ((x) % 24)
-#endif
-#endif
-
-#define IcNext24RotStip(r) ((r) == 0 ? 16 : (r) - 8)
-#define IcPrev24RotStip(r) ((r) == 16 ? 0 : (r) + 8)
-
-/* Whether 24-bit specific code is needed for this filled pixel value */
-#define IcCheck24Pix(p) ((p) == IcNext24Pix(p))
-
-#define IcGetPixels(icpixels, pointer, _stride_, _bpp_, xoff, yoff) { \
- (pointer) = icpixels->data; \
- (_stride_) = icpixels->stride / sizeof(pixman_bits_t); \
- (_bpp_) = icpixels->bpp; \
- (xoff) = icpixels->x; /* XXX: fb.h had this ifdef'd to constant 0. Why? */ \
- (yoff) = icpixels->y; /* XXX: fb.h had this ifdef'd to constant 0. Why? */ \
-}
-
-#define IcGetStipPixels(icpixels, pointer, _stride_, _bpp_, xoff, yoff) { \
- (pointer) = (IcStip *) icpixels->data; \
- (_stride_) = icpixels->stride; \
- (_bpp_) = icpixels->bpp; \
- (xoff) = icpixels->x; \
- (yoff) = icpixels->y; \
-}
-
-#ifdef IC_OLD_SCREEN
-#define BitsPerPixel(d) (\
- ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
- (PixmapWidthPaddingInfo[d].padRoundUp+1)))
-#endif
-
-#define IcPowerOfTwo(w) (((w) & ((w) - 1)) == 0)
-/*
- * Accelerated tiles are power of 2 width <= IC_UNIT
- */
-#define IcEvenTile(w) ((w) <= IC_UNIT && IcPowerOfTwo(w))
-/*
- * Accelerated stipples are power of 2 width and <= IC_UNIT/dstBpp
- * with dstBpp a power of 2 as well
- */
-#define IcEvenStip(w,bpp) ((w) * (bpp) <= IC_UNIT && IcPowerOfTwo(w) && IcPowerOfTwo(bpp))
-
-/*
- * icblt.c
- */
-pixman_private void
-IcBlt (pixman_bits_t *src,
- IcStride srcStride,
- int srcX,
-
- pixman_bits_t *dst,
- IcStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- pixman_bits_t pm,
- int bpp,
-
- int reverse,
- int upsidedown);
-
-pixman_private void
-IcBlt24 (pixman_bits_t *srcLine,
- IcStride srcStride,
- int srcX,
-
- pixman_bits_t *dstLine,
- IcStride dstStride,
- int dstX,
-
- int width,
- int height,
-
- int alu,
- pixman_bits_t pm,
-
- int reverse,
- int upsidedown);
-
-pixman_private void
-IcBltStip (IcStip *src,
- IcStride srcStride, /* in IcStip units, not pixman_bits_t units */
- int srcX,
-
- IcStip *dst,
- IcStride dstStride, /* in IcStip units, not pixman_bits_t units */
- int dstX,
-
- int width,
- int height,
-
- int alu,
- pixman_bits_t pm,
- int bpp);
-
-/*
- * icbltone.c
- */
-pixman_private void
-IcBltOne (IcStip *src,
- IcStride srcStride,
- int srcX,
- pixman_bits_t *dst,
- IcStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- pixman_bits_t fgand,
- pixman_bits_t icxor,
- pixman_bits_t bgand,
- pixman_bits_t bgxor);
-
-#ifdef IC_24BIT
-pixman_private void
-IcBltOne24 (IcStip *src,
- IcStride srcStride, /* IcStip units per scanline */
- int srcX, /* bit position of source */
- pixman_bits_t *dst,
- IcStride dstStride, /* pixman_bits_t units per scanline */
- int dstX, /* bit position of dest */
- int dstBpp, /* bits per destination unit */
-
- int width, /* width in bits of destination */
- int height, /* height in scanlines */
-
- pixman_bits_t fgand, /* rrop values */
- pixman_bits_t fgxor,
- pixman_bits_t bgand,
- pixman_bits_t bgxor);
-#endif
-
-/*
- * icstipple.c
- */
-
-pixman_private void
-IcTransparentSpan (pixman_bits_t *dst,
- pixman_bits_t stip,
- pixman_bits_t fgxor,
- int n);
-
-pixman_private void
-IcEvenStipple (pixman_bits_t *dst,
- IcStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- IcStip *stip,
- IcStride stipStride,
- int stipHeight,
-
- pixman_bits_t fgand,
- pixman_bits_t fgxor,
- pixman_bits_t bgand,
- pixman_bits_t bgxor,
-
- int xRot,
- int yRot);
-
-pixman_private void
-IcOddStipple (pixman_bits_t *dst,
- IcStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- IcStip *stip,
- IcStride stipStride,
- int stipWidth,
- int stipHeight,
-
- pixman_bits_t fgand,
- pixman_bits_t fgxor,
- pixman_bits_t bgand,
- pixman_bits_t bgxor,
-
- int xRot,
- int yRot);
-
-pixman_private void
-IcStipple (pixman_bits_t *dst,
- IcStride dstStride,
- int dstX,
- int dstBpp,
-
- int width,
- int height,
-
- IcStip *stip,
- IcStride stipStride,
- int stipWidth,
- int stipHeight,
- int even,
-
- pixman_bits_t fgand,
- pixman_bits_t fgxor,
- pixman_bits_t bgand,
- pixman_bits_t bgxor,
-
- int xRot,
- int yRot);
-
-/* XXX: Is depth redundant here? */
-struct pixman_format {
- int format_code;
- int depth;
- int red, redMask;
- int green, greenMask;
- int blue, blueMask;
- int alpha, alphaMask;
-};
-
-typedef struct _IcPixels {
- pixman_bits_t *data;
- unsigned int width;
- unsigned int height;
- unsigned int depth;
- unsigned int bpp;
- unsigned int stride;
- int x;
- int y;
- unsigned int refcnt;
-} IcPixels;
-
-/* XXX: This is to avoid including colormap.h from the server includes */
-typedef uint32_t Pixel;
-
-/* icutil.c */
-pixman_private pixman_bits_t
-IcReplicatePixel (Pixel p, int bpp);
-
-/* fbtrap.c */
-
-pixman_private void
-fbRasterizeTrapezoid (pixman_image_t *pMask,
- const pixman_trapezoid_t *pTrap,
- int x_off,
- int y_off);
-
-/* XXX: This is to avoid including gc.h from the server includes */
-/* clientClipType field in GC */
-#define CT_NONE 0
-#define CT_PIXMAP 1
-#define CT_REGION 2
-#define CT_UNSORTED 6
-#define CT_YSORTED 10
-#define CT_YXSORTED 14
-#define CT_YXBANDED 18
-
-#include "icimage.h"
-
-/* iccolor.c */
-
-/* GCC 3.4 supports a "population count" builtin, which on many targets is
- implemented with a single instruction. There is a fallback definition
- in libgcc in case a target does not have one, which should be just as
- good as the static function below. */
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# if __INT_MIN__ == 0x7fffffff
-# define _IcOnes(mask) __builtin_popcount(mask)
-# else
-# define _IcOnes(mask) __builtin_popcountl((mask) & 0xffffffff)
-# endif
-#else
-# define ICINT_NEED_IC_ONES
-int
-_IcOnes(unsigned long mask);
-#endif
-
-/* icformat.c */
-
-pixman_private void
-pixman_format_init (pixman_format_t *format, int format_code);
-
-/* icimage.c */
-
-pixman_private pixman_image_t *
-pixman_image_createForPixels (IcPixels *pixels,
- pixman_format_t *format);
-
-/* icpixels.c */
-
-pixman_private IcPixels *
-IcPixelsCreate (int width, int height, int depth);
-
-pixman_private IcPixels *
-IcPixelsCreateForData (pixman_bits_t *data, int width, int height, int depth, int bpp, int stride);
-
-pixman_private void
-IcPixelsDestroy (IcPixels *pixels);
-
-/* ictransform.c */
-
-pixman_private int
-pixman_transform_point (pixman_transform_t *transform,
- pixman_vector_t *vector);
-
-/* Avoid unnessecary PLT entries. */
-
-slim_hidden_proto(pixman_image_create)
-slim_hidden_proto(pixman_color_to_pixel)
-slim_hidden_proto(pixman_format_init)
-slim_hidden_proto(pixman_image_destroy)
-slim_hidden_proto(pixman_fill_rectangles)
-slim_hidden_proto(pixman_image_set_component_alpha)
-slim_hidden_proto(pixman_image_set_repeat)
-slim_hidden_proto(pixman_composite)
-
-
-#include "icrop.h"
-
-/* XXX: For now, I'm just wholesale pasting Xserver/render/picture.h here: */
-#ifndef _PICTURE_H_
-#define _PICTURE_H_
-
-typedef struct _DirectFormat *DirectFormatPtr;
-typedef struct _PictFormat *PictFormatPtr;
-
-/*
- * While the protocol is generous in format support, the
- * sample implementation allows only packed RGB and GBR
- * representations for data to simplify software rendering,
- */
-#define PICT_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) | \
- ((type) << 16) | \
- ((a) << 12) | \
- ((r) << 8) | \
- ((g) << 4) | \
- ((b)))
-
-/*
- * gray/color formats use a visual index instead of argb
- */
-#define PICT_VISFORMAT(bpp,type,vi) (((bpp) << 24) | \
- ((type) << 16) | \
- ((vi)))
-
-#define PICT_FORMAT_BPP(f) (((f) >> 24) )
-#define PICT_FORMAT_TYPE(f) (((f) >> 16) & 0xff)
-#define PICT_FORMAT_A(f) (((f) >> 12) & 0x0f)
-#define PICT_FORMAT_R(f) (((f) >> 8) & 0x0f)
-#define PICT_FORMAT_G(f) (((f) >> 4) & 0x0f)
-#define PICT_FORMAT_B(f) (((f) ) & 0x0f)
-#define PICT_FORMAT_RGB(f) (((f) ) & 0xfff)
-#define PICT_FORMAT_VIS(f) (((f) ) & 0xffff)
-
-#define PICT_TYPE_OTHER 0
-#define PICT_TYPE_A 1
-#define PICT_TYPE_ARGB 2
-#define PICT_TYPE_ABGR 3
-#define PICT_TYPE_COLOR 4
-#define PICT_TYPE_GRAY 5
-
-#define PICT_FORMAT_COLOR(f) (PICT_FORMAT_TYPE(f) & 2)
-
-/* 32bpp formats */
-#define PICT_a8r8g8b8 PICT_FORMAT(32,PICT_TYPE_ARGB,8,8,8,8)
-#define PICT_x8r8g8b8 PICT_FORMAT(32,PICT_TYPE_ARGB,0,8,8,8)
-#define PICT_a8b8g8r8 PICT_FORMAT(32,PICT_TYPE_ABGR,8,8,8,8)
-#define PICT_x8b8g8r8 PICT_FORMAT(32,PICT_TYPE_ABGR,0,8,8,8)
-
-/* 24bpp formats */
-#define PICT_r8g8b8 PICT_FORMAT(24,PICT_TYPE_ARGB,0,8,8,8)
-#define PICT_b8g8r8 PICT_FORMAT(24,PICT_TYPE_ABGR,0,8,8,8)
-
-/* 16bpp formats */
-#define PICT_r5g6b5 PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,6,5)
-#define PICT_b5g6r5 PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,6,5)
-
-#define PICT_a1r5g5b5 PICT_FORMAT(16,PICT_TYPE_ARGB,1,5,5,5)
-#define PICT_x1r5g5b5 PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,5,5)
-#define PICT_a1b5g5r5 PICT_FORMAT(16,PICT_TYPE_ABGR,1,5,5,5)
-#define PICT_x1b5g5r5 PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,5,5)
-#define PICT_a4r4g4b4 PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4)
-#define PICT_x4r4g4b4 PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4)
-#define PICT_a4b4g4r4 PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4)
-#define PICT_x4b4g4r4 PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4)
-
-/* 8bpp formats */
-#define PICT_a8 PICT_FORMAT(8,PICT_TYPE_A,8,0,0,0)
-#define PICT_r3g3b2 PICT_FORMAT(8,PICT_TYPE_ARGB,0,3,3,2)
-#define PICT_b2g3r3 PICT_FORMAT(8,PICT_TYPE_ABGR,0,3,3,2)
-#define PICT_a2r2g2b2 PICT_FORMAT(8,PICT_TYPE_ARGB,2,2,2,2)
-#define PICT_a2b2g2r2 PICT_FORMAT(8,PICT_TYPE_ABGR,2,2,2,2)
-
-#define PICT_c8 PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
-#define PICT_g8 PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
-
-/* 4bpp formats */
-#define PICT_a4 PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0)
-#define PICT_r1g2b1 PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1)
-#define PICT_b1g2r1 PICT_FORMAT(4,PICT_TYPE_ABGR,0,1,2,1)
-#define PICT_a1r1g1b1 PICT_FORMAT(4,PICT_TYPE_ARGB,1,1,1,1)
-#define PICT_a1b1g1r1 PICT_FORMAT(4,PICT_TYPE_ABGR,1,1,1,1)
-
-#define PICT_c4 PICT_FORMAT(4,PICT_TYPE_COLOR,0,0,0,0)
-#define PICT_g4 PICT_FORMAT(4,PICT_TYPE_GRAY,0,0,0,0)
-
-/* 1bpp formats */
-#define PICT_a1 PICT_FORMAT(1,PICT_TYPE_A,1,0,0,0)
-
-#define PICT_g1 PICT_FORMAT(1,PICT_TYPE_GRAY,0,0,0,0)
-
-/*
- * For dynamic indexed visuals (GrayScale and PseudoColor), these control the
- * selection of colors allocated for drawing to Pictures. The default
- * policy depends on the size of the colormap:
- *
- * Size Default Policy
- * ----------------------------
- * < 64 PolicyMono
- * < 256 PolicyGray
- * 256 PolicyColor (only on PseudoColor)
- *
- * The actual allocation code lives in miindex.c, and so is
- * austensibly server dependent, but that code does:
- *
- * PolicyMono Allocate no additional colors, use black and white
- * PolicyGray Allocate 13 gray levels (11 cells used)
- * PolicyColor Allocate a 4x4x4 cube and 13 gray levels (71 cells used)
- * PolicyAll Allocate as big a cube as possible, fill with gray (all)
- *
- * Here's a picture to help understand how many colors are
- * actually allocated (this is just the gray ramp):
- *
- * gray level
- * all 0000 1555 2aaa 4000 5555 6aaa 8000 9555 aaaa bfff d555 eaaa ffff
- * b/w 0000 ffff
- * 4x4x4 5555 aaaa
- * extra 1555 2aaa 4000 6aaa 8000 9555 bfff d555 eaaa
- *
- * The default colormap supplies two gray levels (black/white), the
- * 4x4x4 cube allocates another two and nine more are allocated to fill
- * in the 13 levels. When the 4x4x4 cube is not allocated, a total of
- * 11 cells are allocated.
- */
-
-#define PictureCmapPolicyInvalid -1
-#define PictureCmapPolicyDefault 0
-#define PictureCmapPolicyMono 1
-#define PictureCmapPolicyGray 2
-#define PictureCmapPolicyColor 3
-#define PictureCmapPolicyAll 4
-
-extern int PictureCmapPolicy pixman_private;
-
-int PictureParseCmapPolicy (const char *name);
-
-/* Fixed point updates from Carl Worth, USC, Information Sciences Institute */
-
-#ifdef WIN32
-typedef __int64 xFixed_32_32;
-#else
-# if defined(__alpha__) || defined(__alpha) || \
- defined(ia64) || defined(__ia64__) || \
- defined(__sparc64__) || \
- defined(__s390x__) || \
- defined(x86_64) || defined (__x86_64__)
-typedef long xFixed_32_32;
-# else
-# if defined(__GNUC__) && \
- ((__GNUC__ > 2) || \
- ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 7)))
-__extension__
-# endif
-typedef long long int xFixed_32_32;
-# endif
-#endif
-
-typedef xFixed_32_32 xFixed_48_16;
-typedef uint32_t xFixed_1_31;
-typedef uint32_t xFixed_1_16;
-typedef int32_t xFixed_16_16;
-
-/*
- * An unadorned "xFixed" is the same as xFixed_16_16,
- * (since it's quite common in the code)
- */
-typedef xFixed_16_16 xFixed;
-#define XFIXED_BITS 16
-
-#define xFixedToInt(f) (int) ((f) >> XFIXED_BITS)
-#define IntToxFixed(i) ((xFixed) (i) << XFIXED_BITS)
-#define xFixedE ((xFixed) 1)
-#define xFixed1 (IntToxFixed(1))
-#define xFixed1MinusE (xFixed1 - xFixedE)
-#define xFixedFrac(f) ((f) & xFixed1MinusE)
-#define xFixedFloor(f) ((f) & ~xFixed1MinusE)
-#define xFixedCeil(f) xFixedFloor((f) + xFixed1MinusE)
-
-#define xFixedFraction(f) ((f) & xFixed1MinusE)
-#define xFixedMod2(f) ((f) & (xFixed1 | xFixed1MinusE))
-
-/* whether 't' is a well defined not obviously empty trapezoid */
-#define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \
- (t)->right.p1.y != (t)->right.p2.y && \
- (int) ((t)->bottom - (t)->top) > 0)
-
-/*
- * Standard NTSC luminance conversions:
- *
- * y = r * 0.299 + g * 0.587 + b * 0.114
- *
- * Approximate this for a bit more speed:
- *
- * y = (r * 153 + g * 301 + b * 58) / 512
- *
- * This gives 17 bits of luminance; to get 15 bits, lop the low two
- */
-
-#define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \
- (((s) >> 8) & 0xff) * 301 + \
- (((s) ) & 0xff) * 58) >> 2)
-
-#endif /* _PICTURE_H_ */
-
-#endif /* _ICINT_H_ */
diff --git a/pixman/src/icpixels.c b/pixman/src/icpixels.c
deleted file mode 100644
index 494dada30..000000000
--- a/pixman/src/icpixels.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * $Id: icpixels.c,v 1.7 2005-03-02 15:43:33 cworth Exp $
- *
- * Copyright Β© 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "icint.h"
-
-static void
-IcPixelsInit (IcPixels *pixels, pixman_bits_t *buf, int width, int height, int depth, int bpp, int stride);
-
-static unsigned int
-pixman_bits_per_pixel (unsigned int depth);
-
-static unsigned int
-pixman_bits_per_pixel (unsigned int depth)
-{
- if (depth > 8)
- if (depth > 16)
- return 32;
- else
- return 16;
- else
- if (depth > 4)
- return 8;
- else if (depth > 1)
- return 4;
- else
- return 1;
-}
-
-IcPixels *
-IcPixelsCreate (int width, int height, int depth)
-{
- IcPixels *pixels;
- pixman_bits_t *buf;
- unsigned int buf_size;
- unsigned int bpp;
- unsigned int stride;
- unsigned int adjust;
- unsigned int base;
-
- bpp = pixman_bits_per_pixel (depth);
- stride = ((width * bpp + IC_MASK) >> IC_SHIFT) * sizeof (pixman_bits_t);
- buf_size = height * stride;
- base = sizeof (IcPixels);
- adjust = 0;
- if (base & 7)
- adjust = 8 - (base & 7);
- buf_size += adjust;
-
- pixels = malloc(base + buf_size);
- if (!pixels)
- return NULL;
-
- buf = (pixman_bits_t *) ((char *)pixels + base + adjust);
-
- IcPixelsInit (pixels, buf, width, height, depth, bpp, stride);
-
- return pixels;
-}
-
-IcPixels *
-IcPixelsCreateForData (pixman_bits_t *data, int width, int height, int depth, int bpp, int stride)
-{
- IcPixels *pixels;
-
- pixels = malloc (sizeof (IcPixels));
- if (pixels == NULL)
- return NULL;
-
- IcPixelsInit (pixels, data, width, height, depth, bpp, stride);
-
- return pixels;
-}
-
-static void
-IcPixelsInit (IcPixels *pixels, pixman_bits_t *buf, int width, int height, int depth, int bpp, int stride)
-{
- pixels->data = buf;
- pixels->width = width;
- pixels->height = height;
- pixels->depth = depth;
- pixels->bpp = bpp;
- pixels->stride = stride;
- pixels->x = 0;
- pixels->y = 0;
- pixels->refcnt = 1;
-}
-
-void
-IcPixelsDestroy (IcPixels *pixels)
-{
- if(--pixels->refcnt)
- return;
-
- free(pixels);
-}
-
diff --git a/pixman/src/icrect.c b/pixman/src/icrect.c
deleted file mode 100644
index 996eb4f39..000000000
--- a/pixman/src/icrect.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright Β© 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "icint.h"
-
-typedef void (*FillFunc) (pixman_image_t *dst,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height,
- pixman_bits_t *pixel);
-
-
-static void
-pixman_fill_rect_8bpp (pixman_image_t *dst,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height,
- pixman_bits_t *pixel)
-{
- char *line;
-
- line = (char *)dst->pixels->data +
- xDst + yDst * dst->pixels->stride;
- while (height-- > 0) {
- memset (line, *(char *)pixel, width);
- line += dst->pixels->stride;
- }
-}
-
-static void
-pixman_fill_rect_32bpp (pixman_image_t *dst,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height,
- pixman_bits_t *pixel)
-{
- uint32_t int_pixel;
- char *line;
- char *data;
- int w;
-
- line = (char *)dst->pixels->data +
- xDst * 4 + yDst * dst->pixels->stride;
-
- int_pixel = *(uint32_t *)pixel;
- while (height-- > 0) {
- data = line;
- w = width;
- while (w-- > 0) {
- *(uint32_t *)data = int_pixel;
- data += 4;
- }
- line += dst->pixels->stride;
- }
-}
-
-static void
-pixman_fill_rect_general (pixman_image_t *dst,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height,
- pixman_bits_t *pixel)
-{
- int pixel_size;
- char *line;
- char *data;
- int w;
-
- pixel_size = dst->pixels->bpp >> 3;
-
- line = (char *)dst->pixels->data +
- xDst * pixel_size + yDst * dst->pixels->stride;
-
- while (height-- > 0) {
- data = line;
- w = width;
- while (w-- > 0) {
- memcpy (data, pixel, pixel_size);
- data += pixel_size;
- }
- line += dst->pixels->stride;
- }
-}
-
-
-static void
-pixman_color_rects (pixman_image_t *dst,
- pixman_image_t *clipPict,
- pixman_color_t *color,
- int nRect,
- pixman_rectangle_t *rects,
- int xoff,
- int yoff)
-{
- pixman_bits_t pixel;
- pixman_region16_t *clip;
- pixman_region16_t *rects_as_region;
- pixman_box16_t *clipped_rects;
- int i, n_clipped_rects;
- FillFunc func;
-
- pixman_color_to_pixel (&dst->image_format,
- color,
- &pixel);
-
- /* offset to the right place on the destination image */
- xoff -= dst->pixels->x;
- yoff -= dst->pixels->y;
-
- clip = pixman_region_create();
- pixman_region_union_rect (clip, clip,
- dst->pixels->x, dst->pixels->y,
- dst->pixels->width, dst->pixels->height);
-
- pixman_region_intersect (clip, clip, clipPict->pCompositeClip);
- if (clipPict->alphaMap)
- {
- pixman_region_translate (clip,
- -clipPict->alphaOrigin.x,
- -clipPict->alphaOrigin.y);
- pixman_region_intersect (clip, clip, clipPict->alphaMap->pCompositeClip);
- pixman_region_translate (clip,
- clipPict->alphaOrigin.x,
- clipPict->alphaOrigin.y);
- }
-
- if (xoff || yoff)
- {
- for (i = 0; i < nRect; i++)
- {
- rects[i].x -= xoff;
- rects[i].y -= yoff;
- }
- }
-
- rects_as_region = pixman_region_create ();
- for (i = 0; i < nRect; i++)
- {
- pixman_region_union_rect (rects_as_region, rects_as_region,
- rects[i].x, rects[i].y,
- rects[i].width, rects[i].height);
- }
-
- pixman_region_intersect (rects_as_region, rects_as_region, clip);
- pixman_region_destroy (clip);
-
- n_clipped_rects = pixman_region_num_rects (rects_as_region);
- clipped_rects = pixman_region_rects (rects_as_region);
-
- if (dst->pixels->bpp == 8)
- func = pixman_fill_rect_8bpp;
- else if (dst->pixels->bpp == 32)
- func = pixman_fill_rect_32bpp;
- else
- func = pixman_fill_rect_general;
-
- for (i = 0; i < n_clipped_rects; i++) {
- (*func) (dst,
- clipped_rects[i].x1,
- clipped_rects[i].y1,
- clipped_rects[i].x2 - clipped_rects[i].x1,
- clipped_rects[i].y2 - clipped_rects[i].y1,
- &pixel);
- }
-
- pixman_region_destroy (rects_as_region);
-
- if (xoff || yoff)
- {
- for (i = 0; i < nRect; i++)
- {
- rects[i].x += xoff;
- rects[i].y += yoff;
- }
- }
-}
-
-void pixman_fill_rectangle (pixman_operator_t op,
- pixman_image_t *dst,
- const pixman_color_t *color,
- int x,
- int y,
- unsigned int width,
- unsigned int height)
-{
- pixman_rectangle_t rect;
-
- rect.x = x;
- rect.y = y;
- rect.width = width;
- rect.height = height;
-
- pixman_fill_rectangles (op, dst, color, &rect, 1);
-}
-
-void
-pixman_fill_rectangles (pixman_operator_t op,
- pixman_image_t *dst,
- const pixman_color_t *color,
- const pixman_rectangle_t *rects,
- int nRects)
-{
- pixman_color_t color_s = *color;
-
- if (color_s.alpha == 0xffff)
- {
- if (op == PIXMAN_OPERATOR_OVER)
- op = PIXMAN_OPERATOR_SRC;
- }
- if (op == PIXMAN_OPERATOR_CLEAR)
- color_s.red = color_s.green = color_s.blue = color_s.alpha = 0;
-
- if (op == PIXMAN_OPERATOR_SRC || op == PIXMAN_OPERATOR_CLEAR)
- {
- /* We cast away the constness of rects here, because pixman_color_rects
- temporarily modifies it */
- pixman_color_rects (dst, dst, &color_s, nRects, (pixman_rectangle_t *)rects, 0, 0);
- if (dst->alphaMap)
- pixman_color_rects (dst->alphaMap, dst,
- &color_s, nRects, (pixman_rectangle_t *)rects,
- dst->alphaOrigin.x,
- dst->alphaOrigin.y);
- }
- else
- {
- pixman_format_t rgbaFormat;
- IcPixels *pixels;
- pixman_image_t *src;
- pixman_bits_t pixel;
-
- pixman_format_init (&rgbaFormat, PICT_a8r8g8b8);
-
- pixels = IcPixelsCreate (1, 1, rgbaFormat.depth);
- if (!pixels)
- goto bail1;
-
- pixman_color_to_pixel (&rgbaFormat, &color_s, &pixel);
-
- /* XXX: Originally, fb had the following:
-
- (*pGC->ops->PolyFillRect) (&pPixmap->drawable, pGC, 1, &one);
-
- I haven't checked to see what I might be breaking with a
- trivial assignment instead.
- */
- pixels->data[0] = pixel;
-
- src = pixman_image_createForPixels (pixels, &rgbaFormat);
- if (!src)
- goto bail2;
-
- pixman_image_set_repeat (src, 1);
-
- while (nRects--)
- {
- pixman_composite (op, src, 0, dst, 0, 0, 0, 0,
- rects->x,
- rects->y,
- rects->width,
- rects->height);
- rects++;
- }
-
- pixman_image_destroy (src);
-bail2:
- IcPixelsDestroy (pixels);
-bail1:
- ;
- }
-}
-slim_hidden_def(pixman_fill_rectangles);
diff --git a/pixman/src/icrop.h b/pixman/src/icrop.h
deleted file mode 100644
index 7ea81f158..000000000
--- a/pixman/src/icrop.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Id: $
- *
- * Copyright Β© 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _ICROP_H_
-#define _ICROP_H_
-
-typedef struct _mergeRopBits {
- pixman_bits_t ca1, cx1, ca2, cx2;
-} IcMergeRopRec, *IcMergeRopPtr;
-
-extern const IcMergeRopRec IcMergeRopBits[16] pixman_private;
-
-#define IcDeclareMergeRop() pixman_bits_t _ca1, _cx1, _ca2, _cx2;
-#define IcDeclarePrebuiltMergeRop() pixman_bits_t _cca, _ccx;
-
-#define IcInitializeMergeRop(alu,pm) {\
- const IcMergeRopRec *_bits; \
- _bits = &IcMergeRopBits[alu]; \
- _ca1 = _bits->ca1 & pm; \
- _cx1 = _bits->cx1 | ~pm; \
- _ca2 = _bits->ca2 & pm; \
- _cx2 = _bits->cx2 & pm; \
-}
-
-#define IcDestInvarientRop(alu,pm) ((pm) == IC_ALLONES && \
- (((alu) >> 1 & 5) == ((alu) & 5)))
-
-#define IcDestInvarientMergeRop() (_ca1 == 0 && _cx1 == 0)
-
-/* AND has higher precedence than XOR */
-
-#define IcDoMergeRop(src, dst) \
- (((dst) & (((src) & _ca1) ^ _cx1)) ^ (((src) & _ca2) ^ _cx2))
-
-#define IcDoDestInvarientMergeRop(src) (((src) & _ca2) ^ _cx2)
-
-#define IcDoMaskMergeRop(src, dst, mask) \
- (((dst) & ((((src) & _ca1) ^ _cx1) | ~(mask))) ^ ((((src) & _ca2) ^ _cx2) & (mask)))
-
-#define IcDoLeftMaskByteMergeRop(dst, src, lb, l) { \
- pixman_bits_t __xor = ((src) & _ca2) ^ _cx2; \
- IcDoLeftMaskByteRRop(dst,lb,l,((src) & _ca1) ^ _cx1,__xor); \
-}
-
-#define IcDoRightMaskByteMergeRop(dst, src, rb, r) { \
- pixman_bits_t __xor = ((src) & _ca2) ^ _cx2; \
- IcDoRightMaskByteRRop(dst,rb,r,((src) & _ca1) ^ _cx1,__xor); \
-}
-
-#define IcDoRRop(dst, and, xor) (((dst) & (and)) ^ (xor))
-
-#define IcDoMaskRRop(dst, and, xor, mask) \
- (((dst) & ((and) | ~(mask))) ^ (xor & mask))
-
-/*
- * Take a single bit (0 or 1) and generate a full mask
- */
-#define IcFillFromBit(b,t) (~((t) ((b) & 1)-1))
-
-#define IcXorT(rop,fg,pm,t) ((((fg) & IcFillFromBit((rop) >> 1,t)) | \
- (~(fg) & IcFillFromBit((rop) >> 3,t))) & (pm))
-
-#define IcAndT(rop,fg,pm,t) ((((fg) & IcFillFromBit (rop ^ (rop>>1),t)) | \
- (~(fg) & IcFillFromBit((rop>>2) ^ (rop>>3),t))) | \
- ~(pm))
-
-#define IcXor(rop,fg,pm) IcXorT(rop,fg,pm,pixman_bits_t)
-
-#define IcAnd(rop,fg,pm) IcAndT(rop,fg,pm,pixman_bits_t)
-
-#define IcXorStip(rop,fg,pm) IcXorT(rop,fg,pm,IcStip)
-
-#define IcAndStip(rop,fg,pm) IcAndT(rop,fg,pm,IcStip)
-
-/*
- * Stippling operations;
- */
-
-/* half of table */
-extern const pixman_bits_t icStipple16Bits[256] pixman_private;
-#define IcStipple16Bits(b) \
- (icStipple16Bits[(b)&0xff] | icStipple16Bits[(b) >> 8] << IC_HALFUNIT)
-
-pixman_private const pixman_bits_t *
-IcStippleTable(int bits);
-
-#define IcStippleRRop(dst, b, fa, fx, ba, bx) \
- (IcDoRRop(dst, fa, fx) & b) | (IcDoRRop(dst, ba, bx) & ~b)
-
-#define IcStippleRRopMask(dst, b, fa, fx, ba, bx, m) \
- (IcDoMaskRRop(dst, fa, fx, m) & (b)) | (IcDoMaskRRop(dst, ba, bx, m) & ~(b))
-
-#define IcDoLeftMaskByteStippleRRop(dst, b, fa, fx, ba, bx, lb, l) { \
- pixman_bits_t __xor = ((fx) & (b)) | ((bx) & ~(b)); \
- IcDoLeftMaskByteRRop(dst, lb, l, ((fa) & (b)) | ((ba) & ~(b)), __xor); \
-}
-
-#define IcDoRightMaskByteStippleRRop(dst, b, fa, fx, ba, bx, rb, r) { \
- pixman_bits_t __xor = ((fx) & (b)) | ((bx) & ~(b)); \
- IcDoRightMaskByteRRop(dst, rb, r, ((fa) & (b)) | ((ba) & ~(b)), __xor); \
-}
-
-#define IcOpaqueStipple(b, fg, bg) (((fg) & (b)) | ((bg) & ~(b)))
-
-/*
- * Compute rop for using tile code for 1-bit dest stipples; modifies
- * existing rop to flip depending on pixel values
- */
-#define IcStipple1RopPick(alu,b) (((alu) >> (2 - (((b) & 1) << 1))) & 3)
-
-#define IcOpaqueStipple1Rop(alu,fg,bg) (IcStipple1RopPick(alu,fg) | \
- (IcStipple1RopPick(alu,bg) << 2))
-
-#define IcStipple1Rop(alu,fg) (IcStipple1RopPick(alu,fg) | 4)
-
-#endif
diff --git a/pixman/src/icstipple.c b/pixman/src/icstipple.c
deleted file mode 100644
index 121bbaa86..000000000
--- a/pixman/src/icstipple.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Id: $
- *
- * Copyright Β© 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "icint.h"
-
-#ifndef ICNOPIXADDR
-/*
- * This is a slight abuse of the preprocessor to generate repetitive
- * code, the idea is to generate code for each case of a copy-mode
- * transparent stipple
- */
-#define LaneCases1(c,a) case c: \
- while (n--) { (void)IcLaneCase(c,a); a++; } \
- break
-#define LaneCases2(c,a) LaneCases1(c,a); LaneCases1(c+1,a)
-#define LaneCases4(c,a) LaneCases2(c,a); LaneCases2(c+2,a)
-#define LaneCases8(c,a) LaneCases4(c,a); LaneCases4(c+4,a)
-#define LaneCases16(c,a) LaneCases8(c,a); LaneCases8(c+8,a)
-#define LaneCases32(c,a) LaneCases16(c,a); LaneCases16(c+16,a)
-#define LaneCases64(c,a) LaneCases32(c,a); LaneCases32(c+32,a)
-#define LaneCases128(c,a) LaneCases64(c,a); LaneCases64(c+64,a)
-#define LaneCases256(c,a) LaneCases128(c,a); LaneCases128(c+128,a)
-
-#if IC_SHIFT == 6
-#define LaneCases(a) LaneCases256(0,a)
-#endif
-
-#if IC_SHIFT == 5
-#define LaneCases(a) LaneCases16(0,a)
-#endif
-
-/*
- * Repeat a transparent stipple across a scanline n times
- */
-
-void
-IcTransparentSpan (pixman_bits_t *dst,
- pixman_bits_t stip,
- pixman_bits_t fgxor,
- int n)
-{
- IcStip s;
-
- s = ((IcStip) (stip ) & 0x01);
- s |= ((IcStip) (stip >> 8) & 0x02);
- s |= ((IcStip) (stip >> 16) & 0x04);
- s |= ((IcStip) (stip >> 24) & 0x08);
-#if IC_SHIFT > 5
- s |= ((IcStip) (stip >> 32) & 0x10);
- s |= ((IcStip) (stip >> 40) & 0x20);
- s |= ((IcStip) (stip >> 48) & 0x40);
- s |= ((IcStip) (stip >> 56) & 0x80);
-#endif
- switch (s) {
- LaneCases(dst);
- }
-}
-#endif
diff --git a/pixman/src/ictransform.c b/pixman/src/ictransform.c
deleted file mode 100644
index 982f9293a..000000000
--- a/pixman/src/ictransform.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright Β© 2000 SuSE, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. SuSE makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Keith Packard, SuSE, Inc.
- */
-
-#include "icint.h"
-
-#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff)
-#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31))
-
-int
-pixman_transform_point (pixman_transform_t *transform,
- pixman_vector_t *vector)
-{
- pixman_vector_t result;
- int i, j;
- xFixed_32_32 partial;
- xFixed_48_16 v;
-
- for (j = 0; j < 3; j++)
- {
- v = 0;
- for (i = 0; i < 3; i++)
- {
- partial = ((xFixed_48_16) transform->matrix[j][i] *
- (xFixed_48_16) vector->vector[i]);
- v += partial >> 16;
- }
- if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16)
- return 0;
- result.vector[j] = (xFixed) v;
- }
- if (!result.vector[2])
- return 0;
- for (j = 0; j < 2; j++)
- {
- partial = (xFixed_48_16) result.vector[j] << 16;
- v = partial / result.vector[2];
- if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16)
- return 0;
- vector->vector[j] = (xFixed) v;
- }
- vector->vector[2] = xFixed1;
- return 1;
-}
-
diff --git a/pixman/src/ictrap.c b/pixman/src/ictrap.c
deleted file mode 100644
index 0fcd59b33..000000000
--- a/pixman/src/ictrap.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * $Id: ictrap.c,v 1.25 2005-05-13 03:25:07 keithp Exp $
- *
- * Copyright Β© 2002 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "icint.h"
-
-pixman_image_t *
-IcCreateAlphaPicture (pixman_image_t *dst,
- pixman_format_t *format,
- uint16_t width,
- uint16_t height)
-{
- pixman_image_t *image;
- int own_format = 0;
-
- if (width > 32767 || height > 32767)
- return 0;
-
- if (!format)
- {
- own_format = 1;
- if (dst->polyEdge == PolyEdgeSharp)
- format = pixman_format_create (PIXMAN_FORMAT_NAME_A1);
- else
- format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
- if (!format)
- return 0;
- }
-
- image = pixman_image_create (format, width, height);
-
- if (own_format)
- pixman_format_destroy (format);
-
- /* XXX: Is this a reasonable way to clear the image? Would
- probably be preferable to use pixman_image_fill_rectangle once such a
- beast exists. */
- memset (image->pixels->data, 0, height * image->pixels->stride);
-
- return image;
-}
-
-static pixman_fixed16_16_t
-pixman_line_fixed_x (const pixman_line_fixed_t *l, pixman_fixed16_16_t y, int ceil)
-{
- pixman_fixed16_16_t dx = l->p2.x - l->p1.x;
- xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx;
- pixman_fixed16_16_t dy = l->p2.y - l->p1.y;
- if (ceil)
- ex += (dy - 1);
- return l->p1.x + (pixman_fixed16_16_t) (ex / dy);
-}
-
-static void
-pixman_trapezoid_bounds (int ntrap, const pixman_trapezoid_t *traps, pixman_box16_t *box)
-{
- box->y1 = MAXSHORT;
- box->y2 = MINSHORT;
- box->x1 = MAXSHORT;
- box->x2 = MINSHORT;
- for (; ntrap; ntrap--, traps++)
- {
- int16_t x1, y1, x2, y2;
-
- if (!xTrapezoidValid(traps))
- continue;
- y1 = xFixedToInt (traps->top);
- if (y1 < box->y1)
- box->y1 = y1;
-
- y2 = xFixedToInt (xFixedCeil (traps->bottom));
- if (y2 > box->y2)
- box->y2 = y2;
-
- x1 = xFixedToInt (MIN (pixman_line_fixed_x (&traps->left, traps->top, 0),
- pixman_line_fixed_x (&traps->left, traps->bottom, 0)));
- if (x1 < box->x1)
- box->x1 = x1;
-
- x2 = xFixedToInt (xFixedCeil (MAX (pixman_line_fixed_x (&traps->right, traps->top, 1),
- pixman_line_fixed_x (&traps->right, traps->bottom, 1))));
- if (x2 > box->x2)
- box->x2 = x2;
- }
-}
-
-/* XXX: There are failure cases in this function. Don't we need to
- * propagate the errors out?
- */
-void
-pixman_composite_trapezoids (pixman_operator_t op,
- pixman_image_t *src,
- pixman_image_t *dst,
- int xSrc,
- int ySrc,
- const pixman_trapezoid_t *traps,
- int ntraps)
-{
- pixman_image_t *image = NULL;
- pixman_box16_t traps_bounds, dst_bounds, bounds;
- pixman_region16_t *traps_region, *dst_region;
- int16_t xDst, yDst;
- int16_t xRel, yRel;
- pixman_format_t *format;
-
- if (ntraps == 0)
- return;
-
- /*
- * Check for solid alpha add
- */
- if (op == PIXMAN_OPERATOR_ADD && miIsSolidAlpha (src))
- {
- for (; ntraps; ntraps--, traps++)
- fbRasterizeTrapezoid (dst, traps, 0, 0);
- return;
- }
-
- xDst = traps[0].left.p1.x >> 16;
- yDst = traps[0].left.p1.y >> 16;
-
- pixman_trapezoid_bounds (ntraps, traps, &traps_bounds);
-
- traps_region = pixman_region_create_simple (&traps_bounds);
-
- /* XXX: If the image has a clip region set, we should really be
- * fetching it here instead, but it looks like we don't yet expose
- * a pixman_image_get_clip_region function. */
- dst_bounds.x1 = 0;
- dst_bounds.y1 = 0;
- dst_bounds.x2 = pixman_image_get_width (dst);
- dst_bounds.y2 = pixman_image_get_height (dst);
-
- dst_region = pixman_region_create_simple (&dst_bounds);
-
- pixman_region_intersect (traps_region, traps_region, dst_region);
-
- bounds = *(pixman_region_extents (traps_region));
-
- pixman_region_destroy (traps_region);
- pixman_region_destroy (dst_region);
-
- if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
- return;
-
- format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
- if (!format)
- return;
-
- image = IcCreateAlphaPicture (dst, format,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!image)
- {
- pixman_format_destroy (format);
- return;
- }
-
- for (; ntraps; ntraps--, traps++)
- {
- if (!xTrapezoidValid(traps))
- continue;
- fbRasterizeTrapezoid (image, traps,
- -bounds.x1, -bounds.y1);
- }
-
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- pixman_composite (op, src, image, dst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- pixman_image_destroy (image);
-
- pixman_format_destroy (format);
-}
-
-void
-pixman_add_trapezoids (pixman_image_t *dst,
- int x_off,
- int y_off,
- const pixman_trapezoid_t *traps,
- int ntraps)
-{
- for (; ntraps; ntraps--, traps++)
- {
- if (!xTrapezoidValid (traps))
- continue;
-
- fbRasterizeTrapezoid (dst, traps, x_off, y_off);
- }
-}
diff --git a/pixman/src/ictri.c b/pixman/src/ictri.c
deleted file mode 100644
index 97fbca544..000000000
--- a/pixman/src/ictri.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Copyright Β© 2002 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "icint.h"
-
-static void
-pixman_point_fixed_bounds (int npoint, const pixman_point_fixed_t *points, pixman_box16_t *bounds)
-{
- bounds->x1 = xFixedToInt (points->x);
- bounds->x2 = xFixedToInt (xFixedCeil (points->x));
- bounds->y1 = xFixedToInt (points->y);
- bounds->y2 = xFixedToInt (xFixedCeil (points->y));
- points++;
- npoint--;
- while (npoint-- > 0)
- {
- int x1 = xFixedToInt (points->x);
- int x2 = xFixedToInt (xFixedCeil (points->x));
- int y1 = xFixedToInt (points->y);
- int y2 = xFixedToInt (xFixedCeil (points->y));
-
- if (x1 < bounds->x1)
- bounds->x1 = x1;
- else if (x2 > bounds->x2)
- bounds->x2 = x2;
- if (y1 < bounds->y1)
- bounds->y1 = y1;
- else if (y2 > bounds->y2)
- bounds->y2 = y2;
- points++;
- }
-}
-
-static void
-pixman_triangle_bounds (int ntri, const pixman_triangle_t *tris, pixman_box16_t *bounds)
-{
- pixman_point_fixed_bounds (ntri * 3, (pixman_point_fixed_t *) tris, bounds);
-}
-
-static void
-IcRasterizeTriangle (pixman_image_t *image,
- const pixman_triangle_t *tri,
- int x_off,
- int y_off)
-{
- const pixman_point_fixed_t *top, *left, *right, *t;
- pixman_trapezoid_t trap[2];
-
- top = &tri->p1;
- left = &tri->p2;
- right = &tri->p3;
- if (left->y < top->y) {
- t = left; left = top; top = t;
- }
- if (right->y < top->y) {
- t = right; right = top; top = t;
- }
- /* XXX: This code is broken, left and right must be determined by
- comparing the angles of the two edges, (eg. we can only compare
- X coordinates if we've already intersected each edge with the
- same Y coordinate) */
- if (right->x < left->x) {
- t = right; right = left; left = t;
- }
-
- /*
- * Two cases:
- *
- * + +
- * / \ / \
- * / \ / \
- * / + + \
- * / -- -- \
- * / -- -- \
- * / --- --- \
- * +-- --+
- */
-
- trap[0].top = top->y;
-
- trap[0].left.p1.x = top->x;
- trap[0].left.p1.y = trap[0].top;
- trap[0].left.p2.x = left->x;
- trap[0].left.p2.y = left->y;
-
- trap[0].right.p1 = trap[0].left.p1;
- trap[0].right.p2.x = right->x;
- trap[0].right.p2.y = right->y;
-
- if (right->y < left->y)
- {
- trap[0].bottom = trap[0].right.p2.y;
-
- trap[1].top = trap[0].bottom;
- trap[1].bottom = trap[0].left.p2.y;
-
- trap[1].left = trap[0].left;
- trap[1].right.p1 = trap[0].right.p2;
- trap[1].right.p2 = trap[0].left.p2;
- }
- else
- {
- trap[0].bottom = trap[0].left.p2.y;
-
- trap[1].top = trap[0].bottom;
- trap[1].bottom = trap[0].right.p2.y;
-
- trap[1].right = trap[0].right;
- trap[1].left.p1 = trap[0].left.p2;
- trap[1].left.p2 = trap[0].right.p2;
- }
- if (trap[0].top != trap[0].bottom)
- fbRasterizeTrapezoid (image, &trap[0], x_off, y_off);
- if (trap[1].top != trap[1].bottom)
- fbRasterizeTrapezoid (image, &trap[1], x_off, y_off);
-}
-
-void
-pixman_composite_triangles (pixman_operator_t op,
- pixman_image_t *src,
- pixman_image_t *dst,
- int xSrc,
- int ySrc,
- const pixman_triangle_t *tris,
- int ntris)
-{
- pixman_box16_t bounds;
- pixman_image_t *image = NULL;
- int xDst, yDst;
- int xRel, yRel;
- pixman_format_t *format;
-
- xDst = tris[0].p1.x >> 16;
- yDst = tris[0].p1.y >> 16;
-
- format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
-
- if (format)
- {
- pixman_triangle_bounds (ntris, tris, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- return;
- image = IcCreateAlphaPicture (dst,
- format,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!image)
- return;
- }
- for (; ntris; ntris--, tris++)
- {
- if (!format)
- {
- pixman_triangle_bounds (1, tris, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- continue;
- image = IcCreateAlphaPicture (dst,
- format,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!image)
- break;
- }
- IcRasterizeTriangle (image, tris, -bounds.x1, -bounds.y1);
- if (!format)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- pixman_composite (op, src, image, dst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- pixman_image_destroy (image);
- }
- /* XXX adjust xSrc and ySrc */
- }
- if (format)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- pixman_composite (op, src, image, dst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- pixman_image_destroy (image);
- }
-
- pixman_format_destroy (format);
-}
-
-void
-pixman_composite_tri_strip (pixman_operator_t op,
- pixman_image_t *src,
- pixman_image_t *dst,
- int xSrc,
- int ySrc,
- const pixman_point_fixed_t *points,
- int npoints)
-{
- pixman_triangle_t tri;
- pixman_box16_t bounds;
- pixman_image_t *image = NULL;
- int xDst, yDst;
- int xRel, yRel;
- pixman_format_t *format;
-
- xDst = points[0].x >> 16;
- yDst = points[0].y >> 16;
-
- format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
-
- if (npoints < 3)
- return;
- if (format)
- {
- pixman_point_fixed_bounds (npoints, points, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- return;
- image = IcCreateAlphaPicture (dst,
- format,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!image)
- return;
- }
- for (; npoints >= 3; npoints--, points++)
- {
- tri.p1 = points[0];
- tri.p2 = points[1];
- tri.p3 = points[2];
- if (!format)
- {
- pixman_triangle_bounds (1, &tri, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- continue;
- image = IcCreateAlphaPicture (dst,
- format,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!image)
- continue;
- }
- IcRasterizeTriangle (image, &tri, -bounds.x1, -bounds.y1);
- if (!format)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- pixman_composite (op, src, image, dst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- pixman_image_destroy (image);
- }
- }
- if (format)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- pixman_composite (op, src, image, dst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- pixman_image_destroy (image);
- }
-
- pixman_format_destroy (format);
-}
-
-void
-pixman_composite_tri_fan (pixman_operator_t op,
- pixman_image_t *src,
- pixman_image_t *dst,
- int xSrc,
- int ySrc,
- const pixman_point_fixed_t *points,
- int npoints)
-{
- pixman_triangle_t tri;
- pixman_box16_t bounds;
- pixman_image_t *image = NULL;
- const pixman_point_fixed_t *first;
- int xDst, yDst;
- int xRel, yRel;
- pixman_format_t *format;
-
- xDst = points[0].x >> 16;
- yDst = points[0].y >> 16;
-
- format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
-
- if (npoints < 3)
- return;
- if (format)
- {
- pixman_point_fixed_bounds (npoints, points, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- return;
- image = IcCreateAlphaPicture (dst,
- format,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!image)
- return;
- }
- first = points++;
- npoints--;
- for (; npoints >= 2; npoints--, points++)
- {
- tri.p1 = *first;
- tri.p2 = points[0];
- tri.p3 = points[1];
- if (!format)
- {
- pixman_triangle_bounds (1, &tri, &bounds);
- if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
- continue;
- image = IcCreateAlphaPicture (dst,
- format,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!image)
- continue;
- }
- IcRasterizeTriangle (image, &tri, -bounds.x1, -bounds.y1);
- if (!format)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- pixman_composite (op, src, image, dst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- pixman_image_destroy (image);
- }
- }
- if (format)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- pixman_composite (op, src, image, dst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
- pixman_image_destroy (image);
- }
-
- pixman_format_destroy (format);
-}
-
diff --git a/pixman/src/icutil.c b/pixman/src/icutil.c
deleted file mode 100644
index 549217000..000000000
--- a/pixman/src/icutil.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Id: $
- *
- * Copyright Β© 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "icint.h"
-
-pixman_bits_t
-IcReplicatePixel (Pixel p, int bpp)
-{
- pixman_bits_t b = p;
-
- b &= IcFullMask (bpp);
- while (bpp < IC_UNIT)
- {
- b |= b << bpp;
- bpp <<= 1;
- }
- return b;
-}
-
-#define O 0
-#define I IC_ALLONES
-
-const IcMergeRopRec IcMergeRopBits[16] = {
- { O,O,O,O }, /* clear 0x0 0 */
- { I,O,O,O }, /* and 0x1 src AND dst */
- { I,O,I,O }, /* andReverse 0x2 src AND NOT dst */
- { O,O,I,O }, /* copy 0x3 src */
- { I,I,O,O }, /* andInverted 0x4 NOT src AND dst */
- { O,I,O,O }, /* noop 0x5 dst */
- { O,I,I,O }, /* xor 0x6 src XOR dst */
- { I,I,I,O }, /* or 0x7 src OR dst */
- { I,I,I,I }, /* nor 0x8 NOT src AND NOT dst */
- { O,I,I,I }, /* equiv 0x9 NOT src XOR dst */
- { O,I,O,I }, /* invert 0xa NOT dst */
- { I,I,O,I }, /* orReverse 0xb src OR NOT dst */
- { O,O,I,I }, /* copyInverted 0xc NOT src */
- { I,O,I,I }, /* orInverted 0xd NOT src OR dst */
- { I,O,O,I }, /* nand 0xe NOT src OR NOT dst */
- { O,O,O,I }, /* set 0xf 1 */
-};
-
-/*
- * Stipple masks are independent of bit/byte order as long
- * as bitorder == byteorder. IC doesn't handle the case
- * where these differ
- */
-#define BitsMask(x,w) ((IC_ALLONES << ((x) & IC_MASK)) & \
- (IC_ALLONES >> ((IC_UNIT - ((x) + (w))) & IC_MASK)))
-
-#define Mask(x,w) BitsMask((x)*(w),(w))
-
-
-#define SelMask(b,n,w) ((((b) >> n) & 1) * Mask(n,w))
-
-#define C1(b,w) \
- (SelMask(b,0,w))
-
-#define C2(b,w) \
- (SelMask(b,0,w) | \
- SelMask(b,1,w))
-
-#define C4(b,w) \
- (SelMask(b,0,w) | \
- SelMask(b,1,w) | \
- SelMask(b,2,w) | \
- SelMask(b,3,w))
-
-#define C8(b,w) \
- (SelMask(b,0,w) | \
- SelMask(b,1,w) | \
- SelMask(b,2,w) | \
- SelMask(b,3,w) | \
- SelMask(b,4,w) | \
- SelMask(b,5,w) | \
- SelMask(b,6,w) | \
- SelMask(b,7,w))
-
-#if IC_UNIT == 16
-#define icStipple16Bits 0
-#define icStipple8Bits 0
-static const pixman_bits_t icStipple4Bits[16] = {
- C4( 0,4), C4( 1,4), C4( 2,4), C4( 3,4), C4( 4,4), C4( 5,4),
- C4( 6,4), C4( 7,4), C4( 8,4), C4( 9,4), C4( 10,4), C4( 11,4),
- C4( 12,4), C4( 13,4), C4( 14,4), C4( 15,4),};
-static const pixman_bits_t icStipple2Bits[4] = {
- C2( 0,8), C2( 1,8), C2( 2,8), C2( 3,8),
-};
-static const pixman_bits_t icStipple1Bits[2] = {
- C1( 0,16), C1( 1,16),
-};
-#endif
-#if IC_UNIT == 32
-#define icStipple16Bits 0
-static const pixman_bits_t icStipple8Bits[256] = {
- C8( 0,4), C8( 1,4), C8( 2,4), C8( 3,4), C8( 4,4), C8( 5,4),
- C8( 6,4), C8( 7,4), C8( 8,4), C8( 9,4), C8( 10,4), C8( 11,4),
- C8( 12,4), C8( 13,4), C8( 14,4), C8( 15,4), C8( 16,4), C8( 17,4),
- C8( 18,4), C8( 19,4), C8( 20,4), C8( 21,4), C8( 22,4), C8( 23,4),
- C8( 24,4), C8( 25,4), C8( 26,4), C8( 27,4), C8( 28,4), C8( 29,4),
- C8( 30,4), C8( 31,4), C8( 32,4), C8( 33,4), C8( 34,4), C8( 35,4),
- C8( 36,4), C8( 37,4), C8( 38,4), C8( 39,4), C8( 40,4), C8( 41,4),
- C8( 42,4), C8( 43,4), C8( 44,4), C8( 45,4), C8( 46,4), C8( 47,4),
- C8( 48,4), C8( 49,4), C8( 50,4), C8( 51,4), C8( 52,4), C8( 53,4),
- C8( 54,4), C8( 55,4), C8( 56,4), C8( 57,4), C8( 58,4), C8( 59,4),
- C8( 60,4), C8( 61,4), C8( 62,4), C8( 63,4), C8( 64,4), C8( 65,4),
- C8( 66,4), C8( 67,4), C8( 68,4), C8( 69,4), C8( 70,4), C8( 71,4),
- C8( 72,4), C8( 73,4), C8( 74,4), C8( 75,4), C8( 76,4), C8( 77,4),
- C8( 78,4), C8( 79,4), C8( 80,4), C8( 81,4), C8( 82,4), C8( 83,4),
- C8( 84,4), C8( 85,4), C8( 86,4), C8( 87,4), C8( 88,4), C8( 89,4),
- C8( 90,4), C8( 91,4), C8( 92,4), C8( 93,4), C8( 94,4), C8( 95,4),
- C8( 96,4), C8( 97,4), C8( 98,4), C8( 99,4), C8(100,4), C8(101,4),
- C8(102,4), C8(103,4), C8(104,4), C8(105,4), C8(106,4), C8(107,4),
- C8(108,4), C8(109,4), C8(110,4), C8(111,4), C8(112,4), C8(113,4),
- C8(114,4), C8(115,4), C8(116,4), C8(117,4), C8(118,4), C8(119,4),
- C8(120,4), C8(121,4), C8(122,4), C8(123,4), C8(124,4), C8(125,4),
- C8(126,4), C8(127,4), C8(128,4), C8(129,4), C8(130,4), C8(131,4),
- C8(132,4), C8(133,4), C8(134,4), C8(135,4), C8(136,4), C8(137,4),
- C8(138,4), C8(139,4), C8(140,4), C8(141,4), C8(142,4), C8(143,4),
- C8(144,4), C8(145,4), C8(146,4), C8(147,4), C8(148,4), C8(149,4),
- C8(150,4), C8(151,4), C8(152,4), C8(153,4), C8(154,4), C8(155,4),
- C8(156,4), C8(157,4), C8(158,4), C8(159,4), C8(160,4), C8(161,4),
- C8(162,4), C8(163,4), C8(164,4), C8(165,4), C8(166,4), C8(167,4),
- C8(168,4), C8(169,4), C8(170,4), C8(171,4), C8(172,4), C8(173,4),
- C8(174,4), C8(175,4), C8(176,4), C8(177,4), C8(178,4), C8(179,4),
- C8(180,4), C8(181,4), C8(182,4), C8(183,4), C8(184,4), C8(185,4),
- C8(186,4), C8(187,4), C8(188,4), C8(189,4), C8(190,4), C8(191,4),
- C8(192,4), C8(193,4), C8(194,4), C8(195,4), C8(196,4), C8(197,4),
- C8(198,4), C8(199,4), C8(200,4), C8(201,4), C8(202,4), C8(203,4),
- C8(204,4), C8(205,4), C8(206,4), C8(207,4), C8(208,4), C8(209,4),
- C8(210,4), C8(211,4), C8(212,4), C8(213,4), C8(214,4), C8(215,4),
- C8(216,4), C8(217,4), C8(218,4), C8(219,4), C8(220,4), C8(221,4),
- C8(222,4), C8(223,4), C8(224,4), C8(225,4), C8(226,4), C8(227,4),
- C8(228,4), C8(229,4), C8(230,4), C8(231,4), C8(232,4), C8(233,4),
- C8(234,4), C8(235,4), C8(236,4), C8(237,4), C8(238,4), C8(239,4),
- C8(240,4), C8(241,4), C8(242,4), C8(243,4), C8(244,4), C8(245,4),
- C8(246,4), C8(247,4), C8(248,4), C8(249,4), C8(250,4), C8(251,4),
- C8(252,4), C8(253,4), C8(254,4), C8(255,4),
-};
-static const pixman_bits_t icStipple4Bits[16] = {
- C4( 0,8), C4( 1,8), C4( 2,8), C4( 3,8), C4( 4,8), C4( 5,8),
- C4( 6,8), C4( 7,8), C4( 8,8), C4( 9,8), C4( 10,8), C4( 11,8),
- C4( 12,8), C4( 13,8), C4( 14,8), C4( 15,8),};
-static const pixman_bits_t icStipple2Bits[4] = {
- C2( 0,16), C2( 1,16), C2( 2,16), C2( 3,16),
-};
-static const pixman_bits_t icStipple1Bits[2] = {
- C1( 0,32), C1( 1,32),
-};
-#endif
-#if IC_UNIT == 64
-const pixman_bits_t icStipple16Bits[256] = {
- C8( 0,4), C8( 1,4), C8( 2,4), C8( 3,4), C8( 4,4), C8( 5,4),
- C8( 6,4), C8( 7,4), C8( 8,4), C8( 9,4), C8( 10,4), C8( 11,4),
- C8( 12,4), C8( 13,4), C8( 14,4), C8( 15,4), C8( 16,4), C8( 17,4),
- C8( 18,4), C8( 19,4), C8( 20,4), C8( 21,4), C8( 22,4), C8( 23,4),
- C8( 24,4), C8( 25,4), C8( 26,4), C8( 27,4), C8( 28,4), C8( 29,4),
- C8( 30,4), C8( 31,4), C8( 32,4), C8( 33,4), C8( 34,4), C8( 35,4),
- C8( 36,4), C8( 37,4), C8( 38,4), C8( 39,4), C8( 40,4), C8( 41,4),
- C8( 42,4), C8( 43,4), C8( 44,4), C8( 45,4), C8( 46,4), C8( 47,4),
- C8( 48,4), C8( 49,4), C8( 50,4), C8( 51,4), C8( 52,4), C8( 53,4),
- C8( 54,4), C8( 55,4), C8( 56,4), C8( 57,4), C8( 58,4), C8( 59,4),
- C8( 60,4), C8( 61,4), C8( 62,4), C8( 63,4), C8( 64,4), C8( 65,4),
- C8( 66,4), C8( 67,4), C8( 68,4), C8( 69,4), C8( 70,4), C8( 71,4),
- C8( 72,4), C8( 73,4), C8( 74,4), C8( 75,4), C8( 76,4), C8( 77,4),
- C8( 78,4), C8( 79,4), C8( 80,4), C8( 81,4), C8( 82,4), C8( 83,4),
- C8( 84,4), C8( 85,4), C8( 86,4), C8( 87,4), C8( 88,4), C8( 89,4),
- C8( 90,4), C8( 91,4), C8( 92,4), C8( 93,4), C8( 94,4), C8( 95,4),
- C8( 96,4), C8( 97,4), C8( 98,4), C8( 99,4), C8(100,4), C8(101,4),
- C8(102,4), C8(103,4), C8(104,4), C8(105,4), C8(106,4), C8(107,4),
- C8(108,4), C8(109,4), C8(110,4), C8(111,4), C8(112,4), C8(113,4),
- C8(114,4), C8(115,4), C8(116,4), C8(117,4), C8(118,4), C8(119,4),
- C8(120,4), C8(121,4), C8(122,4), C8(123,4), C8(124,4), C8(125,4),
- C8(126,4), C8(127,4), C8(128,4), C8(129,4), C8(130,4), C8(131,4),
- C8(132,4), C8(133,4), C8(134,4), C8(135,4), C8(136,4), C8(137,4),
- C8(138,4), C8(139,4), C8(140,4), C8(141,4), C8(142,4), C8(143,4),
- C8(144,4), C8(145,4), C8(146,4), C8(147,4), C8(148,4), C8(149,4),
- C8(150,4), C8(151,4), C8(152,4), C8(153,4), C8(154,4), C8(155,4),
- C8(156,4), C8(157,4), C8(158,4), C8(159,4), C8(160,4), C8(161,4),
- C8(162,4), C8(163,4), C8(164,4), C8(165,4), C8(166,4), C8(167,4),
- C8(168,4), C8(169,4), C8(170,4), C8(171,4), C8(172,4), C8(173,4),
- C8(174,4), C8(175,4), C8(176,4), C8(177,4), C8(178,4), C8(179,4),
- C8(180,4), C8(181,4), C8(182,4), C8(183,4), C8(184,4), C8(185,4),
- C8(186,4), C8(187,4), C8(188,4), C8(189,4), C8(190,4), C8(191,4),
- C8(192,4), C8(193,4), C8(194,4), C8(195,4), C8(196,4), C8(197,4),
- C8(198,4), C8(199,4), C8(200,4), C8(201,4), C8(202,4), C8(203,4),
- C8(204,4), C8(205,4), C8(206,4), C8(207,4), C8(208,4), C8(209,4),
- C8(210,4), C8(211,4), C8(212,4), C8(213,4), C8(214,4), C8(215,4),
- C8(216,4), C8(217,4), C8(218,4), C8(219,4), C8(220,4), C8(221,4),
- C8(222,4), C8(223,4), C8(224,4), C8(225,4), C8(226,4), C8(227,4),
- C8(228,4), C8(229,4), C8(230,4), C8(231,4), C8(232,4), C8(233,4),
- C8(234,4), C8(235,4), C8(236,4), C8(237,4), C8(238,4), C8(239,4),
- C8(240,4), C8(241,4), C8(242,4), C8(243,4), C8(244,4), C8(245,4),
- C8(246,4), C8(247,4), C8(248,4), C8(249,4), C8(250,4), C8(251,4),
- C8(252,4), C8(253,4), C8(254,4), C8(255,4),
-};
-static const pixman_bits_t icStipple8Bits[256] = {
- C8( 0,8), C8( 1,8), C8( 2,8), C8( 3,8), C8( 4,8), C8( 5,8),
- C8( 6,8), C8( 7,8), C8( 8,8), C8( 9,8), C8( 10,8), C8( 11,8),
- C8( 12,8), C8( 13,8), C8( 14,8), C8( 15,8), C8( 16,8), C8( 17,8),
- C8( 18,8), C8( 19,8), C8( 20,8), C8( 21,8), C8( 22,8), C8( 23,8),
- C8( 24,8), C8( 25,8), C8( 26,8), C8( 27,8), C8( 28,8), C8( 29,8),
- C8( 30,8), C8( 31,8), C8( 32,8), C8( 33,8), C8( 34,8), C8( 35,8),
- C8( 36,8), C8( 37,8), C8( 38,8), C8( 39,8), C8( 40,8), C8( 41,8),
- C8( 42,8), C8( 43,8), C8( 44,8), C8( 45,8), C8( 46,8), C8( 47,8),
- C8( 48,8), C8( 49,8), C8( 50,8), C8( 51,8), C8( 52,8), C8( 53,8),
- C8( 54,8), C8( 55,8), C8( 56,8), C8( 57,8), C8( 58,8), C8( 59,8),
- C8( 60,8), C8( 61,8), C8( 62,8), C8( 63,8), C8( 64,8), C8( 65,8),
- C8( 66,8), C8( 67,8), C8( 68,8), C8( 69,8), C8( 70,8), C8( 71,8),
- C8( 72,8), C8( 73,8), C8( 74,8), C8( 75,8), C8( 76,8), C8( 77,8),
- C8( 78,8), C8( 79,8), C8( 80,8), C8( 81,8), C8( 82,8), C8( 83,8),
- C8( 84,8), C8( 85,8), C8( 86,8), C8( 87,8), C8( 88,8), C8( 89,8),
- C8( 90,8), C8( 91,8), C8( 92,8), C8( 93,8), C8( 94,8), C8( 95,8),
- C8( 96,8), C8( 97,8), C8( 98,8), C8( 99,8), C8(100,8), C8(101,8),
- C8(102,8), C8(103,8), C8(104,8), C8(105,8), C8(106,8), C8(107,8),
- C8(108,8), C8(109,8), C8(110,8), C8(111,8), C8(112,8), C8(113,8),
- C8(114,8), C8(115,8), C8(116,8), C8(117,8), C8(118,8), C8(119,8),
- C8(120,8), C8(121,8), C8(122,8), C8(123,8), C8(124,8), C8(125,8),
- C8(126,8), C8(127,8), C8(128,8), C8(129,8), C8(130,8), C8(131,8),
- C8(132,8), C8(133,8), C8(134,8), C8(135,8), C8(136,8), C8(137,8),
- C8(138,8), C8(139,8), C8(140,8), C8(141,8), C8(142,8), C8(143,8),
- C8(144,8), C8(145,8), C8(146,8), C8(147,8), C8(148,8), C8(149,8),
- C8(150,8), C8(151,8), C8(152,8), C8(153,8), C8(154,8), C8(155,8),
- C8(156,8), C8(157,8), C8(158,8), C8(159,8), C8(160,8), C8(161,8),
- C8(162,8), C8(163,8), C8(164,8), C8(165,8), C8(166,8), C8(167,8),
- C8(168,8), C8(169,8), C8(170,8), C8(171,8), C8(172,8), C8(173,8),
- C8(174,8), C8(175,8), C8(176,8), C8(177,8), C8(178,8), C8(179,8),
- C8(180,8), C8(181,8), C8(182,8), C8(183,8), C8(184,8), C8(185,8),
- C8(186,8), C8(187,8), C8(188,8), C8(189,8), C8(190,8), C8(191,8),
- C8(192,8), C8(193,8), C8(194,8), C8(195,8), C8(196,8), C8(197,8),
- C8(198,8), C8(199,8), C8(200,8), C8(201,8), C8(202,8), C8(203,8),
- C8(204,8), C8(205,8), C8(206,8), C8(207,8), C8(208,8), C8(209,8),
- C8(210,8), C8(211,8), C8(212,8), C8(213,8), C8(214,8), C8(215,8),
- C8(216,8), C8(217,8), C8(218,8), C8(219,8), C8(220,8), C8(221,8),
- C8(222,8), C8(223,8), C8(224,8), C8(225,8), C8(226,8), C8(227,8),
- C8(228,8), C8(229,8), C8(230,8), C8(231,8), C8(232,8), C8(233,8),
- C8(234,8), C8(235,8), C8(236,8), C8(237,8), C8(238,8), C8(239,8),
- C8(240,8), C8(241,8), C8(242,8), C8(243,8), C8(244,8), C8(245,8),
- C8(246,8), C8(247,8), C8(248,8), C8(249,8), C8(250,8), C8(251,8),
- C8(252,8), C8(253,8), C8(254,8), C8(255,8),
-};
-static const pixman_bits_t icStipple4Bits[16] = {
- C4( 0,16), C4( 1,16), C4( 2,16), C4( 3,16), C4( 4,16), C4( 5,16),
- C4( 6,16), C4( 7,16), C4( 8,16), C4( 9,16), C4( 10,16), C4( 11,16),
- C4( 12,16), C4( 13,16), C4( 14,16), C4( 15,16),};
-static const pixman_bits_t icStipple2Bits[4] = {
- C2( 0,32), C2( 1,32), C2( 2,32), C2( 3,32),
-};
-#define icStipple1Bits 0
-#endif
-
-const pixman_bits_t *
-IcStippleTable(int bits)
-{
- switch (bits) {
- case 1:
- return icStipple1Bits;
- case 2:
- return icStipple2Bits;
- case 4:
- return icStipple4Bits;
- case 8:
- return icStipple8Bits;
- }
- return 0;
-}
diff --git a/pixman/src/pixman-xserver-compat.h b/pixman/src/pixman-xserver-compat.h
deleted file mode 100644
index 6ee83737a..000000000
--- a/pixman/src/pixman-xserver-compat.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright Β© 2005 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of Red Hat,
- * Inc. not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Red Hat, Inc. makes no representations about the
- * suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Carl Worth, Red Hat, Inc.
- */
-
-#ifndef _PIXMAN_XSERVER_COMPAT_H_
-#define _PIXMAN_XSERVER_COMPAT_H_
-
-/* This is a compatibility header file, designed to make it easier to
- * synchronize files between libpixman and the xserver repository.
- *
- * Of course, long-term we would instead like to have the X server
- * depend on libpixman to eliminate the code duplication. But for now,
- * we at least make it easy to share files.
- *
- * The libpixman code base regards the xserver repository as canonical
- * for any shared files, so changes should be pushed up there. Then,
- * to merge changes back down into libpixman, the process should be to
- * simply copy the file and to replace the block of include directives
- * with:
- *
- * #include "pixman-xserver-compat.h"
- */
-
-/* First, include the primary internal header file for libpixman. */
-
-#include "icint.h"
-
-/* Then, define any names that the server code will be expecting in
- * terms of libpixman names. */
-
-typedef uint8_t CARD8;
-typedef uint16_t CARD16;
-typedef int16_t INT16;
-
-typedef int Bool;
-#define FALSE 0
-#define TRUE 1
-
-typedef pixman_bits_t FbBits;
-typedef pixman_image_t* PicturePtr;
-typedef pixman_box16_t BoxRec;
-typedef pixman_box16_t* BoxPtr;
-
-typedef pixman_point_fixed_t xPointFixed;
-typedef pixman_line_fixed_t xLineFixed;
-typedef pixman_trapezoid_t xTrapezoid;
-typedef pixman_triangle_t xTriangle;
-
-#define RENDER 1
-#define FB_SHIFT IC_SHIFT
-#define FB_MASK IC_MASK
-#define FB_ALLONES IC_ALLONES
-#define FbMaskBits IcMaskBits
-
-/* XXX: We changed some function and field names which makes for some
- * ugly hacks... */
-#define pDrawable pixels
-#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
- (buf) = (pDrawable)->data; \
- (stride) = ((int) pDrawable->stride) / sizeof (pixman_bits_t); \
- (bpp) = (pDrawable)->bpp; \
- (xoff) = 0; \
- (yoff) = 0; \
-}
-
-/* Then, include any header files that have been copied directly
- * from xserver. */
-
-#include "renderedge.h"
-
-/* And finally, this one prototype must come after the include of
- * renderedge.h, so it can't live alongside the other prototypes in
- * the horrible mess that is icint.h.
- */
-
-pixman_private void
-fbRasterizeEdges (pixman_bits_t *buf,
- int bpp,
- int width,
- int stride,
- RenderEdge *l,
- RenderEdge *r,
- pixman_fixed16_16_t t,
- pixman_fixed16_16_t b);
-
-
-#endif
diff --git a/pixman/src/pixman.h b/pixman/src/pixman.h
deleted file mode 100644
index b7f4ba3ee..000000000
--- a/pixman/src/pixman.h
+++ /dev/null
@@ -1,476 +0,0 @@
-#ifndef _PIXMAN_H_
-#define _PIXMAN_H_
-
-
-/* pixman.h - a merge of pixregion.h and ic.h */
-
-
-/* from pixregion.h */
-
-
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-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
-OPEN GROUP 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.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Id: pixman.h,v 1.19 2005-03-29 19:45:52 tor Exp $ */
-
-/* libic.h */
-
-/*
- * Copyright Β© 1998 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-
-#if defined (__SVR4) && defined (__sun)
-# include <sys/int_types.h>
-#else
-# if defined (__OpenBSD__) || defined (_AIX)
-# include <inttypes.h>
-# else
-# include <stdint.h>
-# endif
-#endif
-
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/* pixregion.h */
-
-typedef struct pixman_region16 pixman_region16_t;
-
-typedef struct pixman_box16 {
- short x1, y1, x2, y2;
-} pixman_box16_t;
-
-typedef enum {
- PIXMAN_REGION_STATUS_FAILURE,
- PIXMAN_REGION_STATUS_SUCCESS
-} pixman_region_status_t;
-
-/* creation/destruction */
-
-pixman_region16_t *
-pixman_region_create (void);
-
-pixman_region16_t *
-pixman_region_create_simple (pixman_box16_t *extents);
-
-void
-pixman_region_destroy (pixman_region16_t *region);
-
-/* manipulation */
-
-void
-pixman_region_translate (pixman_region16_t *region, int x, int y);
-
-pixman_region_status_t
-pixman_region_copy (pixman_region16_t *dest, pixman_region16_t *source);
-
-pixman_region_status_t
-pixman_region_intersect (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_region16_t *reg2);
-
-pixman_region_status_t
-pixman_region_union (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_region16_t *reg2);
-
-pixman_region_status_t
-pixman_region_union_rect(pixman_region16_t *dest, pixman_region16_t *source,
- int x, int y, unsigned int width, unsigned int height);
-
-pixman_region_status_t
-pixman_region_subtract (pixman_region16_t *regD, pixman_region16_t *regM, pixman_region16_t *regS);
-
-pixman_region_status_t
-pixman_region_inverse (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_box16_t *invRect);
-
-/* XXX: Need to fix this so it doesn't depend on an X data structure
-pixman_region16_t *
-RectsTopixman_region16_t (int nrects, xRectanglePtr prect, int ctype);
-*/
-
-/* querying */
-
-/* XXX: These should proably be combined: pixman_region_get_rects? */
-int
-pixman_region_num_rects (pixman_region16_t *region);
-
-pixman_box16_t *
-pixman_region_rects (pixman_region16_t *region);
-
-/* XXX: Change to an enum */
-#define rgnOUT 0
-#define rgnIN 1
-#define rgnPART 2
-
-int
-pixman_region_contains_point (pixman_region16_t *region, int x, int y, pixman_box16_t *box);
-
-int
-pixman_region_contains_rectangle (pixman_region16_t *pixman_region16_t, pixman_box16_t *prect);
-
-int
-pixman_region_not_empty (pixman_region16_t *region);
-
-pixman_box16_t *
-pixman_region_extents (pixman_region16_t *region);
-
-/* mucking around */
-
-/* WARNING: calling pixman_region_append may leave dest as an invalid
- region. Follow-up with pixman_region_validate to fix it up. */
-pixman_region_status_t
-pixman_region_append (pixman_region16_t *dest, pixman_region16_t *region);
-
-pixman_region_status_t
-pixman_region_validate (pixman_region16_t *badreg, int *pOverlap);
-
-/* Unclassified functionality
- * XXX: Do all of these need to be exported?
- */
-
-void
-pixman_region_reset (pixman_region16_t *region, pixman_box16_t *pBox);
-
-void
-pixman_region_empty (pixman_region16_t *region);
-
-
-/* ic.h */
-
-
-/* icformat.c */
-typedef enum pixman_operator {
- PIXMAN_OPERATOR_CLEAR,
- PIXMAN_OPERATOR_SRC,
- PIXMAN_OPERATOR_DST,
- PIXMAN_OPERATOR_OVER,
- PIXMAN_OPERATOR_OVER_REVERSE,
- PIXMAN_OPERATOR_IN,
- PIXMAN_OPERATOR_IN_REVERSE,
- PIXMAN_OPERATOR_OUT,
- PIXMAN_OPERATOR_OUT_REVERSE,
- PIXMAN_OPERATOR_ATOP,
- PIXMAN_OPERATOR_ATOP_REVERSE,
- PIXMAN_OPERATOR_XOR,
- PIXMAN_OPERATOR_ADD,
- PIXMAN_OPERATOR_SATURATE
-} pixman_operator_t;
-
-typedef enum pixman_format_name {
- PIXMAN_FORMAT_NAME_ARGB32,
- PIXMAN_FORMAT_NAME_RGB24,
- PIXMAN_FORMAT_NAME_A8,
- PIXMAN_FORMAT_NAME_A1
-} pixman_format_name_t;
-
-typedef struct pixman_format pixman_format_t;
-
-pixman_format_t *
-pixman_format_create (pixman_format_name_t name);
-
-pixman_format_t *
-pixman_format_create_masks (int bpp,
- int alpha_mask,
- int red_mask,
- int green_mask,
- int blue_mask);
-
-void
-pixman_format_destroy (pixman_format_t *format);
-
-void
-pixman_format_get_masks (pixman_format_t *format,
- int *bpp,
- int *alpha_mask,
- int *red_mask,
- int *green_mask,
- int *blue_mask);
-
-/* icimage.c */
-
-typedef struct pixman_image pixman_image_t;
-
-pixman_image_t *
-pixman_image_create (pixman_format_t *format,
- int width,
- int height);
-
-/*
- * This single define controls the basic size of data manipulated
- * by this software; it must be log2(sizeof (pixman_bits_t) * 8)
- */
-
-/* We use a 32-bit size on all platforms, (even those with native 64
- * bit types). This is consistent with the code currently in the X
- * server, so it goes through much more well-tested code paths, (we
- * saw rendering bugs when we tried IC_SHIFT==6 and uint64_t for
- * pixman_bits_t on 64-bit platofrms). In addition, Keith says that
- * his testing indicates that using 32-bits everywhere is a
- * performance win in any case, (presumably due to 32-bit datapaths
- * between the processor and the video card).
-*/
-#ifndef IC_SHIFT
-#define IC_SHIFT 5
-typedef uint32_t pixman_bits_t;
-#endif
-
-pixman_image_t *
-pixman_image_create_for_data (pixman_bits_t *data,
- pixman_format_t *format,
- int width, int height,
- int bpp, int stride);
-
-void
-pixman_image_destroy (pixman_image_t *image);
-
-int
-pixman_image_set_clip_region (pixman_image_t *image,
- pixman_region16_t *region);
-
-typedef int pixman_fixed16_16_t;
-
-typedef struct pixman_point_fixed {
- pixman_fixed16_16_t x, y;
-} pixman_point_fixed_t;
-
-typedef struct pixman_line_fixed {
- pixman_point_fixed_t p1, p2;
-} pixman_line_fixed_t;
-
-/* XXX: It's goofy that pixman_rectangle_t has integers while all the other
- datatypes have fixed-point values. (Though by design,
- pixman_fill_rectangles is designed to fill only whole pixels) */
-typedef struct pixman_rectangle {
- short x, y;
- unsigned short width, height;
-} pixman_rectangle_t;
-
-typedef struct pixman_triangle {
- pixman_point_fixed_t p1, p2, p3;
-} pixman_triangle_t;
-
-typedef struct pixman_trapezoid {
- pixman_fixed16_16_t top, bottom;
- pixman_line_fixed_t left, right;
-} pixman_trapezoid_t;
-
-typedef struct pixman_vector {
- pixman_fixed16_16_t vector[3];
-} pixman_vector_t;
-
-typedef struct pixman_transform {
- pixman_fixed16_16_t matrix[3][3];
-} pixman_transform_t;
-
-typedef enum {
- PIXMAN_FILTER_FAST,
- PIXMAN_FILTER_GOOD,
- PIXMAN_FILTER_BEST,
- PIXMAN_FILTER_NEAREST,
- PIXMAN_FILTER_BILINEAR
-} pixman_filter_t;
-
-void
-pixman_image_set_component_alpha (pixman_image_t *image,
- int component_alpha);
-
-int
-pixman_image_set_transform (pixman_image_t *image,
- pixman_transform_t *transform);
-
-void
-pixman_image_set_repeat (pixman_image_t *image,
- int repeat);
-
-void
-pixman_image_set_filter (pixman_image_t *image,
- pixman_filter_t filter);
-
-int
-pixman_image_get_width (pixman_image_t *image);
-
-int
-pixman_image_get_height (pixman_image_t *image);
-
-int
-pixman_image_get_stride (pixman_image_t *image);
-
-int
-pixman_image_get_depth (pixman_image_t *image);
-
-pixman_format_t *
-pixman_image_get_format (pixman_image_t *image);
-
-pixman_bits_t *
-pixman_image_get_data (pixman_image_t *image);
-
-/* iccolor.c */
-
-/* XXX: Do we really need a struct here? Only pixman_rectangle_t uses this. */
-typedef struct pixman_color {
- unsigned short red;
- unsigned short green;
- unsigned short blue;
- unsigned short alpha;
-} pixman_color_t;
-
-void
-pixman_color_to_pixel (const pixman_format_t *format,
- const pixman_color_t *color,
- pixman_bits_t *pixel);
-
-void
-pixman_pixel_to_color (const pixman_format_t *format,
- pixman_bits_t pixel,
- pixman_color_t *color);
-
-/* icrect.c */
-
-void
-pixman_fill_rectangle (pixman_operator_t op,
- pixman_image_t *dst,
- const pixman_color_t *color,
- int x,
- int y,
- unsigned int width,
- unsigned int height);
-
-void
-pixman_fill_rectangles (pixman_operator_t op,
- pixman_image_t *dst,
- const pixman_color_t *color,
- const pixman_rectangle_t *rects,
- int nRects);
-
-/* ictrap.c */
-
-void
-pixman_composite_trapezoids (pixman_operator_t op,
- pixman_image_t *src,
- pixman_image_t *dst,
- int xSrc,
- int ySrc,
- const pixman_trapezoid_t *traps,
- int ntrap);
-
-void
-pixman_add_trapezoids (pixman_image_t *dst,
- int x_off,
- int y_off,
- const pixman_trapezoid_t *traps,
- int ntraps);
-
-/* ictri.c */
-
-void
-pixman_composite_triangles (pixman_operator_t op,
- pixman_image_t *src,
- pixman_image_t *dst,
- int xSrc,
- int ySrc,
- const pixman_triangle_t *tris,
- int ntris);
-
-void
-pixman_composite_tri_strip (pixman_operator_t op,
- pixman_image_t *src,
- pixman_image_t *dst,
- int xSrc,
- int ySrc,
- const pixman_point_fixed_t *points,
- int npoints);
-
-
-void
-pixman_composite_tri_fan (pixman_operator_t op,
- pixman_image_t *src,
- pixman_image_t *dst,
- int xSrc,
- int ySrc,
- const pixman_point_fixed_t *points,
- int npoints);
-
-/* ic.c */
-
-void
-pixman_composite (pixman_operator_t op,
- pixman_image_t *iSrc,
- pixman_image_t *iMask,
- pixman_image_t *iDst,
- int xSrc,
- int ySrc,
- int xMask,
- int yMask,
- int xDst,
- int yDst,
- int width,
- int height);
-
-
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _PIXMAN_H_ */
diff --git a/pixman/src/pixregion.c b/pixman/src/pixregion.c
deleted file mode 100644
index 2a03d2ea0..000000000
--- a/pixman/src/pixregion.c
+++ /dev/null
@@ -1,2547 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1988, 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-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
-OPEN GROUP 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.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987, 1988, 1989 by
-Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#include <stdlib.h>
-#include <limits.h>
-#include <string.h>
-
-#include "pixregionint.h"
-#include "slim_internal.h"
-
-#if defined (__GNUC__) && !defined (NO_INLINES)
-#define INLINE __inline
-#else
-#define INLINE
-#endif
-
-#undef assert
-#ifdef DEBUG
-#define assert(expr) {if (!(expr)) \
- FatalError("Assertion failed file %s, line %d: expr\n", \
- __FILE__, __LINE__); }
-#else
-#define assert(expr)
-#endif
-
-#define good(reg) assert(pixman_region16_valid(reg))
-
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
-static pixman_box16_t pixman_region_emptyBox = {0, 0, 0, 0};
-static pixman_region16_data_t pixman_region_emptyData = {0, 0};
-
-static pixman_region16_data_t pixman_brokendata = {0, 0};
-static pixman_region16_t pixman_brokenregion = { { 0, 0, 0, 0 }, &pixman_brokendata };
-
-static pixman_region_status_t
-pixman_break (pixman_region16_t *pReg);
-
-static void
-pixman_init (pixman_region16_t *region, pixman_box16_t *rect);
-
-static void
-pixman_uninit (pixman_region16_t *region);
-
-slim_hidden_proto(pixman_region_create_simple)
-slim_hidden_proto(pixman_region_copy)
-slim_hidden_proto(pixman_region_union)
-
-/*
- * The functions in this file implement the Region abstraction used extensively
- * throughout the X11 sample server. A Region is simply a set of disjoint
- * (non-overlapping) rectangles, plus an "extent" rectangle which is the
- * smallest single rectangle that contains all the non-overlapping rectangles.
- *
- * A Region is implemented as a "y-x-banded" array of rectangles. This array
- * imposes two degrees of order. First, all rectangles are sorted by top side
- * y coordinate first (y1), and then by left side x coordinate (x1).
- *
- * Furthermore, the rectangles are grouped into "bands". Each rectangle in a
- * band has the same top y coordinate (y1), and each has the same bottom y
- * coordinate (y2). Thus all rectangles in a band differ only in their left
- * and right side (x1 and x2). Bands are implicit in the array of rectangles:
- * there is no separate list of band start pointers.
- *
- * The y-x band representation does not minimize rectangles. In particular,
- * if a rectangle vertically crosses a band (the rectangle has scanlines in
- * the y1 to y2 area spanned by the band), then the rectangle may be broken
- * down into two or more smaller rectangles stacked one atop the other.
- *
- * ----------- -----------
- * | | | | band 0
- * | | -------- ----------- --------
- * | | | | in y-x banded | | | | band 1
- * | | | | form is | | | |
- * ----------- | | ----------- --------
- * | | | | band 2
- * -------- --------
- *
- * An added constraint on the rectangles is that they must cover as much
- * horizontal area as possible: no two rectangles within a band are allowed
- * to touch.
- *
- * Whenever possible, bands will be merged together to cover a greater vertical
- * distance (and thus reduce the number of rectangles). Two bands can be merged
- * only if the bottom of one touches the top of the other and they have
- * rectangles in the same places (of the same width, of course).
- *
- * Adam de Boor wrote most of the original region code. Joel McCormack
- * substantially modified or rewrote most of the core arithmetic routines, and
- * added pixman_region_validate in order to support several speed improvements to
- * pixman_region_validateTree. Bob Scheifler changed the representation to be more
- * compact when empty or a single rectangle, and did a bunch of gratuitous
- * reformatting. Carl Worth did further gratuitous reformatting while re-merging
- * the server and client region code into libpixregion.
- */
-
-/* true iff two Boxes overlap */
-#define EXTENTCHECK(r1,r2) \
- (!( ((r1)->x2 <= (r2)->x1) || \
- ((r1)->x1 >= (r2)->x2) || \
- ((r1)->y2 <= (r2)->y1) || \
- ((r1)->y1 >= (r2)->y2) ) )
-
-/* true iff (x,y) is in Box */
-#define INBOX(r,x,y) \
- ( ((r)->x2 > x) && \
- ((r)->x1 <= x) && \
- ((r)->y2 > y) && \
- ((r)->y1 <= y) )
-
-/* true iff Box r1 contains Box r2 */
-#define SUBSUMES(r1,r2) \
- ( ((r1)->x1 <= (r2)->x1) && \
- ((r1)->x2 >= (r2)->x2) && \
- ((r1)->y1 <= (r2)->y1) && \
- ((r1)->y2 >= (r2)->y2) )
-
-#define allocData(n) malloc(PIXREGION_SZOF(n))
-#define freeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
-
-#define RECTALLOC_BAIL(pReg,n,bail) \
-if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
- if (!pixman_rect_alloc(pReg, n)) { goto bail; }
-
-#define RECTALLOC(pReg,n) \
-if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
- if (!pixman_rect_alloc(pReg, n)) { return PIXMAN_REGION_STATUS_FAILURE; }
-
-#define ADDRECT(pNextRect,nx1,ny1,nx2,ny2) \
-{ \
- pNextRect->x1 = nx1; \
- pNextRect->y1 = ny1; \
- pNextRect->x2 = nx2; \
- pNextRect->y2 = ny2; \
- pNextRect++; \
-}
-
-#define NEWRECT(pReg,pNextRect,nx1,ny1,nx2,ny2) \
-{ \
- if (!(pReg)->data || ((pReg)->data->numRects == (pReg)->data->size))\
- { \
- if (!pixman_rect_alloc(pReg, 1)) \
- return PIXMAN_REGION_STATUS_FAILURE; \
- pNextRect = PIXREGION_TOP(pReg); \
- } \
- ADDRECT(pNextRect,nx1,ny1,nx2,ny2); \
- pReg->data->numRects++; \
- assert(pReg->data->numRects<=pReg->data->size); \
-}
-
-
-#define DOWNSIZE(reg,numRects) \
-if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
-{ \
- pixman_region16_data_t * NewData; \
- NewData = (pixman_region16_data_t *)realloc((reg)->data, PIXREGION_SZOF(numRects)); \
- if (NewData) \
- { \
- NewData->size = (numRects); \
- (reg)->data = NewData; \
- } \
-}
-
-
-#ifdef DEBUG
-int
-pixman_region16_print(rgn)
- pixman_region16_t * rgn;
-{
- int num, size;
- int i;
- pixman_box16_t * rects;
-
- num = PIXREGION_NUM_RECTS(rgn);
- size = PIXREGION_SIZE(rgn);
- rects = PIXREGION_RECTS(rgn);
- ErrorF("num: %d size: %d\n", num, size);
- ErrorF("extents: %d %d %d %d\n",
- rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2);
- for (i = 0; i < num; i++)
- ErrorF("%d %d %d %d \n",
- rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);
- ErrorF("\n");
- return(num);
-}
-
-
-pixman_region_status_t
-pixman_region16_tsEqual(reg1, reg2)
- pixman_region16_t * reg1;
- pixman_region16_t * reg2;
-{
- int i;
- pixman_box16_t * rects1, rects2;
-
- if (reg1->extents.x1 != reg2->extents.x1) return PIXMAN_REGION_STATUS_FAILURE;
- if (reg1->extents.x2 != reg2->extents.x2) return PIXMAN_REGION_STATUS_FAILURE;
- if (reg1->extents.y1 != reg2->extents.y1) return PIXMAN_REGION_STATUS_FAILURE;
- if (reg1->extents.y2 != reg2->extents.y2) return PIXMAN_REGION_STATUS_FAILURE;
- if (PIXREGION_NUM_RECTS(reg1) != PIXREGION_NUM_RECTS(reg2)) return PIXMAN_REGION_STATUS_FAILURE;
-
- rects1 = PIXREGION_RECTS(reg1);
- rects2 = PIXREGION_RECTS(reg2);
- for (i = 0; i != PIXREGION_NUM_RECTS(reg1); i++) {
- if (rects1[i].x1 != rects2[i].x1) return PIXMAN_REGION_STATUS_FAILURE;
- if (rects1[i].x2 != rects2[i].x2) return PIXMAN_REGION_STATUS_FAILURE;
- if (rects1[i].y1 != rects2[i].y1) return PIXMAN_REGION_STATUS_FAILURE;
- if (rects1[i].y2 != rects2[i].y2) return PIXMAN_REGION_STATUS_FAILURE;
- }
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-pixman_region_status_t
-pixman_region16_valid(reg)
- pixman_region16_t * reg;
-{
- int i, numRects;
-
- if ((reg->extents.x1 > reg->extents.x2) ||
- (reg->extents.y1 > reg->extents.y2))
- return PIXMAN_REGION_STATUS_FAILURE;
- numRects = PIXREGION_NUM_RECTS(reg);
- if (!numRects)
- return ((reg->extents.x1 == reg->extents.x2) &&
- (reg->extents.y1 == reg->extents.y2) &&
- (reg->data->size || (reg->data == &pixman_region_emptyData)));
- else if (numRects == 1)
- return (!reg->data);
- else
- {
- pixman_box16_t * pboxP, pboxN;
- pixman_box16_t box;
-
- pboxP = PIXREGION_RECTS(reg);
- box = *pboxP;
- box.y2 = pboxP[numRects-1].y2;
- pboxN = pboxP + 1;
- for (i = numRects; --i > 0; pboxP++, pboxN++)
- {
- if ((pboxN->x1 >= pboxN->x2) ||
- (pboxN->y1 >= pboxN->y2))
- return PIXMAN_REGION_STATUS_FAILURE;
- if (pboxN->x1 < box.x1)
- box.x1 = pboxN->x1;
- if (pboxN->x2 > box.x2)
- box.x2 = pboxN->x2;
- if ((pboxN->y1 < pboxP->y1) ||
- ((pboxN->y1 == pboxP->y1) &&
- ((pboxN->x1 < pboxP->x2) || (pboxN->y2 != pboxP->y2))))
- return PIXMAN_REGION_STATUS_FAILURE;
- }
- return ((box.x1 == reg->extents.x1) &&
- (box.x2 == reg->extents.x2) &&
- (box.y1 == reg->extents.y1) &&
- (box.y2 == reg->extents.y2));
- }
-}
-
-#endif /* DEBUG */
-
-
-/* Create a new empty region */
-pixman_region16_t *
-pixman_region_create (void)
-{
- return pixman_region_create_simple (NULL);
-}
-
-/*****************************************************************
- * pixman_region_create_simple (extents)
- * This routine creates a pixman_region16_t for a simple
- * rectangular region.
- *****************************************************************/
-pixman_region16_t *
-pixman_region_create_simple (pixman_box16_t *extents)
-{
- pixman_region16_t *region;
-
- region = malloc (sizeof (pixman_region16_t));
- if (region == NULL)
- return &pixman_brokenregion;
-
- pixman_init (region, extents);
-
- return region;
-}
-slim_hidden_def(pixman_region_create_simple);
-
-/*****************************************************************
- * RegionInit(pReg, rect, size)
- * Outer region rect is statically allocated.
- *****************************************************************/
-
-static void
-pixman_init(pixman_region16_t *region, pixman_box16_t *extents)
-{
- if (extents)
- {
- region->extents = *extents;
- region->data = NULL;
- }
- else
- {
- region->extents = pixman_region_emptyBox;
- region->data = &pixman_region_emptyData;
- }
-}
-
-static void
-pixman_uninit (pixman_region16_t *region)
-{
- good (region);
- freeData (region);
-}
-
-void
-pixman_region_destroy (pixman_region16_t *region)
-{
- pixman_uninit (region);
-
- if (region != &pixman_brokenregion)
- free (region);
-}
-
-int
-pixman_region_num_rects (pixman_region16_t *region)
-{
- return PIXREGION_NUM_RECTS (region);
-}
-
-pixman_box16_t *
-pixman_region_rects (pixman_region16_t *region)
-{
- return PIXREGION_RECTS (region);
-}
-
-static pixman_region_status_t
-pixman_break (pixman_region16_t *region)
-{
- freeData (region);
- region->extents = pixman_region_emptyBox;
- region->data = &pixman_brokendata;
- return PIXMAN_REGION_STATUS_FAILURE;
-}
-
-static pixman_region_status_t
-pixman_rect_alloc(pixman_region16_t * region, int n)
-{
- pixman_region16_data_t *data;
-
- if (!region->data)
- {
- n++;
- region->data = allocData(n);
- if (!region->data)
- return pixman_break (region);
- region->data->numRects = 1;
- *PIXREGION_BOXPTR(region) = region->extents;
- }
- else if (!region->data->size)
- {
- region->data = allocData(n);
- if (!region->data)
- return pixman_break (region);
- region->data->numRects = 0;
- }
- else
- {
- if (n == 1)
- {
- n = region->data->numRects;
- if (n > 500) /* XXX pick numbers out of a hat */
- n = 250;
- }
- n += region->data->numRects;
- data = (pixman_region16_data_t *)realloc(region->data, PIXREGION_SZOF(n));
- if (!data)
- return pixman_break (region);
- region->data = data;
- }
- region->data->size = n;
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-pixman_region_status_t
-pixman_region_copy(pixman_region16_t *dst, pixman_region16_t *src)
-{
- good(dst);
- good(src);
- if (dst == src)
- return PIXMAN_REGION_STATUS_SUCCESS;
- dst->extents = src->extents;
- if (!src->data || !src->data->size)
- {
- freeData(dst);
- dst->data = src->data;
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
- if (!dst->data || (dst->data->size < src->data->numRects))
- {
- freeData(dst);
- dst->data = allocData(src->data->numRects);
- if (!dst->data)
- return pixman_break (dst);
- dst->data->size = src->data->numRects;
- }
- dst->data->numRects = src->data->numRects;
- memmove((char *)PIXREGION_BOXPTR(dst),(char *)PIXREGION_BOXPTR(src),
- dst->data->numRects * sizeof(pixman_box16_t));
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-slim_hidden_def(pixman_region_copy);
-
-
-/*======================================================================
- * Generic Region Operator
- *====================================================================*/
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_coalesce --
- * Attempt to merge the boxes in the current band with those in the
- * previous one. We are guaranteed that the current band extends to
- * the end of the rects array. Used only by pixman_op.
- *
- * Results:
- * The new index for the previous band.
- *
- * Side Effects:
- * If coalescing takes place:
- * - rectangles in the previous band will have their y2 fields
- * altered.
- * - region->data->numRects will be decreased.
- *
- *-----------------------------------------------------------------------
- */
-INLINE static int
-pixman_coalesce (
- pixman_region16_t * region, /* Region to coalesce */
- int prevStart, /* Index of start of previous band */
- int curStart) /* Index of start of current band */
-{
- pixman_box16_t * pPrevBox; /* Current box in previous band */
- pixman_box16_t * pCurBox; /* Current box in current band */
- int numRects; /* Number rectangles in both bands */
- int y2; /* Bottom of current band */
- /*
- * Figure out how many rectangles are in the band.
- */
- numRects = curStart - prevStart;
- assert(numRects == region->data->numRects - curStart);
-
- if (!numRects) return curStart;
-
- /*
- * The bands may only be coalesced if the bottom of the previous
- * matches the top scanline of the current.
- */
- pPrevBox = PIXREGION_BOX(region, prevStart);
- pCurBox = PIXREGION_BOX(region, curStart);
- if (pPrevBox->y2 != pCurBox->y1) return curStart;
-
- /*
- * Make sure the bands have boxes in the same places. This
- * assumes that boxes have been added in such a way that they
- * cover the most area possible. I.e. two boxes in a band must
- * have some horizontal space between them.
- */
- y2 = pCurBox->y2;
-
- do {
- if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) {
- return (curStart);
- }
- pPrevBox++;
- pCurBox++;
- numRects--;
- } while (numRects);
-
- /*
- * The bands may be merged, so set the bottom y of each box
- * in the previous band to the bottom y of the current band.
- */
- numRects = curStart - prevStart;
- region->data->numRects -= numRects;
- do {
- pPrevBox--;
- pPrevBox->y2 = y2;
- numRects--;
- } while (numRects);
- return prevStart;
-}
-
-
-/* Quicky macro to avoid trivial reject procedure calls to pixman_coalesce */
-
-#define Coalesce(newReg, prevBand, curBand) \
- if (curBand - prevBand == newReg->data->numRects - curBand) { \
- prevBand = pixman_coalesce(newReg, prevBand, curBand); \
- } else { \
- prevBand = curBand; \
- }
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_appendNonO --
- * Handle a non-overlapping band for the union and subtract operations.
- * Just adds the (top/bottom-clipped) rectangles into the region.
- * Doesn't have to check for subsumption or anything.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * region->data->numRects is incremented and the rectangles overwritten
- * with the rectangles we're passed.
- *
- *-----------------------------------------------------------------------
- */
-
-INLINE static pixman_region_status_t
-pixman_region_appendNonO (
- pixman_region16_t * region,
- pixman_box16_t * r,
- pixman_box16_t * rEnd,
- int y1,
- int y2)
-{
- pixman_box16_t * pNextRect;
- int newRects;
-
- newRects = rEnd - r;
-
- assert(y1 < y2);
- assert(newRects != 0);
-
- /* Make sure we have enough space for all rectangles to be added */
- RECTALLOC(region, newRects);
- pNextRect = PIXREGION_TOP(region);
- region->data->numRects += newRects;
- do {
- assert(r->x1 < r->x2);
- ADDRECT(pNextRect, r->x1, y1, r->x2, y2);
- r++;
- } while (r != rEnd);
-
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-#define FindBand(r, rBandEnd, rEnd, ry1) \
-{ \
- ry1 = r->y1; \
- rBandEnd = r+1; \
- while ((rBandEnd != rEnd) && (rBandEnd->y1 == ry1)) { \
- rBandEnd++; \
- } \
-}
-
-#define AppendRegions(newReg, r, rEnd) \
-{ \
- int newRects; \
- if ((newRects = rEnd - r)) { \
- RECTALLOC(newReg, newRects); \
- memmove((char *)PIXREGION_TOP(newReg),(char *)r, \
- newRects * sizeof(pixman_box16_t)); \
- newReg->data->numRects += newRects; \
- } \
-}
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_op --
- * Apply an operation to two regions. Called by pixman_region_union, pixman_region_inverse,
- * pixman_region_subtract, pixman_region_intersect.... Both regions MUST have at least one
- * rectangle, and cannot be the same object.
- *
- * Results:
- * PIXMAN_REGION_STATUS_SUCCESS if successful.
- *
- * Side Effects:
- * The new region is overwritten.
- * pOverlap set to PIXMAN_REGION_STATUS_SUCCESS if overlapFunc ever returns PIXMAN_REGION_STATUS_SUCCESS.
- *
- * Notes:
- * The idea behind this function is to view the two regions as sets.
- * Together they cover a rectangle of area that this function divides
- * into horizontal bands where points are covered only by one region
- * or by both. For the first case, the nonOverlapFunc is called with
- * each the band and the band's upper and lower extents. For the
- * second, the overlapFunc is called to process the entire band. It
- * is responsible for clipping the rectangles in the band, though
- * this function provides the boundaries.
- * At the end of each band, the new region is coalesced, if possible,
- * to reduce the number of rectangles in the region.
- *
- *-----------------------------------------------------------------------
- */
-
-typedef pixman_region_status_t (*OverlapProcPtr)(
- pixman_region16_t *region,
- pixman_box16_t *r1,
- pixman_box16_t *r1End,
- pixman_box16_t *r2,
- pixman_box16_t *r2End,
- short y1,
- short y2,
- int *pOverlap);
-
-static pixman_region_status_t
-pixman_op(
- pixman_region16_t * newReg, /* Place to store result */
- pixman_region16_t * reg1, /* First region in operation */
- pixman_region16_t * reg2, /* 2d region in operation */
- OverlapProcPtr overlapFunc, /* Function to call for over-
- * lapping bands */
- int appendNon1, /* Append non-overlapping bands */
- /* in region 1 ? */
- int appendNon2, /* Append non-overlapping bands */
- /* in region 2 ? */
- int *pOverlap)
-{
- pixman_box16_t * r1; /* Pointer into first region */
- pixman_box16_t * r2; /* Pointer into 2d region */
- pixman_box16_t * r1End; /* End of 1st region */
- pixman_box16_t * r2End; /* End of 2d region */
- short ybot; /* Bottom of intersection */
- short ytop; /* Top of intersection */
- pixman_region16_data_t * oldData; /* Old data for newReg */
- int prevBand; /* Index of start of
- * previous band in newReg */
- int curBand; /* Index of start of current
- * band in newReg */
- pixman_box16_t * r1BandEnd; /* End of current band in r1 */
- pixman_box16_t * r2BandEnd; /* End of current band in r2 */
- short top; /* Top of non-overlapping band */
- short bot; /* Bottom of non-overlapping band*/
- int r1y1; /* Temps for r1->y1 and r2->y1 */
- int r2y1;
- int newSize;
- int numRects;
-
- /*
- * Break any region computed from a broken region
- */
- if (PIXREGION_NAR (reg1) || PIXREGION_NAR(reg2))
- return pixman_break (newReg);
-
- /*
- * Initialization:
- * set r1, r2, r1End and r2End appropriately, save the rectangles
- * of the destination region until the end in case it's one of
- * the two source regions, then mark the "new" region empty, allocating
- * another array of rectangles for it to use.
- */
-
- r1 = PIXREGION_RECTS(reg1);
- newSize = PIXREGION_NUM_RECTS(reg1);
- r1End = r1 + newSize;
- numRects = PIXREGION_NUM_RECTS(reg2);
- r2 = PIXREGION_RECTS(reg2);
- r2End = r2 + numRects;
- assert(r1 != r1End);
- assert(r2 != r2End);
-
- oldData = (pixman_region16_data_t *)NULL;
- if (((newReg == reg1) && (newSize > 1)) ||
- ((newReg == reg2) && (numRects > 1)))
- {
- oldData = newReg->data;
- newReg->data = &pixman_region_emptyData;
- }
- /* guess at new size */
- if (numRects > newSize)
- newSize = numRects;
- newSize <<= 1;
- if (!newReg->data)
- newReg->data = &pixman_region_emptyData;
- else if (newReg->data->size)
- newReg->data->numRects = 0;
- if (newSize > newReg->data->size)
- if (!pixman_rect_alloc(newReg, newSize))
- return PIXMAN_REGION_STATUS_FAILURE;
-
- /*
- * Initialize ybot.
- * In the upcoming loop, ybot and ytop serve different functions depending
- * on whether the band being handled is an overlapping or non-overlapping
- * band.
- * In the case of a non-overlapping band (only one of the regions
- * has points in the band), ybot is the bottom of the most recent
- * intersection and thus clips the top of the rectangles in that band.
- * ytop is the top of the next intersection between the two regions and
- * serves to clip the bottom of the rectangles in the current band.
- * For an overlapping band (where the two regions intersect), ytop clips
- * the top of the rectangles of both regions and ybot clips the bottoms.
- */
-
- ybot = MIN(r1->y1, r2->y1);
-
- /*
- * prevBand serves to mark the start of the previous band so rectangles
- * can be coalesced into larger rectangles. qv. pixman_coalesce, above.
- * In the beginning, there is no previous band, so prevBand == curBand
- * (curBand is set later on, of course, but the first band will always
- * start at index 0). prevBand and curBand must be indices because of
- * the possible expansion, and resultant moving, of the new region's
- * array of rectangles.
- */
- prevBand = 0;
-
- do {
- /*
- * This algorithm proceeds one source-band (as opposed to a
- * destination band, which is determined by where the two regions
- * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the
- * rectangle after the last one in the current band for their
- * respective regions.
- */
- assert(r1 != r1End);
- assert(r2 != r2End);
-
- FindBand(r1, r1BandEnd, r1End, r1y1);
- FindBand(r2, r2BandEnd, r2End, r2y1);
-
- /*
- * First handle the band that doesn't intersect, if any.
- *
- * Note that attention is restricted to one band in the
- * non-intersecting region at once, so if a region has n
- * bands between the current position and the next place it overlaps
- * the other, this entire loop will be passed through n times.
- */
- if (r1y1 < r2y1) {
- if (appendNon1) {
- top = MAX(r1y1, ybot);
- bot = MIN(r1->y2, r2y1);
- if (top != bot) {
- curBand = newReg->data->numRects;
- pixman_region_appendNonO(newReg, r1, r1BandEnd, top, bot);
- Coalesce(newReg, prevBand, curBand);
- }
- }
- ytop = r2y1;
- } else if (r2y1 < r1y1) {
- if (appendNon2) {
- top = MAX(r2y1, ybot);
- bot = MIN(r2->y2, r1y1);
- if (top != bot) {
- curBand = newReg->data->numRects;
- pixman_region_appendNonO(newReg, r2, r2BandEnd, top, bot);
- Coalesce(newReg, prevBand, curBand);
- }
- }
- ytop = r1y1;
- } else {
- ytop = r1y1;
- }
-
- /*
- * Now see if we've hit an intersecting band. The two bands only
- * intersect if ybot > ytop
- */
- ybot = MIN(r1->y2, r2->y2);
- if (ybot > ytop) {
- curBand = newReg->data->numRects;
- (* overlapFunc)(newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot,
- pOverlap);
- Coalesce(newReg, prevBand, curBand);
- }
-
- /*
- * If we've finished with a band (y2 == ybot) we skip forward
- * in the region to the next band.
- */
- if (r1->y2 == ybot) r1 = r1BandEnd;
- if (r2->y2 == ybot) r2 = r2BandEnd;
-
- } while (r1 != r1End && r2 != r2End);
-
- /*
- * Deal with whichever region (if any) still has rectangles left.
- *
- * We only need to worry about banding and coalescing for the very first
- * band left. After that, we can just group all remaining boxes,
- * regardless of how many bands, into one final append to the list.
- */
-
- if ((r1 != r1End) && appendNon1) {
- /* Do first nonOverlap1Func call, which may be able to coalesce */
- FindBand(r1, r1BandEnd, r1End, r1y1);
- curBand = newReg->data->numRects;
- pixman_region_appendNonO(newReg, r1, r1BandEnd, MAX(r1y1, ybot), r1->y2);
- Coalesce(newReg, prevBand, curBand);
- /* Just append the rest of the boxes */
- AppendRegions(newReg, r1BandEnd, r1End);
-
- } else if ((r2 != r2End) && appendNon2) {
- /* Do first nonOverlap2Func call, which may be able to coalesce */
- FindBand(r2, r2BandEnd, r2End, r2y1);
- curBand = newReg->data->numRects;
- pixman_region_appendNonO(newReg, r2, r2BandEnd, MAX(r2y1, ybot), r2->y2);
- Coalesce(newReg, prevBand, curBand);
- /* Append rest of boxes */
- AppendRegions(newReg, r2BandEnd, r2End);
- }
-
- if (oldData)
- free(oldData);
-
- if (!(numRects = newReg->data->numRects))
- {
- freeData(newReg);
- newReg->data = &pixman_region_emptyData;
- }
- else if (numRects == 1)
- {
- newReg->extents = *PIXREGION_BOXPTR(newReg);
- freeData(newReg);
- newReg->data = (pixman_region16_data_t *)NULL;
- }
- else
- {
- DOWNSIZE(newReg, numRects);
- }
-
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_set_extents --
- * Reset the extents of a region to what they should be. Called by
- * pixman_region_subtract and pixman_region_intersect as they can't figure it out along the
- * way or do so easily, as pixman_region_union can.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The region's 'extents' structure is overwritten.
- *
- *-----------------------------------------------------------------------
- */
-static void
-pixman_set_extents (pixman_region16_t *region)
-{
- pixman_box16_t *box, *boxEnd;
-
- if (!region->data)
- return;
- if (!region->data->size)
- {
- region->extents.x2 = region->extents.x1;
- region->extents.y2 = region->extents.y1;
- return;
- }
-
- box = PIXREGION_BOXPTR(region);
- boxEnd = PIXREGION_END(region);
-
- /*
- * Since box is the first rectangle in the region, it must have the
- * smallest y1 and since boxEnd is the last rectangle in the region,
- * it must have the largest y2, because of banding. Initialize x1 and
- * x2 from box and boxEnd, resp., as good things to initialize them
- * to...
- */
- region->extents.x1 = box->x1;
- region->extents.y1 = box->y1;
- region->extents.x2 = boxEnd->x2;
- region->extents.y2 = boxEnd->y2;
-
- assert(region->extents.y1 < region->extents.y2);
- while (box <= boxEnd) {
- if (box->x1 < region->extents.x1)
- region->extents.x1 = box->x1;
- if (box->x2 > region->extents.x2)
- region->extents.x2 = box->x2;
- box++;
- };
-
- assert(region->extents.x1 < region->extents.x2);
-}
-
-/*======================================================================
- * Region Intersection
- *====================================================================*/
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_intersectO --
- * Handle an overlapping band for pixman_region_intersect.
- *
- * Results:
- * PIXMAN_REGION_STATUS_SUCCESS if successful.
- *
- * Side Effects:
- * Rectangles may be added to the region.
- *
- *-----------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static pixman_region_status_t
-pixman_region_intersectO (
- pixman_region16_t * region,
- pixman_box16_t * r1,
- pixman_box16_t * r1End,
- pixman_box16_t * r2,
- pixman_box16_t * r2End,
- short y1,
- short y2,
- int *pOverlap)
-{
- int x1;
- int x2;
- pixman_box16_t * pNextRect;
-
- pNextRect = PIXREGION_TOP(region);
-
- assert(y1 < y2);
- assert(r1 != r1End && r2 != r2End);
-
- do {
- x1 = MAX(r1->x1, r2->x1);
- x2 = MIN(r1->x2, r2->x2);
-
- /*
- * If there's any overlap between the two rectangles, add that
- * overlap to the new region.
- */
- if (x1 < x2)
- NEWRECT(region, pNextRect, x1, y1, x2, y2);
-
- /*
- * Advance the pointer(s) with the leftmost right side, since the next
- * rectangle on that list may still overlap the other region's
- * current rectangle.
- */
- if (r1->x2 == x2) {
- r1++;
- }
- if (r2->x2 == x2) {
- r2++;
- }
- } while ((r1 != r1End) && (r2 != r2End));
-
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-
-pixman_region_status_t
-pixman_region_intersect(newReg, reg1, reg2)
- pixman_region16_t * newReg; /* destination Region */
- pixman_region16_t * reg1;
- pixman_region16_t * reg2; /* source regions */
-{
- good(reg1);
- good(reg2);
- good(newReg);
- /* check for trivial reject */
- if (PIXREGION_NIL(reg1) || PIXREGION_NIL(reg2) ||
- !EXTENTCHECK(&reg1->extents, &reg2->extents))
- {
- /* Covers about 20% of all cases */
- freeData(newReg);
- newReg->extents.x2 = newReg->extents.x1;
- newReg->extents.y2 = newReg->extents.y1;
- if (PIXREGION_NAR(reg1) || PIXREGION_NAR(reg2))
- {
- newReg->data = &pixman_brokendata;
- return PIXMAN_REGION_STATUS_FAILURE;
- }
- else
- newReg->data = &pixman_region_emptyData;
- }
- else if (!reg1->data && !reg2->data)
- {
- /* Covers about 80% of cases that aren't trivially rejected */
- newReg->extents.x1 = MAX(reg1->extents.x1, reg2->extents.x1);
- newReg->extents.y1 = MAX(reg1->extents.y1, reg2->extents.y1);
- newReg->extents.x2 = MIN(reg1->extents.x2, reg2->extents.x2);
- newReg->extents.y2 = MIN(reg1->extents.y2, reg2->extents.y2);
- freeData(newReg);
- newReg->data = (pixman_region16_data_t *)NULL;
- }
- else if (!reg2->data && SUBSUMES(&reg2->extents, &reg1->extents))
- {
- return pixman_region_copy(newReg, reg1);
- }
- else if (!reg1->data && SUBSUMES(&reg1->extents, &reg2->extents))
- {
- return pixman_region_copy(newReg, reg2);
- }
- else if (reg1 == reg2)
- {
- return pixman_region_copy(newReg, reg1);
- }
- else
- {
- /* General purpose intersection */
- int overlap; /* result ignored */
- if (!pixman_op(newReg, reg1, reg2, pixman_region_intersectO, PIXMAN_REGION_STATUS_FAILURE, PIXMAN_REGION_STATUS_FAILURE,
- &overlap))
- return PIXMAN_REGION_STATUS_FAILURE;
- pixman_set_extents(newReg);
- }
-
- good(newReg);
- return(PIXMAN_REGION_STATUS_SUCCESS);
-}
-
-#define MERGERECT(r) \
-{ \
- if (r->x1 <= x2) { \
- /* Merge with current rectangle */ \
- if (r->x1 < x2) *pOverlap = PIXMAN_REGION_STATUS_SUCCESS; \
- if (x2 < r->x2) x2 = r->x2; \
- } else { \
- /* Add current rectangle, start new one */ \
- NEWRECT(region, pNextRect, x1, y1, x2, y2); \
- x1 = r->x1; \
- x2 = r->x2; \
- } \
- r++; \
-}
-
-/*======================================================================
- * Region Union
- *====================================================================*/
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_unionO --
- * Handle an overlapping band for the union operation. Picks the
- * left-most rectangle each time and merges it into the region.
- *
- * Results:
- * PIXMAN_REGION_STATUS_SUCCESS if successful.
- *
- * Side Effects:
- * region is overwritten.
- * pOverlap is set to PIXMAN_REGION_STATUS_SUCCESS if any boxes overlap.
- *
- *-----------------------------------------------------------------------
- */
-static pixman_region_status_t
-pixman_region_unionO (
- pixman_region16_t *region,
- pixman_box16_t *r1,
- pixman_box16_t *r1End,
- pixman_box16_t *r2,
- pixman_box16_t *r2End,
- short y1,
- short y2,
- int *pOverlap)
-{
- pixman_box16_t * pNextRect;
- int x1; /* left and right side of current union */
- int x2;
-
- assert (y1 < y2);
- assert(r1 != r1End && r2 != r2End);
-
- pNextRect = PIXREGION_TOP(region);
-
- /* Start off current rectangle */
- if (r1->x1 < r2->x1)
- {
- x1 = r1->x1;
- x2 = r1->x2;
- r1++;
- }
- else
- {
- x1 = r2->x1;
- x2 = r2->x2;
- r2++;
- }
- while (r1 != r1End && r2 != r2End)
- {
- if (r1->x1 < r2->x1) MERGERECT(r1) else MERGERECT(r2);
- }
-
- /* Finish off whoever (if any) is left */
- if (r1 != r1End)
- {
- do
- {
- MERGERECT(r1);
- } while (r1 != r1End);
- }
- else if (r2 != r2End)
- {
- do
- {
- MERGERECT(r2);
- } while (r2 != r2End);
- }
-
- /* Add current rectangle */
- NEWRECT(region, pNextRect, x1, y1, x2, y2);
-
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-/* Convenience function for performing union of region with a single rectangle */
-pixman_region_status_t
-pixman_region_union_rect(pixman_region16_t *dest, pixman_region16_t *source,
- int x, int y, unsigned int width, unsigned int height)
-{
- pixman_region16_t region;
-
- if (!width || !height)
- return PIXMAN_REGION_STATUS_FAILURE;
- region.data = NULL;
- region.extents.x1 = x;
- region.extents.y1 = y;
- region.extents.x2 = x + width;
- region.extents.y2 = y + height;
-
- return pixman_region_union (dest, source, &region);
-}
-
-pixman_region_status_t
-pixman_region_union(pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_region16_t *reg2)
-{
- int overlap; /* result ignored */
-
- /* Return PIXMAN_REGION_STATUS_SUCCESS if some overlap between reg1, reg2 */
- good(reg1);
- good(reg2);
- good(newReg);
- /* checks all the simple cases */
-
- /*
- * Region 1 and 2 are the same
- */
- if (reg1 == reg2)
- {
- return pixman_region_copy(newReg, reg1);
- }
-
- /*
- * Region 1 is empty
- */
- if (PIXREGION_NIL(reg1))
- {
- if (PIXREGION_NAR(reg1))
- return pixman_break (newReg);
- if (newReg != reg2)
- return pixman_region_copy(newReg, reg2);
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
-
- /*
- * Region 2 is empty
- */
- if (PIXREGION_NIL(reg2))
- {
- if (PIXREGION_NAR(reg2))
- return pixman_break (newReg);
- if (newReg != reg1)
- return pixman_region_copy(newReg, reg1);
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
-
- /*
- * Region 1 completely subsumes region 2
- */
- if (!reg1->data && SUBSUMES(&reg1->extents, &reg2->extents))
- {
- if (newReg != reg1)
- return pixman_region_copy(newReg, reg1);
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
-
- /*
- * Region 2 completely subsumes region 1
- */
- if (!reg2->data && SUBSUMES(&reg2->extents, &reg1->extents))
- {
- if (newReg != reg2)
- return pixman_region_copy(newReg, reg2);
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
-
- if (!pixman_op(newReg, reg1, reg2, pixman_region_unionO, PIXMAN_REGION_STATUS_SUCCESS, PIXMAN_REGION_STATUS_SUCCESS, &overlap))
- return PIXMAN_REGION_STATUS_FAILURE;
-
- newReg->extents.x1 = MIN(reg1->extents.x1, reg2->extents.x1);
- newReg->extents.y1 = MIN(reg1->extents.y1, reg2->extents.y1);
- newReg->extents.x2 = MAX(reg1->extents.x2, reg2->extents.x2);
- newReg->extents.y2 = MAX(reg1->extents.y2, reg2->extents.y2);
- good(newReg);
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-slim_hidden_def(pixman_region_union);
-
-
-/*======================================================================
- * Batch Rectangle Union
- *====================================================================*/
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_append --
- *
- * "Append" the rgn rectangles onto the end of dstrgn, maintaining
- * knowledge of YX-banding when it's easy. Otherwise, dstrgn just
- * becomes a non-y-x-banded random collection of rectangles, and not
- * yet a true region. After a sequence of appends, the caller must
- * call pixman_region_validate to ensure that a valid region is constructed.
- *
- * Results:
- * PIXMAN_REGION_STATUS_SUCCESS if successful.
- *
- * Side Effects:
- * dstrgn is modified if rgn has rectangles.
- *
- */
-pixman_region_status_t
-pixman_region_append(dstrgn, rgn)
- pixman_region16_t * dstrgn;
- pixman_region16_t * rgn;
-{
- int numRects, dnumRects, size;
- pixman_box16_t *new, *old;
- int prepend;
-
- if (PIXREGION_NAR(rgn))
- return pixman_break (dstrgn);
-
- if (!rgn->data && (dstrgn->data == &pixman_region_emptyData))
- {
- dstrgn->extents = rgn->extents;
- dstrgn->data = (pixman_region16_data_t *)NULL;
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
-
- numRects = PIXREGION_NUM_RECTS(rgn);
- if (!numRects)
- return PIXMAN_REGION_STATUS_SUCCESS;
- prepend = PIXMAN_REGION_STATUS_FAILURE;
- size = numRects;
- dnumRects = PIXREGION_NUM_RECTS(dstrgn);
- if (!dnumRects && (size < 200))
- size = 200; /* XXX pick numbers out of a hat */
- RECTALLOC(dstrgn, size);
- old = PIXREGION_RECTS(rgn);
- if (!dnumRects)
- dstrgn->extents = rgn->extents;
- else if (dstrgn->extents.x2 > dstrgn->extents.x1)
- {
- pixman_box16_t *first, *last;
-
- first = old;
- last = PIXREGION_BOXPTR(dstrgn) + (dnumRects - 1);
- if ((first->y1 > last->y2) ||
- ((first->y1 == last->y1) && (first->y2 == last->y2) &&
- (first->x1 > last->x2)))
- {
- if (rgn->extents.x1 < dstrgn->extents.x1)
- dstrgn->extents.x1 = rgn->extents.x1;
- if (rgn->extents.x2 > dstrgn->extents.x2)
- dstrgn->extents.x2 = rgn->extents.x2;
- dstrgn->extents.y2 = rgn->extents.y2;
- }
- else
- {
- first = PIXREGION_BOXPTR(dstrgn);
- last = old + (numRects - 1);
- if ((first->y1 > last->y2) ||
- ((first->y1 == last->y1) && (first->y2 == last->y2) &&
- (first->x1 > last->x2)))
- {
- prepend = PIXMAN_REGION_STATUS_SUCCESS;
- if (rgn->extents.x1 < dstrgn->extents.x1)
- dstrgn->extents.x1 = rgn->extents.x1;
- if (rgn->extents.x2 > dstrgn->extents.x2)
- dstrgn->extents.x2 = rgn->extents.x2;
- dstrgn->extents.y1 = rgn->extents.y1;
- }
- else
- dstrgn->extents.x2 = dstrgn->extents.x1;
- }
- }
- if (prepend)
- {
- new = PIXREGION_BOX(dstrgn, numRects);
- if (dnumRects == 1)
- *new = *PIXREGION_BOXPTR(dstrgn);
- else
- memmove((char *)new,(char *)PIXREGION_BOXPTR(dstrgn),
- dnumRects * sizeof(pixman_box16_t));
- new = PIXREGION_BOXPTR(dstrgn);
- }
- else
- new = PIXREGION_BOXPTR(dstrgn) + dnumRects;
- if (numRects == 1)
- *new = *old;
- else
- memmove((char *)new, (char *)old, numRects * sizeof(pixman_box16_t));
- dstrgn->data->numRects += numRects;
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-
-#define ExchangeRects(a, b) \
-{ \
- pixman_box16_t t; \
- t = rects[a]; \
- rects[a] = rects[b]; \
- rects[b] = t; \
-}
-
-static void
-QuickSortRects(
- pixman_box16_t rects[],
- int numRects)
-{
- int y1;
- int x1;
- int i, j;
- pixman_box16_t *r;
-
- /* Always called with numRects > 1 */
-
- do
- {
- if (numRects == 2)
- {
- if (rects[0].y1 > rects[1].y1 ||
- (rects[0].y1 == rects[1].y1 && rects[0].x1 > rects[1].x1))
- ExchangeRects(0, 1);
- return;
- }
-
- /* Choose partition element, stick in location 0 */
- ExchangeRects(0, numRects >> 1);
- y1 = rects[0].y1;
- x1 = rects[0].x1;
-
- /* Partition array */
- i = 0;
- j = numRects;
- do
- {
- r = &(rects[i]);
- do
- {
- r++;
- i++;
- } while (i != numRects &&
- (r->y1 < y1 || (r->y1 == y1 && r->x1 < x1)));
- r = &(rects[j]);
- do
- {
- r--;
- j--;
- } while (y1 < r->y1 || (y1 == r->y1 && x1 < r->x1));
- if (i < j)
- ExchangeRects(i, j);
- } while (i < j);
-
- /* Move partition element back to middle */
- ExchangeRects(0, j);
-
- /* Recurse */
- if (numRects-j-1 > 1)
- QuickSortRects(&rects[j+1], numRects-j-1);
- numRects = j;
- } while (numRects > 1);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_validate --
- *
- * Take a ``region'' which is a non-y-x-banded random collection of
- * rectangles, and compute a nice region which is the union of all the
- * rectangles.
- *
- * Results:
- * PIXMAN_REGION_STATUS_SUCCESS if successful.
- *
- * Side Effects:
- * The passed-in ``region'' may be modified.
- * pOverlap set to PIXMAN_REGION_STATUS_SUCCESS if any retangles overlapped, else PIXMAN_REGION_STATUS_FAILURE;
- *
- * Strategy:
- * Step 1. Sort the rectangles into ascending order with primary key y1
- * and secondary key x1.
- *
- * Step 2. Split the rectangles into the minimum number of proper y-x
- * banded regions. This may require horizontally merging
- * rectangles, and vertically coalescing bands. With any luck,
- * this step in an identity tranformation (ala the Box widget),
- * or a coalescing into 1 box (ala Menus).
- *
- * Step 3. Merge the separate regions down to a single region by calling
- * pixman_region_union. Maximize the work each pixman_region_union call does by using
- * a binary merge.
- *
- *-----------------------------------------------------------------------
- */
-
-pixman_region_status_t
-pixman_region_validate(badreg, pOverlap)
- pixman_region16_t * badreg;
- int *pOverlap;
-{
- /* Descriptor for regions under construction in Step 2. */
- typedef struct {
- pixman_region16_t reg;
- int prevBand;
- int curBand;
- } RegionInfo;
-
- int numRects; /* Original numRects for badreg */
- RegionInfo *ri; /* Array of current regions */
- int numRI; /* Number of entries used in ri */
- int sizeRI; /* Number of entries available in ri */
- int i; /* Index into rects */
- int j; /* Index into ri */
- RegionInfo *rit; /* &ri[j] */
- pixman_region16_t * reg; /* ri[j].reg */
- pixman_box16_t * box; /* Current box in rects */
- pixman_box16_t * riBox; /* Last box in ri[j].reg */
- pixman_region16_t * hreg; /* ri[j_half].reg */
- int ret = PIXMAN_REGION_STATUS_SUCCESS;
-
- *pOverlap = PIXMAN_REGION_STATUS_FAILURE;
- if (!badreg->data)
- {
- good(badreg);
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
- numRects = badreg->data->numRects;
- if (!numRects)
- {
- if (PIXREGION_NAR(badreg))
- return PIXMAN_REGION_STATUS_FAILURE;
- good(badreg);
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
- if (badreg->extents.x1 < badreg->extents.x2)
- {
- if ((numRects) == 1)
- {
- freeData(badreg);
- badreg->data = (pixman_region16_data_t *) NULL;
- }
- else
- {
- DOWNSIZE(badreg, numRects);
- }
- good(badreg);
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
-
- /* Step 1: Sort the rects array into ascending (y1, x1) order */
- QuickSortRects(PIXREGION_BOXPTR(badreg), numRects);
-
- /* Step 2: Scatter the sorted array into the minimum number of regions */
-
- /* Set up the first region to be the first rectangle in badreg */
- /* Note that step 2 code will never overflow the ri[0].reg rects array */
- ri = (RegionInfo *) malloc(4 * sizeof(RegionInfo));
- if (!ri)
- return pixman_break (badreg);
- sizeRI = 4;
- numRI = 1;
- ri[0].prevBand = 0;
- ri[0].curBand = 0;
- ri[0].reg = *badreg;
- box = PIXREGION_BOXPTR(&ri[0].reg);
- ri[0].reg.extents = *box;
- ri[0].reg.data->numRects = 1;
-
- /* Now scatter rectangles into the minimum set of valid regions. If the
- next rectangle to be added to a region would force an existing rectangle
- in the region to be split up in order to maintain y-x banding, just
- forget it. Try the next region. If it doesn't fit cleanly into any
- region, make a new one. */
-
- for (i = numRects; --i > 0;)
- {
- box++;
- /* Look for a region to append box to */
- for (j = numRI, rit = ri; --j >= 0; rit++)
- {
- reg = &rit->reg;
- riBox = PIXREGION_END(reg);
-
- if (box->y1 == riBox->y1 && box->y2 == riBox->y2)
- {
- /* box is in same band as riBox. Merge or append it */
- if (box->x1 <= riBox->x2)
- {
- /* Merge it with riBox */
- if (box->x1 < riBox->x2) *pOverlap = PIXMAN_REGION_STATUS_SUCCESS;
- if (box->x2 > riBox->x2) riBox->x2 = box->x2;
- }
- else
- {
- RECTALLOC_BAIL(reg, 1, bail);
- *PIXREGION_TOP(reg) = *box;
- reg->data->numRects++;
- }
- goto NextRect; /* So sue me */
- }
- else if (box->y1 >= riBox->y2)
- {
- /* Put box into new band */
- if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2;
- if (reg->extents.x1 > box->x1) reg->extents.x1 = box->x1;
- Coalesce(reg, rit->prevBand, rit->curBand);
- rit->curBand = reg->data->numRects;
- RECTALLOC_BAIL(reg, 1, bail);
- *PIXREGION_TOP(reg) = *box;
- reg->data->numRects++;
- goto NextRect;
- }
- /* Well, this region was inappropriate. Try the next one. */
- } /* for j */
-
- /* Uh-oh. No regions were appropriate. Create a new one. */
- if (sizeRI == numRI)
- {
- /* Oops, allocate space for new region information */
- sizeRI <<= 1;
- rit = (RegionInfo *) realloc(ri, sizeRI * sizeof(RegionInfo));
- if (!rit)
- goto bail;
- ri = rit;
- rit = &ri[numRI];
- }
- numRI++;
- rit->prevBand = 0;
- rit->curBand = 0;
- rit->reg.extents = *box;
- rit->reg.data = (pixman_region16_data_t *)NULL;
- if (!pixman_rect_alloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */
- goto bail;
-NextRect: ;
- } /* for i */
-
- /* Make a final pass over each region in order to Coalesce and set
- extents.x2 and extents.y2 */
-
- for (j = numRI, rit = ri; --j >= 0; rit++)
- {
- reg = &rit->reg;
- riBox = PIXREGION_END(reg);
- reg->extents.y2 = riBox->y2;
- if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2;
- Coalesce(reg, rit->prevBand, rit->curBand);
- if (reg->data->numRects == 1) /* keep unions happy below */
- {
- freeData(reg);
- reg->data = (pixman_region16_data_t *)NULL;
- }
- }
-
- /* Step 3: Union all regions into a single region */
- while (numRI > 1)
- {
- int half = numRI/2;
- for (j = numRI & 1; j < (half + (numRI & 1)); j++)
- {
- reg = &ri[j].reg;
- hreg = &ri[j+half].reg;
- if (!pixman_op(reg, reg, hreg, pixman_region_unionO, PIXMAN_REGION_STATUS_SUCCESS, PIXMAN_REGION_STATUS_SUCCESS, pOverlap))
- ret = PIXMAN_REGION_STATUS_FAILURE;
- if (hreg->extents.x1 < reg->extents.x1)
- reg->extents.x1 = hreg->extents.x1;
- if (hreg->extents.y1 < reg->extents.y1)
- reg->extents.y1 = hreg->extents.y1;
- if (hreg->extents.x2 > reg->extents.x2)
- reg->extents.x2 = hreg->extents.x2;
- if (hreg->extents.y2 > reg->extents.y2)
- reg->extents.y2 = hreg->extents.y2;
- freeData(hreg);
- }
- numRI -= half;
- }
- *badreg = ri[0].reg;
- free(ri);
- good(badreg);
- return ret;
-bail:
- for (i = 0; i < numRI; i++)
- freeData(&ri[i].reg);
- free (ri);
- return pixman_break (badreg);
-}
-
-/* XXX: Need to fix this to not use any X data structure
-pixman_region16_t *
-pixman_region_rectsToRegion(nrects, prect, ctype)
- int nrects;
- xRectangle *prect;
- int ctype;
-{
- pixman_region16_t * region;
- pixman_region16_data_t * pData;
- pixman_box16_t * box;
- int i;
- int x1, y1, x2, y2;
-
- region = pixman_region_create(NullBox, 0);
- if (PIXREGION_NAR (region))
- return region;
- if (!nrects)
- return region;
- if (nrects == 1)
- {
- x1 = prect->x;
- y1 = prect->y;
- if ((x2 = x1 + (int) prect->width) > SHRT_MAX)
- x2 = SHRT_MAX;
- if ((y2 = y1 + (int) prect->height) > SHRT_MAX)
- y2 = SHRT_MAX;
- if (x1 != x2 && y1 != y2)
- {
- region->extents.x1 = x1;
- region->extents.y1 = y1;
- region->extents.x2 = x2;
- region->extents.y2 = y2;
- region->data = (pixman_region16_data_t *)NULL;
- }
- return region;
- }
- pData = allocData(nrects);
- if (!pData)
- {
- pixman_break (region);
- return region;
- }
- box = (pixman_box16_t *) (pData + 1);
- for (i = nrects; --i >= 0; prect++)
- {
- x1 = prect->x;
- y1 = prect->y;
- if ((x2 = x1 + (int) prect->width) > SHRT_MAX)
- x2 = SHRT_MAX;
- if ((y2 = y1 + (int) prect->height) > SHRT_MAX)
- y2 = SHRT_MAX;
- if (x1 != x2 && y1 != y2)
- {
- box->x1 = x1;
- box->y1 = y1;
- box->x2 = x2;
- box->y2 = y2;
- box++;
- }
- }
- if (box != (pixman_box16_t *) (pData + 1))
- {
- pData->size = nrects;
- pData->numRects = box - (pixman_box16_t *) (pData + 1);
- region->data = pData;
- if (ctype != CT_YXBANDED)
- {
- int overlap;
- region->extents.x1 = region->extents.x2 = 0;
- pixman_region_validate(region, &overlap);
- }
- else
- pixman_set_extents(region);
- good(region);
- }
- else
- {
- free (pData);
- }
- return region;
-}
-*/
-
-/*======================================================================
- * Region Subtraction
- *====================================================================*/
-
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_subtractO --
- * Overlapping band subtraction. x1 is the left-most point not yet
- * checked.
- *
- * Results:
- * PIXMAN_REGION_STATUS_SUCCESS if successful.
- *
- * Side Effects:
- * region may have rectangles added to it.
- *
- *-----------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static pixman_region_status_t
-pixman_region_subtractO (
- pixman_region16_t * region,
- pixman_box16_t * r1,
- pixman_box16_t * r1End,
- pixman_box16_t * r2,
- pixman_box16_t * r2End,
- short y1,
- short y2,
- int *pOverlap)
-{
- pixman_box16_t * pNextRect;
- int x1;
-
- x1 = r1->x1;
-
- assert(y1<y2);
- assert(r1 != r1End && r2 != r2End);
-
- pNextRect = PIXREGION_TOP(region);
-
- do
- {
- if (r2->x2 <= x1)
- {
- /*
- * Subtrahend entirely to left of minuend: go to next subtrahend.
- */
- r2++;
- }
- else if (r2->x1 <= x1)
- {
- /*
- * Subtrahend preceeds minuend: nuke left edge of minuend.
- */
- x1 = r2->x2;
- if (x1 >= r1->x2)
- {
- /*
- * Minuend completely covered: advance to next minuend and
- * reset left fence to edge of new minuend.
- */
- r1++;
- if (r1 != r1End)
- x1 = r1->x1;
- }
- else
- {
- /*
- * Subtrahend now used up since it doesn't extend beyond
- * minuend
- */
- r2++;
- }
- }
- else if (r2->x1 < r1->x2)
- {
- /*
- * Left part of subtrahend covers part of minuend: add uncovered
- * part of minuend to region and skip to next subtrahend.
- */
- assert(x1<r2->x1);
- NEWRECT(region, pNextRect, x1, y1, r2->x1, y2);
-
- x1 = r2->x2;
- if (x1 >= r1->x2)
- {
- /*
- * Minuend used up: advance to new...
- */
- r1++;
- if (r1 != r1End)
- x1 = r1->x1;
- }
- else
- {
- /*
- * Subtrahend used up
- */
- r2++;
- }
- }
- else
- {
- /*
- * Minuend used up: add any remaining piece before advancing.
- */
- if (r1->x2 > x1)
- NEWRECT(region, pNextRect, x1, y1, r1->x2, y2);
- r1++;
- if (r1 != r1End)
- x1 = r1->x1;
- }
- } while ((r1 != r1End) && (r2 != r2End));
-
-
- /*
- * Add remaining minuend rectangles to region.
- */
- while (r1 != r1End)
- {
- assert(x1<r1->x2);
- NEWRECT(region, pNextRect, x1, y1, r1->x2, y2);
- r1++;
- if (r1 != r1End)
- x1 = r1->x1;
- }
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_subtract --
- * Subtract regS from regM and leave the result in regD.
- * S stands for subtrahend, M for minuend and D for difference.
- *
- * Results:
- * PIXMAN_REGION_STATUS_SUCCESS if successful.
- *
- * Side Effects:
- * regD is overwritten.
- *
- *-----------------------------------------------------------------------
- */
-pixman_region_status_t
-pixman_region_subtract(regD, regM, regS)
- pixman_region16_t * regD;
- pixman_region16_t * regM;
- pixman_region16_t * regS;
-{
- int overlap; /* result ignored */
-
- good(regM);
- good(regS);
- good(regD);
- /* check for trivial rejects */
- if (PIXREGION_NIL(regM) || PIXREGION_NIL(regS) ||
- !EXTENTCHECK(&regM->extents, &regS->extents))
- {
- if (PIXREGION_NAR (regS))
- return pixman_break (regD);
- return pixman_region_copy(regD, regM);
- }
- else if (regM == regS)
- {
- freeData(regD);
- regD->extents.x2 = regD->extents.x1;
- regD->extents.y2 = regD->extents.y1;
- regD->data = &pixman_region_emptyData;
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
-
- /* Add those rectangles in region 1 that aren't in region 2,
- do yucky substraction for overlaps, and
- just throw away rectangles in region 2 that aren't in region 1 */
- if (!pixman_op(regD, regM, regS, pixman_region_subtractO, PIXMAN_REGION_STATUS_SUCCESS, PIXMAN_REGION_STATUS_FAILURE, &overlap))
- return PIXMAN_REGION_STATUS_FAILURE;
-
- /*
- * Can't alter RegD's extents before we call pixman_op because
- * it might be one of the source regions and pixman_op depends
- * on the extents of those regions being unaltered. Besides, this
- * way there's no checking against rectangles that will be nuked
- * due to coalescing, so we have to examine fewer rectangles.
- */
- pixman_set_extents(regD);
- good(regD);
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-/*======================================================================
- * Region Inversion
- *====================================================================*/
-
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_inverse --
- * Take a region and a box and return a region that is everything
- * in the box but not in the region. The careful reader will note
- * that this is the same as subtracting the region from the box...
- *
- * Results:
- * PIXMAN_REGION_STATUS_SUCCESS.
- *
- * Side Effects:
- * newReg is overwritten.
- *
- *-----------------------------------------------------------------------
- */
-pixman_region_status_t
-pixman_region_inverse(newReg, reg1, invRect)
- pixman_region16_t * newReg; /* Destination region */
- pixman_region16_t * reg1; /* Region to invert */
- pixman_box16_t * invRect; /* Bounding box for inversion */
-{
- pixman_region16_t invReg; /* Quick and dirty region made from the
- * bounding box */
- int overlap; /* result ignored */
-
- good(reg1);
- good(newReg);
- /* check for trivial rejects */
- if (PIXREGION_NIL(reg1) || !EXTENTCHECK(invRect, &reg1->extents))
- {
- if (PIXREGION_NAR(reg1))
- return pixman_break (newReg);
- newReg->extents = *invRect;
- freeData(newReg);
- newReg->data = (pixman_region16_data_t *)NULL;
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
-
- /* Add those rectangles in region 1 that aren't in region 2,
- do yucky substraction for overlaps, and
- just throw away rectangles in region 2 that aren't in region 1 */
- invReg.extents = *invRect;
- invReg.data = (pixman_region16_data_t *)NULL;
- if (!pixman_op(newReg, &invReg, reg1, pixman_region_subtractO, PIXMAN_REGION_STATUS_SUCCESS, PIXMAN_REGION_STATUS_FAILURE, &overlap))
- return PIXMAN_REGION_STATUS_FAILURE;
-
- /*
- * Can't alter newReg's extents before we call pixman_op because
- * it might be one of the source regions and pixman_op depends
- * on the extents of those regions being unaltered. Besides, this
- * way there's no checking against rectangles that will be nuked
- * due to coalescing, so we have to examine fewer rectangles.
- */
- pixman_set_extents(newReg);
- good(newReg);
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-
-/*
- * RectIn(region, rect)
- * This routine takes a pointer to a region and a pointer to a box
- * and determines if the box is outside/inside/partly inside the region.
- *
- * The idea is to travel through the list of rectangles trying to cover the
- * passed box with them. Anytime a piece of the rectangle isn't covered
- * by a band of rectangles, partOut is set PIXMAN_REGION_STATUS_SUCCESS. Any time a rectangle in
- * the region covers part of the box, partIn is set PIXMAN_REGION_STATUS_SUCCESS. The process ends
- * when either the box has been completely covered (we reached a band that
- * doesn't overlap the box, partIn is PIXMAN_REGION_STATUS_SUCCESS and partOut is false), the
- * box has been partially covered (partIn == partOut == PIXMAN_REGION_STATUS_SUCCESS -- because of
- * the banding, the first time this is true we know the box is only
- * partially in the region) or is outside the region (we reached a band
- * that doesn't overlap the box at all and partIn is false)
- */
-
-int
-pixman_region_contains_rectangle(region, prect)
- pixman_region16_t * region;
- pixman_box16_t * prect;
-{
- int x;
- int y;
- pixman_box16_t * pbox;
- pixman_box16_t * pboxEnd;
- int partIn, partOut;
- int numRects;
-
- good(region);
- numRects = PIXREGION_NUM_RECTS(region);
- /* useful optimization */
- if (!numRects || !EXTENTCHECK(&region->extents, prect))
- return(rgnOUT);
-
- if (numRects == 1)
- {
- /* We know that it must be rgnIN or rgnPART */
- if (SUBSUMES(&region->extents, prect))
- return(rgnIN);
- else
- return(rgnPART);
- }
-
- partOut = PIXMAN_REGION_STATUS_FAILURE;
- partIn = PIXMAN_REGION_STATUS_FAILURE;
-
- /* (x,y) starts at upper left of rect, moving to the right and down */
- x = prect->x1;
- y = prect->y1;
-
- /* can stop when both partOut and partIn are PIXMAN_REGION_STATUS_SUCCESS, or we reach prect->y2 */
- for (pbox = PIXREGION_BOXPTR(region), pboxEnd = pbox + numRects;
- pbox != pboxEnd;
- pbox++)
- {
-
- if (pbox->y2 <= y)
- continue; /* getting up to speed or skipping remainder of band */
-
- if (pbox->y1 > y)
- {
- partOut = PIXMAN_REGION_STATUS_SUCCESS; /* missed part of rectangle above */
- if (partIn || (pbox->y1 >= prect->y2))
- break;
- y = pbox->y1; /* x guaranteed to be == prect->x1 */
- }
-
- if (pbox->x2 <= x)
- continue; /* not far enough over yet */
-
- if (pbox->x1 > x)
- {
- partOut = PIXMAN_REGION_STATUS_SUCCESS; /* missed part of rectangle to left */
- if (partIn)
- break;
- }
-
- if (pbox->x1 < prect->x2)
- {
- partIn = PIXMAN_REGION_STATUS_SUCCESS; /* definitely overlap */
- if (partOut)
- break;
- }
-
- if (pbox->x2 >= prect->x2)
- {
- y = pbox->y2; /* finished with this band */
- if (y >= prect->y2)
- break;
- x = prect->x1; /* reset x out to left again */
- }
- else
- {
- /*
- * Because boxes in a band are maximal width, if the first box
- * to overlap the rectangle doesn't completely cover it in that
- * band, the rectangle must be partially out, since some of it
- * will be uncovered in that band. partIn will have been set true
- * by now...
- */
- partOut = PIXMAN_REGION_STATUS_SUCCESS;
- break;
- }
- }
-
- return(partIn ? ((y < prect->y2) ? rgnPART : rgnIN) : rgnOUT);
-}
-
-/* pixman_region_translate (region, x, y)
- translates in place
-*/
-
-void
-pixman_region_translate (pixman_region16_t * region, int x, int y)
-{
- int x1, x2, y1, y2;
- int nbox;
- pixman_box16_t * pbox;
-
- good(region);
- region->extents.x1 = x1 = region->extents.x1 + x;
- region->extents.y1 = y1 = region->extents.y1 + y;
- region->extents.x2 = x2 = region->extents.x2 + x;
- region->extents.y2 = y2 = region->extents.y2 + y;
- if (((x1 - SHRT_MIN)|(y1 - SHRT_MIN)|(SHRT_MAX - x2)|(SHRT_MAX - y2)) >= 0)
- {
- if (region->data && (nbox = region->data->numRects))
- {
- for (pbox = PIXREGION_BOXPTR(region); nbox--; pbox++)
- {
- pbox->x1 += x;
- pbox->y1 += y;
- pbox->x2 += x;
- pbox->y2 += y;
- }
- }
- return;
- }
- if (((x2 - SHRT_MIN)|(y2 - SHRT_MIN)|(SHRT_MAX - x1)|(SHRT_MAX - y1)) <= 0)
- {
- region->extents.x2 = region->extents.x1;
- region->extents.y2 = region->extents.y1;
- freeData(region);
- region->data = &pixman_region_emptyData;
- return;
- }
- if (x1 < SHRT_MIN)
- region->extents.x1 = SHRT_MIN;
- else if (x2 > SHRT_MAX)
- region->extents.x2 = SHRT_MAX;
- if (y1 < SHRT_MIN)
- region->extents.y1 = SHRT_MIN;
- else if (y2 > SHRT_MAX)
- region->extents.y2 = SHRT_MAX;
- if (region->data && (nbox = region->data->numRects))
- {
- pixman_box16_t * pboxout;
-
- for (pboxout = pbox = PIXREGION_BOXPTR(region); nbox--; pbox++)
- {
- pboxout->x1 = x1 = pbox->x1 + x;
- pboxout->y1 = y1 = pbox->y1 + y;
- pboxout->x2 = x2 = pbox->x2 + x;
- pboxout->y2 = y2 = pbox->y2 + y;
- if (((x2 - SHRT_MIN)|(y2 - SHRT_MIN)|
- (SHRT_MAX - x1)|(SHRT_MAX - y1)) <= 0)
- {
- region->data->numRects--;
- continue;
- }
- if (x1 < SHRT_MIN)
- pboxout->x1 = SHRT_MIN;
- else if (x2 > SHRT_MAX)
- pboxout->x2 = SHRT_MAX;
- if (y1 < SHRT_MIN)
- pboxout->y1 = SHRT_MIN;
- else if (y2 > SHRT_MAX)
- pboxout->y2 = SHRT_MAX;
- pboxout++;
- }
- if (pboxout != pbox)
- {
- if (region->data->numRects == 1)
- {
- region->extents = *PIXREGION_BOXPTR(region);
- freeData(region);
- region->data = (pixman_region16_data_t *)NULL;
- }
- else
- pixman_set_extents(region);
- }
- }
-}
-
-/* XXX: Do we need this?
-static pixman_region_status_t
-pixman_region16_data_copy(pixman_region16_t * dst, pixman_region16_t * src)
-{
- good(dst);
- good(src);
- if (dst->data)
- return PIXMAN_REGION_STATUS_SUCCESS;
- if (dst == src)
- return PIXMAN_REGION_STATUS_SUCCESS;
- if (!src->data || !src->data->size)
- {
- freeData(dst);
- dst->data = (pixman_region16_data_t *)NULL;
- return PIXMAN_REGION_STATUS_SUCCESS;
- }
- if (!dst->data || (dst->data->size < src->data->numRects))
- {
- freeData(dst);
- dst->data = allocData(src->data->numRects);
- if (!dst->data)
- return pixman_break (dst);
- }
- dst->data->size = src->data->size;
- dst->data->numRects = src->data->numRects;
- return PIXMAN_REGION_STATUS_SUCCESS;
-}
-*/
-
-void
-pixman_region_reset(pixman_region16_t *region, pixman_box16_t *box)
-{
- good(region);
- assert(box->x1<=box->x2);
- assert(box->y1<=box->y2);
- region->extents = *box;
- freeData(region);
- region->data = (pixman_region16_data_t *)NULL;
-}
-
-int
-pixman_region_contains_point(region, x, y, box)
- pixman_region16_t * region;
- int x, y;
- pixman_box16_t * box; /* "return" value */
-{
- pixman_box16_t *pbox, *pboxEnd;
- int numRects;
-
- good(region);
- numRects = PIXREGION_NUM_RECTS(region);
- if (!numRects || !INBOX(&region->extents, x, y))
- return(PIXMAN_REGION_STATUS_FAILURE);
- if (numRects == 1)
- {
- *box = region->extents;
- return(PIXMAN_REGION_STATUS_SUCCESS);
- }
- for (pbox = PIXREGION_BOXPTR(region), pboxEnd = pbox + numRects;
- pbox != pboxEnd;
- pbox++)
- {
- if (y >= pbox->y2)
- continue; /* not there yet */
- if ((y < pbox->y1) || (x < pbox->x1))
- break; /* missed it */
- if (x >= pbox->x2)
- continue; /* not there yet */
- *box = *pbox;
- return(PIXMAN_REGION_STATUS_SUCCESS);
- }
- return(PIXMAN_REGION_STATUS_FAILURE);
-}
-
-int
-pixman_region_not_empty(region)
- pixman_region16_t * region;
-{
- good(region);
- return(!PIXREGION_NIL(region));
-}
-
-/* XXX: Do we need this?
-static int
-pixman_region16_broken(pixman_region16_t * region)
-{
- good(region);
- return (PIXREGION_NAR(region));
-}
-*/
-
-void
-pixman_region_empty(region)
- pixman_region16_t * region;
-{
- good(region);
- freeData(region);
- region->extents.x2 = region->extents.x1;
- region->extents.y2 = region->extents.y1;
- region->data = &pixman_region_emptyData;
-}
-
-pixman_box16_t *
-pixman_region_extents(region)
- pixman_region16_t * region;
-{
- good(region);
- return(&region->extents);
-}
-
-#define ExchangeSpans(a, b) \
-{ \
- pixman_region16_point_t tpt; \
- int tw; \
- \
- tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt; \
- tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \
-}
-
-/* ||| I should apply the merge sort code to rectangle sorting above, and see
- if mapping time can be improved. But right now I've been at work 12 hours,
- so forget it.
-*/
-
-static void QuickSortSpans(
- pixman_region16_point_t spans[],
- int widths[],
- int numSpans)
-{
- int y;
- int i, j, m;
- pixman_region16_point_t *r;
-
- /* Always called with numSpans > 1 */
- /* Sorts only by y, doesn't bother to sort by x */
-
- do
- {
- if (numSpans < 9)
- {
- /* Do insertion sort */
- int yprev;
-
- yprev = spans[0].y;
- i = 1;
- do
- { /* while i != numSpans */
- y = spans[i].y;
- if (yprev > y)
- {
- /* spans[i] is out of order. Move into proper location. */
- pixman_region16_point_t tpt;
- int tw, k;
-
- for (j = 0; y >= spans[j].y; j++) {}
- tpt = spans[i];
- tw = widths[i];
- for (k = i; k != j; k--)
- {
- spans[k] = spans[k-1];
- widths[k] = widths[k-1];
- }
- spans[j] = tpt;
- widths[j] = tw;
- y = spans[i].y;
- } /* if out of order */
- yprev = y;
- i++;
- } while (i != numSpans);
- return;
- }
-
- /* Choose partition element, stick in location 0 */
- m = numSpans / 2;
- if (spans[m].y > spans[0].y) ExchangeSpans(m, 0);
- if (spans[m].y > spans[numSpans-1].y) ExchangeSpans(m, numSpans-1);
- if (spans[m].y > spans[0].y) ExchangeSpans(m, 0);
- y = spans[0].y;
-
- /* Partition array */
- i = 0;
- j = numSpans;
- do
- {
- r = &(spans[i]);
- do
- {
- r++;
- i++;
- } while (i != numSpans && r->y < y);
- r = &(spans[j]);
- do
- {
- r--;
- j--;
- } while (y < r->y);
- if (i < j)
- ExchangeSpans(i, j);
- } while (i < j);
-
- /* Move partition element back to middle */
- ExchangeSpans(0, j);
-
- /* Recurse */
- if (numSpans-j-1 > 1)
- QuickSortSpans(&spans[j+1], &widths[j+1], numSpans-j-1);
- numSpans = j;
- } while (numSpans > 1);
-}
-
-#define NextBand() \
-{ \
- clipy1 = pboxBandStart->y1; \
- clipy2 = pboxBandStart->y2; \
- pboxBandEnd = pboxBandStart + 1; \
- while (pboxBandEnd != pboxLast && pboxBandEnd->y1 == clipy1) { \
- pboxBandEnd++; \
- } \
- for (; ppt != pptLast && ppt->y < clipy1; ppt++, pwidth++) {} \
-}
-
-/*
- Clip a list of scanlines to a region. The caller has allocated the
- space. FSorted is non-zero if the scanline origins are in ascending
- order.
- returns the number of new, clipped scanlines.
-*/
-
-#ifdef XXX_DO_WE_NEED_THIS
-static int
-pixman_region16_clip_spans(
- pixman_region16_t *prgnDst,
- pixman_region16_point_t *ppt,
- int *pwidth,
- int nspans,
- pixman_region16_point_t *pptNew,
- int *pwidthNew,
- int fSorted)
-{
- pixman_region16_point_t *pptLast;
- int *pwidthNewStart; /* the vengeance of Xerox! */
- int y, x1, x2;
- int numRects;
-
- good(prgnDst);
- pptLast = ppt + nspans;
- pwidthNewStart = pwidthNew;
-
- if (!prgnDst->data)
- {
- /* Do special fast code with clip boundaries in registers(?) */
- /* It doesn't pay much to make use of fSorted in this case,
- so we lump everything together. */
-
- int clipx1, clipx2, clipy1, clipy2;
-
- clipx1 = prgnDst->extents.x1;
- clipy1 = prgnDst->extents.y1;
- clipx2 = prgnDst->extents.x2;
- clipy2 = prgnDst->extents.y2;
-
- for (; ppt != pptLast; ppt++, pwidth++)
- {
- y = ppt->y;
- x1 = ppt->x;
- if (clipy1 <= y && y < clipy2)
- {
- x2 = x1 + *pwidth;
- if (x1 < clipx1) x1 = clipx1;
- if (x2 > clipx2) x2 = clipx2;
- if (x1 < x2)
- {
- /* part of span in clip rectangle */
- pptNew->x = x1;
- pptNew->y = y;
- *pwidthNew = x2 - x1;
- pptNew++;
- pwidthNew++;
- }
- }
- } /* end for */
-
- }
- else if ((numRects = prgnDst->data->numRects))
- {
- /* Have to clip against many boxes */
- pixman_box16_t *pboxBandStart, *pboxBandEnd;
- pixman_box16_t *pbox;
- pixman_box16_t *pboxLast;
- int clipy1, clipy2;
-
- /* In this case, taking advantage of sorted spans gains more than
- the sorting costs. */
- if ((! fSorted) && (nspans > 1))
- QuickSortSpans(ppt, pwidth, nspans);
-
- pboxBandStart = PIXREGION_BOXPTR(prgnDst);
- pboxLast = pboxBandStart + numRects;
-
- NextBand();
-
- for (; ppt != pptLast; )
- {
- y = ppt->y;
- if (y < clipy2)
- {
- /* span is in the current band */
- pbox = pboxBandStart;
- x1 = ppt->x;
- x2 = x1 + *pwidth;
- do
- { /* For each box in band */
- int newx1, newx2;
-
- newx1 = x1;
- newx2 = x2;
- if (newx1 < pbox->x1) newx1 = pbox->x1;
- if (newx2 > pbox->x2) newx2 = pbox->x2;
- if (newx1 < newx2)
- {
- /* Part of span in clip rectangle */
- pptNew->x = newx1;
- pptNew->y = y;
- *pwidthNew = newx2 - newx1;
- pptNew++;
- pwidthNew++;
- }
- pbox++;
- } while (pbox != pboxBandEnd);
- ppt++;
- pwidth++;
- }
- else
- {
- /* Move to next band, adjust ppt as needed */
- pboxBandStart = pboxBandEnd;
- if (pboxBandStart == pboxLast)
- break; /* We're completely done */
- NextBand();
- }
- }
- }
- return (pwidthNew - pwidthNewStart);
-}
-
-/* find the band in a region with the most rectangles */
-static int
-pixman_region16_find_max_band(pixman_region16_t * prgn)
-{
- int nbox;
- pixman_box16_t * pbox;
- int nThisBand;
- int nMaxBand = 0;
- short yThisBand;
-
- good(prgn);
- nbox = PIXREGION_NUM_RECTS(prgn);
- pbox = PIXREGION_RECTS(prgn);
-
- while(nbox > 0)
- {
- yThisBand = pbox->y1;
- nThisBand = 0;
- while((nbox > 0) && (pbox->y1 == yThisBand))
- {
- nbox--;
- pbox++;
- nThisBand++;
- }
- if (nThisBand > nMaxBand)
- nMaxBand = nThisBand;
- }
- return (nMaxBand);
-}
-#endif /* XXX_DO_WE_NEED_THIS */
diff --git a/pixman/src/pixregionint.h b/pixman/src/pixregionint.h
deleted file mode 100644
index 86ff8e655..000000000
--- a/pixman/src/pixregionint.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-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
-OPEN GROUP 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.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $Id: pixregionint.h,v 1.7 2004-04-16 15:32:53 cworth Exp $ */
-
-#ifndef _PIXREGIONINT_H_
-#define _PIXREGIONINT_H_
-
-#include "pixman.h"
-
-typedef struct pixman_region16_data {
- long size;
- long numRects;
- /* XXX: And why, exactly, do we have this bogus struct definition? */
-/* pixman_box16_t rects[size]; in memory but not explicitly declared */
-} pixman_region16_data_t;
-
-struct pixman_region16 {
- pixman_box16_t extents;
- pixman_region16_data_t *data;
-};
-
-typedef struct pixman_region16_point {
- int x, y;
-} pixman_region16_point_t;
-
-#define PIXREGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
-/* not a region */
-#define PIXREGION_NAR(reg) ((reg)->data == &pixman_brokendata)
-#define PIXREGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
-#define PIXREGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
-#define PIXREGION_RECTS(reg) ((reg)->data ? (pixman_box16_t *)((reg)->data + 1) \
- : &(reg)->extents)
-#define PIXREGION_BOXPTR(reg) ((pixman_box16_t *)((reg)->data + 1))
-#define PIXREGION_BOX(reg,i) (&PIXREGION_BOXPTR(reg)[i])
-#define PIXREGION_TOP(reg) PIXREGION_BOX(reg, (reg)->data->numRects)
-#define PIXREGION_END(reg) PIXREGION_BOX(reg, (reg)->data->numRects - 1)
-#define PIXREGION_SZOF(n) (sizeof(pixman_region16_data_t) + ((n) * sizeof(pixman_box16_t)))
-
-#endif /* _PIXREGIONINT_H_ */
diff --git a/pixman/src/renderedge.c b/pixman/src/renderedge.c
deleted file mode 100644
index 525ea73f2..000000000
--- a/pixman/src/renderedge.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * $Id: renderedge.c,v 1.2 2005-01-21 18:26:28 cworth Exp $
- *
- * Copyright Β© 2004 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "pixman-xserver-compat.h"
-
-/*
- * Compute the smallest value no less than y which is on a
- * grid row
- */
-
-xFixed
-RenderSampleCeilY (xFixed y, int n)
-{
- xFixed f = xFixedFrac(y);
- xFixed i = xFixedFloor(y);
-
- f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
- if (f > Y_FRAC_LAST(n))
- {
- f = Y_FRAC_FIRST(n);
- i += xFixed1;
- }
- return (i | f);
-}
-
-#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b)))
-
-/*
- * Compute the largest value no greater than y which is on a
- * grid row
- */
-xFixed
-RenderSampleFloorY (xFixed y, int n)
-{
- xFixed f = xFixedFrac(y);
- xFixed i = xFixedFloor (y);
-
- f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
- if (f < Y_FRAC_FIRST(n))
- {
- f = Y_FRAC_LAST(n);
- i -= xFixed1;
- }
- return (i | f);
-}
-
-/*
- * Step an edge by any amount (including negative values)
- */
-void
-RenderEdgeStep (RenderEdge *e, int n)
-{
- xFixed_48_16 ne;
-
- e->x += n * e->stepx;
-
- ne = e->e + n * (xFixed_48_16) e->dx;
-
- if (n >= 0)
- {
- if (ne > 0)
- {
- int nx = (ne + e->dy - 1) / e->dy;
- e->e = ne - nx * (xFixed_48_16) e->dy;
- e->x += nx * e->signdx;
- }
- }
- else
- {
- if (ne <= -e->dy)
- {
- int nx = (-ne) / e->dy;
- e->e = ne + nx * (xFixed_48_16) e->dy;
- e->x -= nx * e->signdx;
- }
- }
-}
-
-/*
- * A private routine to initialize the multi-step
- * elements of an edge structure
- */
-static void
-_RenderEdgeMultiInit (RenderEdge *e, int n, xFixed *stepx_p, xFixed *dx_p)
-{
- xFixed stepx;
- xFixed_48_16 ne;
-
- ne = n * (xFixed_48_16) e->dx;
- stepx = n * e->stepx;
- if (ne > 0)
- {
- int nx = ne / e->dy;
- ne -= nx * e->dy;
- stepx += nx * e->signdx;
- }
- *dx_p = ne;
- *stepx_p = stepx;
-}
-
-/*
- * Initialize one edge structure given the line endpoints and a
- * starting y value
- */
-void
-RenderEdgeInit (RenderEdge *e,
- int n,
- xFixed y_start,
- xFixed x_top,
- xFixed y_top,
- xFixed x_bot,
- xFixed y_bot)
-{
- xFixed dx, dy;
-
- e->x = x_top;
- e->e = 0;
- dx = x_bot - x_top;
- dy = y_bot - y_top;
- e->dy = dy;
- if (dy)
- {
- if (dx >= 0)
- {
- e->signdx = 1;
- e->stepx = dx / dy;
- e->dx = dx % dy;
- e->e = -dy;
- }
- else
- {
- e->signdx = -1;
- e->stepx = -(-dx / dy);
- e->dx = -dx % dy;
- e->e = 0;
- }
-
- _RenderEdgeMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small);
- _RenderEdgeMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big);
- }
- RenderEdgeStep (e, y_start - y_top);
-}
-
-/*
- * Initialize one edge structure given a line, starting y value
- * and a pixel offset for the line
- */
-void
-RenderLineFixedEdgeInit (RenderEdge *e,
- int n,
- xFixed y,
- const xLineFixed *line,
- int x_off,
- int y_off)
-{
- xFixed x_off_fixed = IntToxFixed(x_off);
- xFixed y_off_fixed = IntToxFixed(y_off);
- const xPointFixed *top, *bot;
-
- if (line->p1.y <= line->p2.y)
- {
- top = &line->p1;
- bot = &line->p2;
- }
- else
- {
- top = &line->p2;
- bot = &line->p1;
- }
- RenderEdgeInit (e, n, y,
- top->x + x_off_fixed,
- top->y + y_off_fixed,
- bot->x + x_off_fixed,
- bot->y + y_off_fixed);
-}
-
diff --git a/pixman/src/renderedge.h b/pixman/src/renderedge.h
deleted file mode 100644
index 5c7c1e540..000000000
--- a/pixman/src/renderedge.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * $Id: renderedge.h,v 1.3 2005-02-21 21:29:22 cworth Exp $
- *
- * Copyright Β© 2004 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _RENDEREDGE_H_
-#define _RENDEREDGE_H_
-
-#include "pixman-xserver-compat.h"
-
-/* Here is a drawing of the sample grid for the 4-bit alpha case,
- along with indications of the various defined terms:
-
- STEP_Y_SMALL
-β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β” ↓
-β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚ ─── βŸ΅β”€β”€ Y_FRAC_FIRST
-β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚ ───
-β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚ ↑ βŸ΅β”€β”€ Y_FRAC_LAST
-β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
-β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚
-β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚ ↓
-β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚ ───
-β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€ STEP_Y_BIG
-β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚ ───
-β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚ ↑
-β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚β€’β€’β€’β€’β€’β”‚
-β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜
- β”‚ β”‚ β”‚β”‚ βŸΆβ”‚ β”‚βŸ΅STEP_X_BIG
- β”‚ β”‚βŸΆβ”‚β”‚βŸ΅STEP_X_SMALL
- β”‚ β”‚
- β”‚ β”” X_FRAC_LAST
- β”‚
- β”” X_FRAC_FIRST
-
-N = 4 (# of bits of alpha)
-MAX_ALPHA = 15 (# of samples per pixel)
-N_X_FRAC = 5 (# of sample columns per pixel)
-N_Y_FRAC = 3 (# of sample rows per column)
-STEP_X_SMALL (distance between sample columns within a pixel)
-STEP_X_BIG (distance between sample columns across pixel boundaries)
-STEP_Y_SMALL (distance between sample rows within a pixel)
-STEP_Y_BIG (distance between sample rows across pixel boundaries)
-X_FRAC_FIRST (sub-pixel position of first sample column in pixel)
-X_FRAC_LAST (sub-pixel position of last sample column in pixel)
-Y_FRAC_FIRST (sub-pixel position of first sample row in pixel)
-Y_FRAC_LAST (sub-pixel position of last sample row pixel)
-
-*/
-
-#define MAX_ALPHA(n) ((1 << (n)) - 1)
-#define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1)
-#define N_X_FRAC(n) ((1 << ((n)/2)) + 1)
-
-#define STEP_Y_SMALL(n) (xFixed1 / N_Y_FRAC(n))
-#define STEP_Y_BIG(n) (xFixed1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
-
-#define Y_FRAC_FIRST(n) (STEP_Y_SMALL(n) / 2)
-#define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
-
-#define STEP_X_SMALL(n) (xFixed1 / N_X_FRAC(n))
-#define STEP_X_BIG(n) (xFixed1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
-
-#define X_FRAC_FIRST(n) (STEP_X_SMALL(n) / 2)
-#define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
-
-#define RenderSamplesX(x,n) ((n) == 1 ? 0 : (xFixedFrac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n))
-
-/*
- * An edge structure. This represents a single polygon edge
- * and can be quickly stepped across small or large gaps in the
- * sample grid
- */
-
-typedef struct {
- xFixed x;
- xFixed e;
- xFixed stepx;
- xFixed signdx;
- xFixed dy;
- xFixed dx;
-
- xFixed stepx_small;
- xFixed stepx_big;
- xFixed dx_small;
- xFixed dx_big;
-} RenderEdge;
-
-/*
- * Step across a small sample grid gap
- */
-#define RenderEdgeStepSmall(edge) { \
- (edge)->x += (edge)->stepx_small; \
- (edge)->e += (edge)->dx_small; \
- if ((edge)->e > 0) \
- { \
- (edge)->e -= (edge)->dy; \
- (edge)->x += (edge)->signdx; \
- } \
-}
-
-/*
- * Step across a large sample grid gap
- */
-#define RenderEdgeStepBig(edge) { \
- (edge)->x += (edge)->stepx_big; \
- (edge)->e += (edge)->dx_big; \
- if ((edge)->e > 0) \
- { \
- (edge)->e -= (edge)->dy; \
- (edge)->x += (edge)->signdx; \
- } \
-}
-
-xFixed
-RenderSampleCeilY (xFixed y, int bpp);
-
-xFixed
-RenderSampleFloorY (xFixed y, int bpp);
-
-void
-RenderEdgeStep (RenderEdge *e, int n);
-
-void
-RenderEdgeInit (RenderEdge *e,
- int bpp,
- xFixed y_start,
- xFixed x_top,
- xFixed y_top,
- xFixed x_bot,
- xFixed y_bot);
-
-void
-RenderLineFixedEdgeInit (RenderEdge *e,
- int bpp,
- xFixed y,
- const pixman_line_fixed_t *line,
- int x_off,
- int y_off);
-
-#endif /* _RENDEREDGE_H_ */
diff --git a/pixman/src/slim_internal.h b/pixman/src/slim_internal.h
deleted file mode 100644
index 5c1e5cf8a..000000000
--- a/pixman/src/slim_internal.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* slim - Shared Library Interface Macros
- *
- * Copyright Β© 2003 Richard Henderson
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of Richard Henderson
- * not be used in advertising or publicity pertaining to distribution
- * of the software without specific, written prior permission.
- * Richard Henderson makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express
- * or implied warranty.
- *
- * RICHARD HENDERSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
- * NO EVENT SHALL RICHARD HENDERSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Richard Henderson <rth@twiddle.net>
- */
-
-#ifndef _SLIM_INTERNAL_H_
-#define _SLIM_INTERNAL_H_ 1
-
-/* This macro marks a symbol as STV_HIDDEN, which prevents it from being
- added to the dynamic symbol table of the shared library. This prevents
- users of the library from knowingly or unknowingly accessing library
- internals that may change in future releases. It also allows the
- compiler to generate slightly more efficient code in some cases.
-
- The macro should be placed either immediately before the return type in
- a function declaration:
-
- pixman_private int
- somefunction(void);
-
- or after a data name,
-
- extern int somedata pixman_private;
-
- The ELF visibility attribute did not exist before gcc 3.3. */
-/* ??? Not marked with "slim" because that makes it look too much
- like the function name instead of just an attribute. */
-
-#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
-#define pixman_private __attribute__((__visibility__("hidden")))
-#else
-#define pixman_private
-#endif
-
-/* The following macros are used for PLT bypassing. First of all,
- you need to have the function prototyped somewhere, say in foo.h:
-
- int foo (int __bar);
-
- If calls to foo within libfoo.so should always go to foo defined
- in libfoo.so, then in fooint.h you add:
-
- slim_hidden_proto (foo)
-
- and after the foo function definition:
-
- int foo (int __bar)
- {
- return __bar;
- }
- slim_hidden_def (foo);
-
- This works by arranging for the C symbol "foo" to be renamed to
- "INT_foo" at the assembly level, which is marked pixman_private.
- We then create another symbol at the same address (an alias) with
- the C symbol "EXT_foo", which is renamed to "foo" at the assembly
- level. */
-
-#if __GNUC__ >= 3 && defined(__ELF__)
-# define slim_hidden_proto(name) slim_hidden_proto1(name, INT_##name)
-# define slim_hidden_def(name) slim_hidden_def1(name, INT_##name)
-# define slim_hidden_proto1(name, internal) \
- extern __typeof (name) name \
- __asm__ (slim_hidden_asmname (internal)) \
- pixman_private;
-# define slim_hidden_def1(name, internal) \
- extern __typeof (name) EXT_##name __asm__(slim_hidden_asmname(name)) \
- __attribute__((__alias__(slim_hidden_asmname(internal))))
-# define slim_hidden_ulp slim_hidden_ulp1(__USER_LABEL_PREFIX__)
-# define slim_hidden_ulp1(x) slim_hidden_ulp2(x)
-# define slim_hidden_ulp2(x) #x
-# define slim_hidden_asmname(name) slim_hidden_asmname1(name)
-# define slim_hidden_asmname1(name) slim_hidden_ulp #name
-#else
-# define slim_hidden_proto(name)
-# define slim_hidden_def(name)
-#endif
-
-#endif /* _SLIM_INTERNAL_H_ */
diff --git a/pixman/update.pl b/pixman/update.pl
deleted file mode 100644
index eb3ae33fc..000000000
--- a/pixman/update.pl
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/perl -pi~
-#
-# Helper script to update source code from the
-# libpixregion/libic functions, types, enums names to the libpixman names
-#
-# USAGE: perl update.pl FILES
-#
-# for example: perl fix.pl src/*.[ch]
-#
-# Dave Beckett 2003-12-10
-#
-
-# This order is significant.
-
-# Firstly, do special cases
-s/PixRegionBox/pixman_box16_t/g;
-s/PixRegionPointInRegion/pixman_region_contains_point/g;
-s/PixRegionRectIn/pixman_region_contains_rectangle/g;
-
-# second, enum values
-s/PixRegionStatusFailure/PIXMAN_REGION_STATUS_FAILURE/g;
-s/PixRegionStatusSuccess/PIXMAN_REGION_STATUS_SUCCESS/g;
-s/IcOperatorOverReverse/PIXMAN_OPERATOR_OVER_REVERSE/g;
-s/IcOperatorAtopReverse/PIXMAN_OPERATOR_ATOP_REVERSE/g;
-s/IcOperatorOutReverse/PIXMAN_OPERATOR_OUT_REVERSE/g;
-s/IcOperatorInReverse/PIXMAN_OPERATOR_IN_REVERSE/g;
-s/IcOperatorSaturate/PIXMAN_OPERATOR_SATURATE/g;
-s/IcFormatNameARGB32/PIXMAN_FORMAT_NAME_AR_GB32/g;
-s/IcFormatNameRGB24/PIXMAN_FORMAT_NAME_RG_B24/g;
-s/IcFilterBilinear/PIXMAN_FILTER_BILINEAR/g;
-s/IcOperatorClear/PIXMAN_OPERATOR_CLEAR/g;
-s/IcFilterNearest/PIXMAN_FILTER_NEAREST/g;
-s/IcOperatorOver/PIXMAN_OPERATOR_OVER/g;
-s/IcOperatorAtop/PIXMAN_OPERATOR_ATOP/g;
-s/IcFormatNameA8/PIXMAN_FORMAT_NAME_A8/g;
-s/IcFormatNameA1/PIXMAN_FORMAT_NAME_A1/g;
-s/IcOperatorSrc/PIXMAN_OPERATOR_SRC/g;
-s/IcOperatorDst/PIXMAN_OPERATOR_DST/g;
-s/IcOperatorOut/PIXMAN_OPERATOR_OUT/g;
-s/IcOperatorXor/PIXMAN_OPERATOR_XOR/g;
-s/IcOperatorAdd/PIXMAN_OPERATOR_ADD/g;
-s/IcOperatorIn/PIXMAN_OPERATOR_IN/g;
-s/IcFilterFast/PIXMAN_FILTER_FAST/g;
-s/IcFilterGood/PIXMAN_FILTER_GOOD/g;
-s/IcFilterBest/PIXMAN_FILTER_BEST/g;
-
-# next enum types (shorter names than above and may prefix them)
-s/IcBits/pixman_bits_t/g;
-s/IcColor/pixman_color_t/g;
-s/IcFixed16_16/pixman_fixed16_16_t/g;
-s/IcFormat/pixman_format_t/g;
-s/IcImage/pixman_image_t/g;
-s/IcLineFixed/pixman_line_fixed_t/g;
-s/IcPointFixed/pixman_point_fixed_t/g;
-s/IcRectangle/pixman_rectangle_t/g;
-s/IcTransform/pixman_transform_t/g;
-s/IcTrapezoid/pixman_trapezoid_t/g;
-s/IcTriangle/pixman_triangle_t/g;
-s/IcVector/pixman_vector_t/g;
-s/IcOperator/pixman_operator_t/g;
-s/IcFilter/pixman_filter_t/g;
-s/IcFormatName/pixman_format_name_t/g;
-s/PixRegionStatus/pixman_region_status_t/g;
-
-# functions (which also may have the type name)
-s/PixRegionAppend/pixman_region_append/g;
-s/PixRegionCopy/pixman_region_copy/g;
-s/PixRegionCreate/pixman_region_create/g;
-s/PixRegionCreateSimple/pixman_region_create_simple/g;
-s/PixRegionDestroy/pixman_region_destroy/g;
-s/PixRegionEmpty/pixman_region_empty/g;
-s/PixRegionExtents/pixman_region_extents/g;
-s/PixRegionIntersect/pixman_region_intersect/g;
-s/PixRegionInverse/pixman_region_inverse/g;
-s/PixRegionNotEmpty/pixman_region_not_empty/g;
-s/PixRegionNumRects/pixman_region_num_rects/g;
-s/PixRegionPointInRegion/pixman_region_point_in_region/g;
-s/PixRegionRectIn/pixman_region_rect_in/g;
-s/PixRegionRects/pixman_region_rects/g;
-s/PixRegionReset/pixman_region_reset/g;
-s/PixRegionSubtract/pixman_region_subtract/g;
-s/PixRegionTranslate/pixman_region_translate/g;
-s/PixRegionUnion/pixman_region_union/g;
-s/PixRegionUnionRect/pixman_region_union_rect/g;
-s/PixRegionValidate/pixman_region_validate/g;
-s/IcColorToPixel/pixman_color_to_pixel/g;
-s/IcComposite/pixman_composite/g;
-s/IcCompositeTrapezoids/pixman_composite_trapezoids/g;
-s/IcCompositeTriFan/pixman_composite_tri_fan/g;
-s/IcCompositeTriStrip/pixman_composite_tri_strip/g;
-s/IcCompositeTriangles/pixman_composite_triangles/g;
-s/IcFillRectangle/pixman_fill_rectangle/g;
-s/IcFillRectangles/pixman_fill_rectangles/g;
-s/IcFormatCreate/pixman_format_create/g;
-s/IcFormatCreateMasks/pixman_format_create_masks/g;
-s/IcFormatDestroy/pixman_format_destroy/g;
-s/IcImageCreate/pixman_image_create/g;
-s/IcImageCreateForData/pixman_image_create_for_data/g;
-s/IcImageDestroy/pixman_image_destroy/g;
-s/IcImageGetData/pixman_image_get_data/g;
-s/IcImageGetDepth/pixman_image_get_depth/g;
-s/IcImageGetHeight/pixman_image_get_height/g;
-s/IcImageGetStride/pixman_image_get_stride/g;
-s/IcImageGetWidth/pixman_image_get_width/g;
-s/IcImageSetClipRegion/pixman_image_set_clip_region/g;
-s/IcImageSetFilter/pixman_image_set_filter/g;
-s/IcImageSetRepeat/pixman_image_set_repeat/g;
-s/IcImageSetTransform/pixman_image_set_transform/g;
-s/IcPixelToColor/pixman_pixel_to_color/g;
-# finally the type that is the most generic
-s/PixRegion/pixman_region16_t/g;
-
-# correct over-eager renames made above
-s/pixman_bits_tPerPixel/pixman_bits_per_pixel/g;
-s/pixman_color_tToPixel/pixman_color_to_pixel/g;
-s/pixman_format_tCreate/pixman_format_create/g;
-s/pixman_format_tCreateMasks/pixman_format_create_masks/g;
-s/pixman_format_tDestroy/pixman_format_destroy/g;
-s/pixman_format_tInit/pixman_format_init/g;
-s/pixman_image_tCreate/pixman_image_create/g;
-s/pixman_image_tCreateForData/pixman_image_create_for_data/g;
-s/pixman_image_tCreateForPixels/pixman_image_create_for_pixels/g;
-s/pixman_image_tDestroy/pixman_image_destroy/g;
-s/pixman_image_tDestroyClip/pixman_image_destroy_clip/g;
-s/pixman_image_tGetData/pixman_image_get_data/g;
-s/pixman_image_tGetDepth/pixman_image_get_depth/g;
-s/pixman_image_tGetHeight/pixman_image_get_height/g;
-s/pixman_image_tGetStride/pixman_image_get_stride/g;
-s/pixman_image_tGetWidth/pixman_image_get_width/g;
-s/pixman_image_tInit/pixman_image_init/g;
-s/pixman_image_tSetClipRegion/pixman_image_set_clip_region/g;
-s/pixman_image_tSetFilter/pixman_image_set_filter/g;
-s/pixman_image_tSetRepeat/pixman_image_set_repeat/g;
-s/pixman_image_tSetTransform/pixman_image_set_transform/g;
-s/pixman_line_fixed_tX/pixman_line_fixed_x/g;
-s/pixman_point_fixed_tBounds/pixman_point_fixed_bounds/g;
-s/pixman_region16_tBreak/pixman_break/g;
-s/pixman_region16_tBrokenData/pixman_brokendata/g;
-s/pixman_region16_tBrokenRegion/pixman_brokenregion/g;
-s/pixman_region16_tCoalesce/pixman_coalesce/g;
-s/pixman_region16_tInit/pixman_init/g;
-s/pixman_region16_tOp/pixman_op/g;
-s/pixman_region16_tRectAlloc/pixman_rect_alloc/g;
-s/pixman_region16_tSetExtents/pixman_set_extents/g;
-s/pixman_region16_tUninit/pixman_uninit/g;
-s/pixman_transform_tPoint/pixman_transform_point/g;
-s/pixman_trapezoid_tBounds/pixman_trapezoid_bounds/g;
-s/pixman_triangle_tBounds/pixman_triangle_bounds/g;
-
-# fixes for wrong order of renames
-s/pixman_region_createSimple/pixman_region_create_simple/g;
-s/pixman_region_unionRect/pixman_region_union_rect/g;
-s/pixman_format_createMasks/pixman_format_create_masks/g;
-s/pixman_image_createForData/pixman_image_create_for_data/g;
-s/pixman_image_tGetFormat/pixman_image_get_format/g;
-s/pixman_compositeTrapezoids/pixman_composite_trapezoids/g;
-s/pixman_compositeTriangles/pixman_composite_triangles/g;
-s/pixman_compositeTriStrip/pixman_composite_tri_strip/g;
-s/pixman_compositeTriFan/pixman_composite_tri_fang;