pixman: Changes to 'upstream-unstable'
.gitignore | 5 ++++
README | 26 +++++++++++++++++++++
configure.ac | 45 ++++++++++++++++++++++++++++++++------
pixman/Makefile.am | 15 +++---------
pixman/Makefile.win32 | 31 ++++++++++++++++++++++++++
pixman/pixman-compose-accessors.c | 4 +++
pixman/pixman-compose.c | 12 +++++-----
pixman/pixman-compute-region.c | 3 ++
pixman/pixman-edge-accessors.c | 4 +++
pixman/pixman-edge.c | 4 +++
pixman/pixman-image.c | 36 +++++++++++++++++++++++++++---
pixman/pixman-mmx.c | 7 ++---
pixman/pixman-pict.c | 6 +++--
pixman/pixman-private.h | 27 ++++++++++++++++++++++
pixman/pixman-region.c | 14 +++++++++++
pixman/pixman-timer.c | 7 +++++
pixman/pixman-trap.c | 3 ++
pixman/pixman-utils.c | 17 ++++++++++++++
pixman/pixman.h | 4 +--
19 files changed, 236 insertions(+), 34 deletions(-)
New commits:
commit b39ca42fce85248f6c19459388f71bf73a147792
Author: Søren Sandmann Pedersen <sandmann@redhat.com>
Date: Wed Oct 24 15:48:45 2007 -0400
Bump version number
diff --git a/configure.ac b/configure.ac
index fded892..22a91ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,7 +42,7 @@ AC_PREREQ([2.57])
m4_define([pixman_major], 0)
m4_define([pixman_minor], 9)
-m4_define([pixman_micro], 5)
+m4_define([pixman_micro], 6)
m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
commit 28532430efeb4a1aba8f3e30a790531d2a9e1472
Author: Søren Sandmann <sandmann@redhat.com>
Date: Wed Oct 17 20:01:27 2007 -0400
Only compile with -msse on x86-64.
diff --git a/configure.ac b/configure.ac
index 5bb6c27..fded892 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,10 +86,10 @@ if test "x$GCC" = "xyes"; then
dnl ===========================================================================
dnl Check for MMX
-MMX_CFLAGS="-mmmx -msse -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
+MMX_CFLAGS="-mmmx -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
have_mmx_intrinsics=no
-AC_MSG_CHECKING(For MMX/SSE intrinsics in the compiler)
+AC_MSG_CHECKING(whether to use MMX intrinsics)
xserver_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MMX_CFLAGS"
AC_COMPILE_IFELSE([
@@ -97,10 +97,8 @@ AC_COMPILE_IFELSE([
#error "Need GCC >= 3.4 for MMX intrinsics"
#endif
#include <mmintrin.h>
-#include <xmmintrin.h>
int main () {
__m64 v = _mm_cvtsi32_si64 (1);
- v = _mm_shuffle_pi16 (v, _MM_SHUFFLE(3, 3, 3, 3));
return _mm_cvtsi64_si32 (v);
}], have_mmx_intrinsics=yes)
CFLAGS=$xserver_save_CFLAGS
@@ -111,11 +109,46 @@ if test $have_mmx_intrinsics = yes ; then
else
MMX_CFLAGS=
fi
-AC_SUBST(MMX_CFLAGS)
AM_CONDITIONAL(USE_MMX, test $have_mmx_intrinsics = yes)
+dnl =======================================================
+
+dnl GCC 4.2 when compiling with -msse will generate SSE instructions
+dnl on its own. This means anything compiled with -mss can only be
+dnl run after a runtime check for SSE. Unfortunately, since we still
+dnl need to support MMX-but-not-SSE (such as the OLPC), this means we
+dnl can only use SSE when compiling for x86-64 (where SSE is always
+dnl supported).
+
+have_sse_intrinsics=no
+AC_MSG_CHECKING(whether to use SSE intrinsics)
+xserver_save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -msse $MMX_CFLAGS"
+
+AC_COMPILE_IFELSE([
+#if !defined(__amd64__) && !defined(__x86_64__)
+#error "Need x86-64 for SSE"
+#endif
+#include <mmintrin.h>
+#include <xmmintrin.h>
+int main () {
+ __m64 v = _mm_cvtsi32_si64 (1);
+ v = _mm_shuffle_pi16 (v, _MM_SHUFFLE(3, 3, 3, 3));
+ return _mm_cvtsi64_si32 (v);
+}], have_sse_intrinsics=yes)
+CFLAGS=$xserver_save_CFLAGS
+AC_MSG_RESULT($have_sse_intrinsics)
+
+if test $have_sse_intrinsics = yes ; then
+ AC_DEFINE(USE_SSE, 1, [use SSE compiler intrinsics])
+ MMX_CFLAGS="-msse $MMX_CFLAGS"
+fi
+
+AM_CONDITIONAL(USE_SSE, test $have_sse_intrinsics = yes)
+
dnl ========================================================
+AC_SUBST(MMX_CFLAGS)
PKG_CHECK_MODULES(GTK, [gtk+-2.0], [HAVE_GTK=yes], [HAVE_GTK=no])
AM_CONDITIONAL(HAVE_GTK, [test "x$HAVE_GTK" = xyes])
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index be79124..52061c7 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -35,10 +35,6 @@
#ifdef USE_MMX
-#if defined(__amd64__) || defined(__x86_64__)
-#define USE_SSE
-#endif
-
#include <mmintrin.h>
#ifdef USE_SSE
#include <xmmintrin.h> /* for _mm_shuffle_pi16 and _MM_SHUFFLE */
commit ab6743b17074dfedffb0ee32fe2e37cad03769bf
Author: Søren Sandmann <sandmann@redhat.com>
Date: Wed Oct 17 19:20:55 2007 -0400
Make stride signed in various places. This should fix some the
crashers that people have reported in bug 12398.
diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c
index 1e91864..4c73822 100644
--- a/pixman/pixman-compose.c
+++ b/pixman/pixman-compose.c
@@ -2880,7 +2880,7 @@ static void fbFetchSolid(bits_image_t * pict, int x, int y, int width, uint32_t
static void fbFetch(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
{
uint32_t *bits;
- uint32_t stride;
+ int32_t stride;
fetchProc fetch = fetchProcForPicture(pict);
const pixman_indexed_t * indexed = pict->indexed;
@@ -3560,7 +3560,7 @@ static void pixmanFetchSourcePict(source_image_t * pict, int x, int y, int width
static void fbFetchTransformed(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
{
uint32_t *bits;
- uint32_t stride;
+ int32_t stride;
fetchPixelProc fetch;
pixman_vector_t v;
pixman_vector_t unit;
@@ -4093,7 +4093,7 @@ static void fbFetchExternalAlpha(bits_image_t * pict, int x, int y, int width, u
static void fbStore(bits_image_t * pict, int x, int y, int width, uint32_t *buffer)
{
uint32_t *bits;
- uint32_t stride;
+ int32_t stride;
storeProc store = storeProcForPicture(pict);
const pixman_indexed_t * indexed = pict->indexed;
@@ -4107,7 +4107,7 @@ static void fbStore(bits_image_t * pict, int x, int y, int width, uint32_t *buff
static void fbStoreExternalAlpha(bits_image_t * pict, int x, int y, int width, uint32_t *buffer)
{
uint32_t *bits, *alpha_bits;
- uint32_t stride, astride;
+ int32_t stride, astride;
int ax, ay;
storeProc store;
storeProc astore;
@@ -4163,7 +4163,7 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
unsigned int srcClass = SOURCE_IMAGE_CLASS_UNKNOWN;
unsigned int maskClass = SOURCE_IMAGE_CLASS_UNKNOWN;
uint32_t *bits;
- uint32_t stride;
+ int32_t stride;
int xoff, yoff;
if (data->op == PIXMAN_OP_CLEAR)
commit aca8b610d9ab178fcbcfa4a44d87e52aa7918ea4
Author: Søren Sandmann <sandmann@redhat.com>
Date: Wed Oct 17 18:43:13 2007 -0400
Remove comma from enumerator list. Bug 12621, reported by Matt Kraai.
diff --git a/pixman/pixman.h b/pixman/pixman.h
index a22dfd9..7b93214 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -452,7 +452,7 @@ typedef enum {
/* 1bpp formats */
PIXMAN_a1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_A,1,0,0,0),
- PIXMAN_g1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_GRAY,0,0,0,0),
+ PIXMAN_g1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_GRAY,0,0,0,0)
} pixman_format_code_t;
/* Constructors */
commit 089c3e6ad00105b2f9a1118d15b4f381653ea6ff
Author: Søren Sandmann <sandmann@redhat.com>
Date: Wed Oct 17 18:40:28 2007 -0400
Add README file based on text from Bjorn Lindquist
diff --git a/README b/README
index e69de29..94b830c 100644
--- a/README
+++ b/README
@@ -0,0 +1,26 @@
+pixman is a library that provides low-level pixel manipulation
+features such as image compositing and trapezoid rasterization.
+
+Please submit bugs & patches to the libpixman bugzilla:
+
+ https://bugs.freedesktop.org/enter_bug.cgi?product=libpixman
+
+All questions regarding this software should be directed to either the
+Xorg mailing list:
+
+ http://lists.freedesktop.org/mailman/listinfo/xorg
+
+or the cairo mailing list:
+
+ http://lists.freedesktop.org/mailman/listinfo/cairo
+
+The master development code repository can be found at:
+
+ git://anongit.freedesktop.org/git/pixman
+
+ http://gitweb.freedesktop.org/?p=pixman;a=summary
+
+For more information on the git code manager, see:
+
+ http://wiki.x.org/wiki/GitPage
+
commit 39a67d35f05aa47cf50191e0837a2125593a7bbc
Author: Tilman Sauerbeck <tilman@code-monkey.de>
Date: Sat Sep 29 22:45:42 2007 +0200
Fixed the declaration of pixman_image_set_source_clipping().
diff --git a/pixman/pixman.h b/pixman/pixman.h
index d76cc12..a22dfd9 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -498,7 +498,7 @@ pixman_bool_t pixman_image_set_filter (pixman_image_t
void pixman_image_set_filter_params (pixman_image_t *image,
pixman_fixed_t *params,
int n_params);
-void pixman_image_set_source_cliping (pixman_image_t *image,
+void pixman_image_set_source_clipping (pixman_image_t *image,
pixman_bool_t source_clipping);
void pixman_image_set_alpha_map (pixman_image_t *image,
pixman_image_t *alpha_map,
commit 7f820e15070c9b9618d78425b8cb1a4df722eb22
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Sep 27 12:46:46 2007 +0100
[pixman-image] [mlk] Free the locally allocated bits.
If we fail to allocate the image, remember to free the bits if we have
created the buffer on behalf of the caller.
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index de799b1..d40234d 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -359,8 +359,11 @@ pixman_image_create_bits (pixman_format_code_t format,
image = allocate_image();
- if (!image)
+ if (!image) {
+ if (free_me)
+ free (free_me);
return NULL;
+ }
image->type = BITS;
image->bits.format = format;
commit b4f0cc6eeaff8d5ea114734fcfa293fce1904ce4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Sep 27 12:44:44 2007 +0100
[pixman-image] Avoid a potential malloc(0).
Do not attempt to allocate bits if either the image width or height is
0 - Cairo has a habit of attempting to create such surfaces when
generating glyphs. The malloc(0) may return a NULL pointer and be treated
as an out-of-memory error.
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 986f8ab..de799b1 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -350,7 +350,7 @@ pixman_image_create_bits (pixman_format_code_t format,
return_val_if_fail (bits == NULL ||
(rowstride_bytes % sizeof (uint32_t)) == 0, NULL);
- if (!bits)
+ if (!bits && width && height)
{
free_me = bits = create_bits (format, width, height, &rowstride_bytes);
if (!bits)
commit 958a650b8eb1b61143122c3ad1f9b637b6467984
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Sep 27 12:40:59 2007 +0100
[pixman-image] Avoid integer overflow when allocating bits.
Check for potential overflows at every step of the calculation of the
buffer size required for the pixels.
(Fixes https://bugs.freedesktop.org/show_bug.cgi?id=11627)
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index fa32208..986f8ab 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -285,9 +285,32 @@ create_bits (pixman_format_code_t format,
int stride;
int buf_size;
int bpp;
-
+
+ /* what follows is a long-winded way, avoiding any possibility of integer
+ * overflows, of saying:
+ * stride = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (uint32_t);
+ */
+
bpp = PIXMAN_FORMAT_BPP (format);
- stride = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (uint32_t);
+ if (pixman_multiply_overflows_int (width, bpp))
+ return NULL;
+
+ stride = width * bpp;
+ if (pixman_addition_overflows_int (stride, FB_MASK))
+ return NULL;
+
+ stride += FB_MASK;
+ stride >>= FB_SHIFT;
+
+#if FB_SHIFT < 2
+ if (pixman_multiply_overflows_int (stride, sizeof (uint32_t)))
+ return NULL;
+#endif
+ stride *= sizeof (uint32_t);
+
+ if (pixman_multiply_overflows_int (height, stride))
+ return NULL;
+
buf_size = height * stride;
if (rowstride_bytes)
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 6487bfd..0c5942f 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -69,6 +69,8 @@
/* Memory allocation helpers */
void *pixman_malloc_ab (unsigned int n, unsigned int b);
void *pixman_malloc_abc (unsigned int a, unsigned int b, unsigned int c);
+pixman_bool_t pixman_multiply_overflows_int (unsigned int a, unsigned int b);
+pixman_bool_t pixman_addition_overflows_int (unsigned int a, unsigned int b);
#if DEBUG
diff --git a/pixman/pixman-utils.c b/pixman/pixman-utils.c
index fc93608..1d1dec9 100644
--- a/pixman/pixman-utils.c
+++ b/pixman/pixman-utils.c
@@ -371,6 +371,20 @@ pixman_line_fixed_edge_init (pixman_edge_t *e,
bot->y + y_off_fixed);
}
+pixman_bool_t
+pixman_multiply_overflows_int (unsigned int a,
+ unsigned int b)
+{
+ return a >= INT32_MAX / b;
+}
+
+pixman_bool_t
+pixman_addition_overflows_int (unsigned int a,
+ unsigned int b)
+{
+ return a > INT32_MAX - b;
+}
+
void *
pixman_malloc_ab(unsigned int a,
unsigned int b)
commit 5b60c91fd6865021aa6027ee65fa8371a4e2d297
Author: Jeff Muizelaar <jeff@freiheit.infidigm.net>
Date: Thu Sep 20 15:40:17 2007 -0400
Fix special case selection when the mask has a transform
http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=c19ece1d8c32dc81740a4036a642661f54064e75
was a mismerge that avoided setting the maskTransform condition when the mask
has a transform. This allowed a special case routine to be chosen when the
mask had a transform, which is not expected by the special case routines.
diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index 3bc5267..d6564ff 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -1429,6 +1429,7 @@ pixman_image_composite (pixman_op_t op,
{
maskRepeat = pMask->common.repeat == PIXMAN_REPEAT_NORMAL;
+ maskTransform = pMask->common.transform != 0;
if (pMask->common.filter == PIXMAN_FILTER_CONVOLUTION)
maskTransform = TRUE;
commit 3be35594c99b7abd2af43b66349ca53bfa1462d6
Author: Carl Worth <cworth@cworth.org>
Date: Tue Sep 11 16:29:06 2007 +0100
Fix build breakage when under the influence of USE_MMX
This was recently broken (dc7c047d1c68f343b66e81d9e79084e4171e2634) when
removing an assignment to noinst_LTLIBRARIES.
diff --git a/pixman/Makefile.am b/pixman/Makefile.am
index b7138e4..66283a2 100644
--- a/pixman/Makefile.am
+++ b/pixman/Makefile.am
@@ -22,7 +22,7 @@ libpixmaninclude_HEADERS = pixman.h
# mmx code
if USE_MMX
-noinst_LTLIBRARIES += libpixman-mmx.la
+noinst_LTLIBRARIES = libpixman-mmx.la
libpixman_mmx_la_SOURCES = \
pixman-mmx.c \
pixman-mmx.h
commit dc7c047d1c68f343b66e81d9e79084e4171e2634
Author: Vladimir Vukicevic <vladimir@pobox.com>
Date: Mon Sep 10 15:20:44 2007 -0700
[memlk] don't try to allocate new data for 0-rectangle regions
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index fff49e7..ac23806 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -2518,6 +2518,8 @@ pixman_region_init_rects (pixman_region16_t *region,
{
int overlap;
+ /* if it's 1, then we just want to set the extents, so call
+ * the existing method. */
if (count == 1) {
pixman_region_init_rect(region,
boxes[0].x1,
@@ -2528,6 +2530,15 @@ pixman_region_init_rects (pixman_region16_t *region,
}
pixman_region_init(region);
+
+ /* if it's 0, don't call pixman_rect_alloc -- 0 rectangles is
+ * a special case, and causing pixman_rect_alloc would cause
+ * us to leak memory (because the 0-rect case should be the
+ * static pixman_region_emptyData data).
+ */
+ if (count == 0)
+ return TRUE;
+
if (!pixman_rect_alloc(region, count))
return FALSE;
commit 1b098ede1938d1225c32cf5639e4c7a891859897
Author: Vladimir Vukicevic <vladimir@pobox.com>
Date: Tue Sep 4 11:19:33 2007 -0700
[win32] Makefile and compilation fixes for win32
diff --git a/.gitignore b/.gitignore
index ee2f0a3..7f08f61 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,8 @@ config.h.in
.*.swp
test/composite-test
test/gradient-test
+*.pdb
+*.dll
+*.lib
+*.ilk
+*.obj
diff --git a/pixman/Makefile.win32 b/pixman/Makefile.win32
new file mode 100644
index 0000000..e0a1828
--- /dev/null
+++ b/pixman/Makefile.win32
@@ -0,0 +1,31 @@
+LIBRARY = pixman-1
+
+CC = cl
+LINK = link
+
+CFLAGS = -MD -Zi -nologo -O2 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
+
+SOURCES = \
+ pixman-region.c \
+ pixman-image.c \
+ pixman-compose.c \
+ pixman-compose-accessors.c \
+ pixman-pict.c \
+ pixman-utils.c \
+ pixman-edge.c \
+ pixman-edge-accessors.c \
+ pixman-trap.c \
+ pixman-compute-region.c \
+ pixman-timer.c \
+ $(NULL)
+
+OBJECTS = $(subst .c,.obj,$(SOURCES))
+
+%.obj: %.c
+ @$(CC) -c $(CFLAGS) -Fo"$@" $<
+
+$(LIBRARY).lib: $(OBJECTS)
+ lib -NOLOGO -OUT:$@ $(OBJECTS)
+
+clean:
+ @rm -f *.obj *.lib *.pdb *.ilk || exit 0
diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c
index b48251d..1e91864 100644
--- a/pixman/pixman-compose.c
+++ b/pixman/pixman-compose.c
@@ -23,7 +23,9 @@
* SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <stdlib.h>
#include <string.h>
diff --git a/pixman/pixman-compute-region.c b/pixman/pixman-compute-region.c
index f9b9de7..1e566a9 100644
--- a/pixman/pixman-compute-region.c
+++ b/pixman/pixman-compute-region.c
@@ -21,7 +21,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include "pixman-private.h"
diff --git a/pixman/pixman-edge.c b/pixman/pixman-edge.c
index 24758c3..12c1967 100644
--- a/pixman/pixman-edge.c
+++ b/pixman/pixman-edge.c
@@ -21,7 +21,11 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <string.h>
#include "pixman.h"
#include "pixman-private.h"
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index c39ee9b..fa32208 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -20,7 +20,9 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <stdlib.h>
#include <stdio.h>
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 8c7be6d..be79124 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -28,7 +28,10 @@
*
* Based on work by Owen Taylor
*/
+
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#ifdef USE_MMX
diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index c7d73fc..3bc5267 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -22,7 +22,10 @@
* Author: Keith Packard, SuSE, Inc.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 775f7a7..6487bfd 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -37,6 +37,28 @@
# define FUNC ((const char*) ("???"))
#endif
+#ifndef INT16_MIN
+# define INT16_MIN (-32767-1)
+# define INT16_MAX (32767)
+#endif
+
+#ifndef INT32_MIN
+# define INT32_MIN (-2147483647-1)
+# define INT32_MAX (2147483647)
+#endif
+
+#ifndef UINT32_MIN
+# define UINT32_MIN (0)
+# define UINT32_MAX (4294967295U)
+#endif
+
+#ifndef M_PI
+# define M_PI 3.14159265358979323846
+#endif
+
+#ifdef _MSC_VER
+#define inline __inline
+#endif
#define FB_SHIFT 5
#define FB_UNIT (1 << FB_SHIFT)
@@ -774,6 +796,8 @@ pixman_rasterize_edges_accessors (pixman_image_t *image,
pixman_fixed_t b);
+#ifdef PIXMAN_TIMING
+
/* Timing */
static inline uint64_t
oil_profile_stamp_rdtsc (void)
@@ -817,5 +841,6 @@ void pixman_timer_register (PixmanTimer *timer);
timer##tname.total += OIL_STAMP() - begin##tname; \
}
+#endif /* PIXMAN_TIMING */
#endif /* PIXMAN_PRIVATE_H */
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 94b6dcc..fff49e7 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -45,7 +45,10 @@ SOFTWARE.
******************************************************************/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <stdlib.h>
#include <limits.h>
#include <string.h>
diff --git a/pixman/pixman-timer.c b/pixman/pixman-timer.c
index c762644..ce54e74 100644
--- a/pixman/pixman-timer.c
+++ b/pixman/pixman-timer.c
@@ -19,11 +19,16 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include "pixman-private.h"
+#ifdef PIXMAN_TIMER
+
static PixmanTimer *timers;
static void
@@ -57,3 +62,5 @@ pixman_timer_register (PixmanTimer *timer)
timer->next = timers;
timers = timer;
}
+
+#endif
diff --git a/pixman/pixman-trap.c b/pixman/pixman-trap.c
index 204ca04..ed32e92 100644
--- a/pixman/pixman-trap.c
+++ b/pixman/pixman-trap.c
@@ -22,7 +22,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <stdio.h>
#include "pixman-private.h"
diff --git a/pixman/pixman-utils.c b/pixman/pixman-utils.c
index cdf115d..fc93608 100644
--- a/pixman/pixman-utils.c
+++ b/pixman/pixman-utils.c
@@ -21,7 +21,10 @@
* Author: Keith Packard, SuSE, Inc.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <stdlib.h>
#include "pixman.h"
#include "pixman-private.h"
commit 5fc4d5ab1fae8677f5a95f5eb0e4fad3a9e0bf82
Author: Vladimir Vukicevic <vladimir@pobox.com>
Date: Tue Sep 4 11:18:40 2007 -0700
compilation: build edge/compose with accessors separately
Simplify the build by creating a new file for pixman-compose and
pixman-edge built with accessor functions.
diff --git a/pixman/Makefile.am b/pixman/Makefile.am
index 708e0dd..b7138e4 100644
--- a/pixman/Makefile.am
+++ b/pixman/Makefile.am
@@ -1,15 +1,17 @@
lib_LTLIBRARIES = libpixman-1.la
libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO)
-libpixman_1_la_LIBADD = @DEP_LIBS@ -lm libpixmanwrapper.la
+libpixman_1_la_LIBADD = @DEP_LIBS@ -lm
libpixman_1_la_SOURCES = \
pixman.h \
pixman-region.c \
pixman-private.h \
pixman-image.c \
pixman-compose.c \
+ pixman-compose-accessors.c \
pixman-pict.c \
pixman-utils.c \
pixman-edge.c \
+ pixman-edge-accessors.c \
pixman-edge-imp.h \
pixman-trap.c \
pixman-compute-region.c \
@@ -18,15 +20,6 @@ libpixman_1_la_SOURCES = \
libpixmanincludedir = $(includedir)/pixman-1/
libpixmaninclude_HEADERS = pixman.h
-# wrapper library
-noinst_LTLIBRARIES = libpixmanwrapper.la
-libpixmanwrapper_la_SOURCES = \
- pixman-compose.c \
- pixman-edge.c
-libpixmanwrapper_la_CFLAGS = $(DEP_CFLAGS) -DPIXMAN_FB_ACCESSORS
-
-
-
# mmx code
if USE_MMX
noinst_LTLIBRARIES += libpixman-mmx.la
diff --git a/pixman/pixman-compose-accessors.c b/pixman/pixman-compose-accessors.c
new file mode 100644
index 0000000..5393cf4
--- /dev/null
+++ b/pixman/pixman-compose-accessors.c
@@ -0,0 +1,4 @@
+
+#define PIXMAN_FB_ACCESSORS
+
+#include "pixman-compose.c"
diff --git a/pixman/pixman-edge-accessors.c b/pixman/pixman-edge-accessors.c
new file mode 100644
index 0000000..ea3a31e
--- /dev/null
+++ b/pixman/pixman-edge-accessors.c
@@ -0,0 +1,4 @@
+
+#define PIXMAN_FB_ACCESSORS
+
+#include "pixman-edge.c"
commit 6b96b62ca419ac414d5715a4ba9f30664e510fcd
Author: Carl Worth <cworth@cworth.org>
Date: Tue Sep 4 17:24:04 2007 -0700
Don't copy unused bits to an alpha channel
This bug was identified by cairo's rgb24-ignore-alpha test which
blends RGB24 over ARGB32 and notices that "alpha" values are
making it from the source to the destination.
diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index b8b7b76..c7d73fc 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -1778,7 +1778,6 @@ pixman_image_composite (pixman_op_t op,
break;
case PIXMAN_x8r8g8b8:
switch (pDst->bits.format) {
- case PIXMAN_a8r8g8b8:
case PIXMAN_x8r8g8b8:
#ifdef USE_MMX
if (pixman_have_mmx())
@@ -1790,7 +1789,6 @@ pixman_image_composite (pixman_op_t op,
}
case PIXMAN_x8b8g8r8:
switch (pDst->bits.format) {
- case PIXMAN_a8b8g8r8:
case PIXMAN_x8b8g8r8:
#ifdef USE_MMX
if (pixman_have_mmx())
Reply to: