Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / external / cairo / pixman / pixman-0.24.4.patch
bloba5d32f88f82f3a0ea280285c040e3c92573f6667
1 --- misc/pixman-0.24.4/Makefile.in 2011-11-06 22:11:25.000000000 +0100
2 +++ misc/build/pixman-0.24.4/Makefile.in 2011-12-16 09:06:45.317211035 +0100
3 @@ -385,7 +385,7 @@
4 top_build_prefix = @top_build_prefix@
5 top_builddir = @top_builddir@
6 top_srcdir = @top_srcdir@
7 -SUBDIRS = pixman demos test
8 +SUBDIRS = pixman
9 pkgconfigdir = $(libdir)/pkgconfig
10 pkgconfig_DATA = pixman-1.pc
11 GPGKEY = 3892336E
12 --- misc/pixman-0.24.4/pixman/pixman-utils.c
13 +++ misc/build/pixman-0.24.4/pixman/pixman-utils.c
14 @@ -27,6 +27,7 @@
15 #endif
16 #include <stdio.h>
17 #include <stdlib.h>
18 +#include <limits.h>
20 #include "pixman-private.h"
22 --- misc/pixman-0.24.4/pixman/pixman-glyph.c 2015-06-30 05:48:31.000000000 -0400
23 +++ misc/build/pixman-0.24.4/pixman/pixman-glyph.c 2017-11-25 13:26:33.075558418 -0500
24 @@ -38,6 +38,7 @@
26 /* XXX: These numbers are arbitrary---we've never done any measurements.
28 +#define N_PIXELS_HIGH_WATER (4 * 1024 * 1024)
29 #define N_GLYPHS_HIGH_WATER (16384)
30 #define N_GLYPHS_LOW_WATER (8192)
31 #define HASH_SIZE (2 * N_GLYPHS_HIGH_WATER)
32 @@ -58,6 +59,7 @@
33 int n_glyphs;
34 int n_tombstones;
35 int freeze_count;
36 + long n_pixels;
37 pixman_list_t mru;
38 glyph_t * glyphs[HASH_SIZE];
40 @@ -133,6 +135,7 @@
41 if (*loc == TOMBSTONE)
42 cache->n_tombstones--;
43 cache->n_glyphs++;
44 + cache->n_pixels += glyph->image->bits.width * glyph->image->bits.height;
46 *loc = glyph;
48 @@ -150,6 +153,7 @@
49 cache->glyphs[idx & HASH_MASK] = TOMBSTONE;
50 cache->n_tombstones++;
51 cache->n_glyphs--;
52 + cache->n_pixels -= glyph->image->bits.width * glyph->image->bits.height;
54 /* Eliminate tombstones if possible */
55 if (cache->glyphs[(idx + 1) & HASH_MASK] == NULL)
56 @@ -180,6 +184,7 @@
58 cache->n_glyphs = 0;
59 cache->n_tombstones = 0;
60 + cache->n_pixels = 0;
63 PIXMAN_EXPORT pixman_glyph_cache_t *
64 @@ -194,6 +199,7 @@
65 cache->n_glyphs = 0;
66 cache->n_tombstones = 0;
67 cache->freeze_count = 0;
68 + cache->n_pixels = 0;
70 pixman_list_init (&cache->mru);
72 @@ -220,9 +226,9 @@
73 pixman_glyph_cache_thaw (pixman_glyph_cache_t *cache)
75 if (--cache->freeze_count == 0 &&
76 - cache->n_glyphs + cache->n_tombstones > N_GLYPHS_HIGH_WATER)
77 + (cache->n_glyphs + cache->n_tombstones > N_GLYPHS_HIGH_WATER || cache->n_pixels > N_PIXELS_HIGH_WATER))
79 - if (cache->n_tombstones > N_GLYPHS_HIGH_WATER)
80 + if (cache->n_tombstones > N_GLYPHS_LOW_WATER)
82 /* More than half the entries are
83 * tombstones. Just dump the whole table.
84 @@ -230,7 +236,7 @@
85 clear_table (cache);
88 - while (cache->n_glyphs > N_GLYPHS_LOW_WATER)
89 + while (cache->n_glyphs > N_GLYPHS_LOW_WATER || cache->n_pixels > N_PIXELS_HIGH_WATER)
91 glyph_t *glyph = CONTAINER_OF (glyph_t, mru_link, cache->mru.tail);