gecko-dev/gfx/cairo/mozilla-misc.patch

258 lines
7.2 KiB
Diff

Index: pixman/src/pixman-xserver-compat.h
===================================================================
--- pixman/src/pixman-xserver-compat.h.orig 2005-08-10 21:10:13.000000000 -0700
+++ pixman/src/pixman-xserver-compat.h 2006-02-02 16:00:06.109375000 -0800
@@ -72,8 +72,8 @@
#define FB_SHIFT IC_SHIFT
#define FB_MASK IC_MASK
#define FB_ALLONES IC_ALLONES
+#define FbMaskBits IcMaskBits
*/
-//#define FbMaskBits IcMaskBits
/* XXX: We changed some function and field names which makes for some
* ugly hacks... */
Index: pixman/src/pixregion.c
===================================================================
--- pixman/src/pixregion.c.orig 2005-08-22 12:15:28.000000000 -0700
+++ pixman/src/pixregion.c 2006-02-02 16:00:06.109375000 -0800
@@ -60,7 +60,7 @@
#endif
#undef assert
-#ifdef DEBUG
+#ifdef DEBUG_PIXREGION
#define assert(expr) {if (!(expr)) \
FatalError("Assertion failed file %s, line %d: expr\n", \
__FILE__, __LINE__); }
@@ -208,7 +208,7 @@
}
-#ifdef DEBUG
+#ifdef DEBUG_PIXREGION
int
pixman_region16_print(rgn)
pixman_region16_t * rgn;
@@ -302,7 +302,7 @@
}
}
-#endif /* DEBUG */
+#endif /* DEBUG_PIXREGION */
/* Create a new empty region */
Index: src/cairo-gstate.c
===================================================================
--- src/cairo-gstate.c.orig 2006-01-06 14:11:07.000000000 -0800
+++ src/cairo-gstate.c 2006-02-02 16:00:06.125000000 -0800
@@ -241,6 +241,13 @@
return gstate;
}
+void
+_moz_cairo_gstate_set_target (cairo_gstate_t *gstate, cairo_surface_t *target)
+{
+ cairo_surface_destroy (gstate->target);
+ gstate->target = cairo_surface_reference (target);
+}
+
/* Push rendering off to an off-screen group. */
/* XXX: Rethinking this API
cairo_status_t
Index: src/cairo.c
===================================================================
--- src/cairo.c.orig 2006-01-18 09:46:42.000000000 -0800
+++ src/cairo.c 2006-02-02 16:00:06.125000000 -0800
@@ -324,6 +324,29 @@
}
slim_hidden_def(cairo_restore);
+/**
+ * moz_cairo_set_target:
+ * @cr: a #cairo_t
+ * @target: a #cairo_surface_t
+ *
+ * Change the destination surface of rendering to @cr to @target.
+ * @target must not be %NULL, or an error will be set on @cr.
+ */
+void
+moz_cairo_set_target (cairo_t *cr, cairo_surface_t *target)
+{
+ if (cr->status)
+ return;
+
+ if (target == NULL) {
+ _cairo_set_error (cr, CAIRO_STATUS_NULL_POINTER);
+ return;
+ }
+
+ _moz_cairo_gstate_set_target (cr->gstate, target);
+}
+slim_hidden_def(moz_cairo_set_target);
+
/* XXX: I want to rethink this API
void
cairo_push_group (cairo_t *cr)
Index: src/cairo.h
===================================================================
--- src/cairo.h.orig 2006-01-22 02:33:26.000000000 -0800
+++ src/cairo.h 2006-02-02 16:00:06.125000000 -0800
@@ -252,6 +252,9 @@
cairo_public void
cairo_restore (cairo_t *cr);
+cairo_public void
+moz_cairo_set_target (cairo_t *cr, cairo_surface_t *target);
+
/* XXX: I want to rethink this API
cairo_public void
cairo_push_group (cairo_t *cr);
Index: src/cairoint.h
===================================================================
--- src/cairoint.h.orig 2006-01-17 17:01:40.000000000 -0800
+++ src/cairoint.h 2006-02-02 16:00:06.125000000 -0800
@@ -66,6 +66,10 @@
#include "cairo-debug.h"
#include <pixman.h>
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
CAIRO_BEGIN_DECLS
#if __GNUC__ >= 3 && defined(__ELF__)
@@ -132,6 +136,7 @@
#define INLINE
#endif
+#if 0
#if HAVE_PTHREAD_H
# include <pthread.h>
# define CAIRO_MUTEX_DECLARE(name) static pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
@@ -159,11 +164,9 @@
# define CAIRO_MUTEX_LOCK(name) _cairo_beos_lock (&name)
# define CAIRO_MUTEX_UNLOCK(name) _cairo_beos_unlock (&name)
#endif
-
+#endif /* 0 */
#ifndef CAIRO_MUTEX_DECLARE
-# error "No mutex declarations. Cairo will not work with multiple threads." \
- "(Remove this #error directive to acknowledge & accept this limitation)."
# define CAIRO_MUTEX_DECLARE(name)
# define CAIRO_MUTEX_DECLARE_GLOBAL(name)
# define CAIRO_MUTEX_LOCK(name)
@@ -1071,6 +1074,9 @@
cairo_private cairo_gstate_t *
_cairo_gstate_clone (cairo_gstate_t *gstate);
+cairo_private void
+_moz_cairo_gstate_set_target (cairo_gstate_t *gstate, cairo_surface_t *target);
+
cairo_private cairo_surface_t *
_cairo_gstate_get_target (cairo_gstate_t *gstate);
@@ -2169,6 +2175,7 @@
slim_hidden_proto(cairo_save)
slim_hidden_proto(cairo_stroke_preserve)
slim_hidden_proto(cairo_surface_destroy)
+slim_hidden_proto(moz_cairo_set_target)
CAIRO_END_DECLS
Index: pixman/src/fbcompose.c
===================================================================
--- pixman/src/fbcompose.c.orig 2006-01-04 16:39:23.000000000 -0800
+++ pixman/src/fbcompose.c 2006-02-02 16:00:06.140625000 -0800
@@ -33,8 +33,16 @@
#include "pixregionint.h"
+#ifdef _MSC_VER
+#define _USE_MATH_DEFINES
+#endif
+
#include <math.h>
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
// #define PIXMAN_CONVOLUTION
// #define PIXMAN_INDEXED_FORMATS
Index: src/cairo-atsui-font.c
===================================================================
--- src/cairo-atsui-font.c.orig 2006-01-10 07:54:17.000000000 -0800
+++ src/cairo-atsui-font.c 2006-02-02 16:00:06.140625000 -0800
@@ -40,6 +40,16 @@
#include "cairo.h"
#include "cairo-quartz-private.h"
+/*
+ * FixedToFloat/FloatToFixed are 10.3+ SDK items - include definitions
+ * here so we can use older SDKs.
+ */
+#ifndef FixedToFloat
+#define fixed1 ((Fixed) 0x00010000L)
+#define FixedToFloat(a) ((float)(a) / fixed1)
+#define FloatToFixed(a) ((Fixed)((float)(a) * fixed1))
+#endif
+
typedef struct _cairo_atsui_font_face cairo_atsui_font_face_t;
typedef struct _cairo_atsui_font cairo_atsui_font_t;
Index: src/cairo-features.h.in
===================================================================
--- src/cairo-features.h.in.orig 2005-12-29 07:17:01.000000000 -0800
+++ src/cairo-features.h.in 2006-02-02 16:00:06.140625000 -0800
@@ -37,6 +37,8 @@
#ifndef CAIRO_FEATURES_H
#define CAIRO_FEATURES_H
+#include "cairo-platform.h"
+
#ifdef __cplusplus
# define CAIRO_BEGIN_DECLS extern "C" {
# define CAIRO_END_DECLS }
@@ -49,11 +51,11 @@
# define cairo_public
#endif
-#define CAIRO_VERSION_MAJOR @CAIRO_VERSION_MAJOR@
-#define CAIRO_VERSION_MINOR @CAIRO_VERSION_MINOR@
-#define CAIRO_VERSION_MICRO @CAIRO_VERSION_MICRO@
+#define CAIRO_VERSION_MAJOR 1
+#define CAIRO_VERSION_MINOR 1
+#define CAIRO_VERSION_MICRO 1
-#define CAIRO_VERSION_STRING "@CAIRO_VERSION_MAJOR@.@CAIRO_VERSION_MINOR@.@CAIRO_VERSION_MICRO@"
+#define CAIRO_VERSION_STRING "1.1.1"
@PS_SURFACE_FEATURE@
Index: src/cairo-win32-surface.c
===================================================================
--- src/cairo-win32-surface.c.orig 2005-12-16 03:02:35.000000000 -0800
+++ src/cairo-win32-surface.c 2006-02-02 16:00:06.140625000 -0800
@@ -1062,6 +1062,9 @@
CRITICAL_SECTION cairo_scaled_font_map_mutex;
CRITICAL_SECTION cairo_ft_unscaled_font_map_mutex;
+#if 0
+// Mozilla doesn't use the mutexes, and this definition of DllMain
+// conflicts with libxul.
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
@@ -1083,4 +1086,6 @@
}
return TRUE;
}
+#endif // 0
+
#endif