diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-06 21:06:15 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-07 14:49:48 +0100 |
commit | 7efd71616ec5efedbe626a986a707c35d3cac323 (patch) | |
tree | 0223e8271d9d18763efd743f43f98b8b8b9e5c2e /gfx/cairo/add-a-stash-of-cairo_t-s.patch | |
parent | bbc2206a0fda053a6f5071b457bd209dab9ed268 (diff) | |
download | UXP-7efd71616ec5efedbe626a986a707c35d3cac323.tar UXP-7efd71616ec5efedbe626a986a707c35d3cac323.tar.gz UXP-7efd71616ec5efedbe626a986a707c35d3cac323.tar.lz UXP-7efd71616ec5efedbe626a986a707c35d3cac323.tar.xz UXP-7efd71616ec5efedbe626a986a707c35d3cac323.zip |
Issue #1274 - Part 1: Adopt the cairo version as our own.
- Move header licensing from tri-license to MPL 2.0. MPL-compatible
other licensing has been retained where originally present.
- Remove individual superseded licensing terms.
- Remove patches, outdated readmes & incomplete patch summaries.
- Remove incomplete cairo release notes (only went up to 1.6.4 anyway).
- Rewrite COPYING to indicate the current state of the library in tree.
Diffstat (limited to 'gfx/cairo/add-a-stash-of-cairo_t-s.patch')
-rw-r--r-- | gfx/cairo/add-a-stash-of-cairo_t-s.patch | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/gfx/cairo/add-a-stash-of-cairo_t-s.patch b/gfx/cairo/add-a-stash-of-cairo_t-s.patch deleted file mode 100644 index c6fcdd9d8..000000000 --- a/gfx/cairo/add-a-stash-of-cairo_t-s.patch +++ /dev/null @@ -1,75 +0,0 @@ -commit dfec2c249915560cedd2b49326c6629ad8a0b0f2 -Author: Jeff Muizelaar <jmuizelaar@mozilla.com> -Date: Tue Mar 2 16:01:41 2010 -0500 - - add a stash of cairo_t's - -diff --git a/src/cairo.c b/src/cairo.c -index 3c9d892..4b27b83 100644 ---- a/src/cairo.c -+++ b/src/cairo.c -@@ -119,7 +119,63 @@ _cairo_set_error (cairo_t *cr, cairo_status_t status) - _cairo_status_set_error (&cr->status, _cairo_error (status)); - } - --#if HAS_ATOMIC_OPS -+#if defined(_MSC_VER) -+#pragma intrinsic(_BitScanForward) -+static __forceinline int -+ffs(int x) -+{ -+ unsigned long i; -+ -+ if (_BitScanForward(&i, x) != 0) -+ return i + 1; -+ -+ return 0; -+} -+#endif -+ -+ -+#if CAIRO_NO_MUTEX -+/* We keep a small stash of contexts to reduce malloc pressure */ -+#define CAIRO_STASH_SIZE 4 -+static struct { -+ cairo_t pool[CAIRO_STASH_SIZE]; -+ int occupied; -+} _context_stash; -+ -+static cairo_t * -+_context_get (void) -+{ -+ int avail, old, new; -+ -+ old = _context_stash.occupied; -+ avail = ffs (~old) - 1; -+ if (avail >= CAIRO_STASH_SIZE) -+ return malloc (sizeof (cairo_t)); -+ -+ new = old | (1 << avail); -+ _context_stash.occupied = new; -+ -+ return &_context_stash.pool[avail]; -+} -+ -+static void -+_context_put (cairo_t *cr) -+{ -+ int old, new, avail; -+ -+ if (cr < &_context_stash.pool[0] || -+ cr >= &_context_stash.pool[CAIRO_STASH_SIZE]) -+ { -+ free (cr); -+ return; -+ } -+ -+ avail = ~(1 << (cr - &_context_stash.pool[0])); -+ old = _context_stash.occupied; -+ new = old & avail; -+ _context_stash.occupied = new; -+} -+#elif HAS_ATOMIC_OPS - /* We keep a small stash of contexts to reduce malloc pressure */ - #define CAIRO_STASH_SIZE 4 - static struct { |