[cairo-commit] Branch '1.2' - 65 commits - configure.in
doc/Makefile.am Makefile.am pixman/src RELEASING src/cairo.c
src/cairo-clip.c src/cairo-color.c src/cairo-directfb.h
src/cairo-font.c src/cairo-font-options.c src/cairo-ft-font.c
src/cairo-ft-private.h src/cairo-glitz-private.h
src/cairo-glitz-surface.c src/cairo-image-surface.c
src/cairoint.h src/cairo-matrix.c src/cairo-output-stream.c
src/cairo-output-stream-private.h src/cairo-path-data.c
src/cairo-path-data-private.h src/cairo-pattern.c
src/cairo-pdf.h src/cairo-pdf-surface.c src/cairo-pen.c
src/cairo-png.c src/cairo-ps-surface.c src/cairo-scaled-font.c
src/cairo-scaled-font-subsets-private.h src/cairo-surface.c
src/cairo-surface-fallback.c src/cairo-svg-surface.c
src/cairo-truetype-subset.c src/cairo-type1-subset.c
src/cairo-win32-font.c src/cairo-win32-private.h
src/cairo-win32-surface.c src/cairo-xlib-private.h
src/cairo-xlib-surface.c src/check-def.sh
src/check-headers.sh src/check-plt.sh src/Makefile.am
src/test-fallback-surface.c test/bitmap-font.c
test/cairo-test.h test/caps-joins-alpha-ref.png
test/copy-path.c test/copy-path-ps-argb32-ref.png
test/copy-path-ref.png test/fill-and-stroke-alpha-add-ref.png
test/fill-and-stroke-alpha-ref.png test/.gitignore
test/infinite-join.c test/infinite-join-ps-argb32-ref.png
test/infinite-join-ref.png test/linear-gradient-ref.png
test/Makefile.am test/make-html.pl test/mask-ref.png
test/mask-rgb24-ref.png test/operator-source-ref.png
test/operator-source-rgb24-ref.png
test/paint-source-alpha-pdf-argb32-ref.png
test/paint-source-alpha-ref.png test/paint-with-alpha-ref.png
test/path-data.c test/path-data-ps-argb32-ref.png
test/path-data-ref.png test/push-group-ref.png
test/push-group-rgb24-ref.png test/set-source.c
test/set-source-ref.png test/trap-clip-ref.png
Carl Worth
cworth at kemper.freedesktop.org
Thu Nov 2 14:08:15 PST 2006
Makefile.am | 8 -
RELEASING | 8 +
configure.in | 52 +++++++----
doc/Makefile.am | 2
pixman/src/fbmmx.h | 21 ++++
pixman/src/fbpict.c | 1
pixman/src/iccolor.c | 1
pixman/src/icformat.c | 1
pixman/src/icimage.c | 4
pixman/src/icimage.h | 2
pixman/src/icint.h | 17 ---
pixman/src/icrect.c | 1
pixman/src/icrop.h | 4
pixman/src/pixman.h | 108 ++++++++++++-----------
pixman/src/pixregion.c | 8 -
pixman/src/renderedge.h | 10 +-
pixman/src/slim_internal.h | 13 +-
src/Makefile.am | 6 +
src/cairo-clip.c | 2
src/cairo-color.c | 24 +++--
src/cairo-directfb.h | 3
src/cairo-font-options.c | 9 +
src/cairo-font.c | 2
src/cairo-ft-font.c | 12 +-
src/cairo-ft-private.h | 7 +
src/cairo-glitz-private.h | 41 ++++++++
src/cairo-glitz-surface.c | 2
src/cairo-image-surface.c | 58 +++++++++++-
src/cairo-matrix.c | 1
src/cairo-output-stream-private.h | 12 +-
src/cairo-output-stream.c | 26 +++--
src/cairo-path-data-private.h | 3
src/cairo-path-data.c | 16 +++
src/cairo-pattern.c | 61 +++++--------
src/cairo-pdf-surface.c | 25 ++---
src/cairo-pdf.h | 2
src/cairo-pen.c | 7 +
src/cairo-png.c | 1
src/cairo-ps-surface.c | 5 -
src/cairo-scaled-font-subsets-private.h | 4
src/cairo-scaled-font.c | 24 ++++-
src/cairo-surface-fallback.c | 4
src/cairo-surface.c | 10 ++
src/cairo-svg-surface.c | 3
src/cairo-truetype-subset.c | 55 +++++++----
src/cairo-type1-subset.c | 13 +-
src/cairo-win32-font.c | 10 ++
src/cairo-win32-private.h | 3
src/cairo-win32-surface.c | 136 +++++------------------------
src/cairo-xlib-private.h | 7 +
src/cairo-xlib-surface.c | 1
src/cairo.c | 53 ++++++++---
src/cairoint.h | 128 ++++++++++++++++++++-------
src/check-def.sh | 31 ++++++
src/check-headers.sh | 21 ++++
src/check-plt.sh | 17 +++
src/test-fallback-surface.c | 3
test/.gitignore | 1
test/Makefile.am | 11 +-
test/bitmap-font.c | 10 +-
test/cairo-test.h | 7 +
test/caps-joins-alpha-ref.png |binary
test/copy-path.c | 30 +++++-
test/fill-and-stroke-alpha-add-ref.png |binary
test/fill-and-stroke-alpha-ref.png |binary
test/infinite-join-ps-argb32-ref.png |binary
test/infinite-join-ref.png |binary
test/infinite-join.c | 80 +++++++++++++++++
test/linear-gradient-ref.png |binary
test/make-html.pl | 3
test/mask-ref.png |binary
test/mask-rgb24-ref.png |binary
test/operator-source-ref.png |binary
test/operator-source-rgb24-ref.png |binary
test/paint-source-alpha-pdf-argb32-ref.png |binary
test/paint-source-alpha-ref.png |binary
test/paint-with-alpha-ref.png |binary
test/push-group-ref.png |binary
test/push-group-rgb24-ref.png |binary
test/set-source-ref.png |binary
test/set-source.c | 4
test/trap-clip-ref.png |binary
82 files changed, 839 insertions(+), 416 deletions(-)
New commits:
diff-tree 892a050007eafddced21c03d9f10397dacabfd2b (from 48d54e8a323adbbc725d9639ddbef2d99c495b0d)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Nov 2 12:19:10 2006 -0500
[win32] Remove _cairo_win32_surface_show_glyphs()
The one copied from master didn't compile, needed a lot more code to be
backported. Lets just use the fallback paths.
diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index 27bdcfa..b76fc1b 100755
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -981,111 +981,6 @@ _cairo_win32_surface_flush (void *abstra
return _cairo_surface_reset_clip (abstract_surface);
}
-#define STACK_GLYPH_SIZE 256
-
-static cairo_int_status_t
-_cairo_win32_surface_show_glyphs (void *surface,
- cairo_operator_t op,
- cairo_pattern_t *source,
- const cairo_glyph_t *glyphs,
- int num_glyphs,
- cairo_scaled_font_t *scaled_font)
-{
- cairo_win32_surface_t *dst = surface;
-
- WORD glyph_buf_stack[STACK_GLYPH_SIZE];
- WORD *glyph_buf = glyph_buf_stack;
- int dx_buf_stack[STACK_GLYPH_SIZE];
- int *dx_buf = dx_buf_stack;
-
- BOOL win_result = 0;
- int i;
- double last_y = glyphs[0].y;
-
- cairo_solid_pattern_t *solid_pattern;
- COLORREF color;
- int output_count = 0;
-
- /* We can only handle win32 fonts */
- if (cairo_scaled_font_get_type (scaled_font) != CAIRO_FONT_TYPE_WIN32)
- return CAIRO_INT_STATUS_UNSUPPORTED;
-
- /* We can only handle opaque solid color sources */
- if (!_cairo_pattern_is_opaque_solid(source))
- return CAIRO_INT_STATUS_UNSUPPORTED;
-
- /* We can only handle operator SOURCE or OVER with the destination
- * having no alpha */
- if ((op != CAIRO_OPERATOR_SOURCE && op != CAIRO_OPERATOR_OVER) ||
- (dst->format != CAIRO_FORMAT_RGB24))
- return CAIRO_INT_STATUS_UNSUPPORTED;
-
- /* If we have a fallback mask clip set on the dst, we have
- * to go through the fallback path */
- if (dst->base.clip &&
- (dst->base.clip->mode != CAIRO_CLIP_MODE_REGION ||
- dst->base.clip->surface != NULL))
- return CAIRO_INT_STATUS_UNSUPPORTED;
-
- solid_pattern = (cairo_solid_pattern_t *)source;
- color = RGB(((int)solid_pattern->color.red_short) >> 8,
- ((int)solid_pattern->color.green_short) >> 8,
- ((int)solid_pattern->color.blue_short) >> 8);
-
- SaveDC(dst->dc);
-
- cairo_win32_scaled_font_select_font(scaled_font, dst->dc);
- SetTextColor(dst->dc, color);
- SetTextAlign(dst->dc, TA_BASELINE | TA_LEFT);
- SetBkMode(dst->dc, TRANSPARENT);
-
- if (num_glyphs > STACK_GLYPH_SIZE) {
- glyph_buf = (WORD *)malloc(num_glyphs * sizeof(WORD));
- dx_buf = (int *)malloc(num_glyphs * sizeof(int));
- }
-
- for (i = 0; i < num_glyphs; ++i) {
- output_count++;
-
- glyph_buf[i] = glyphs[i].index;
- if (i == num_glyphs - 1)
- dx_buf[i] = 0;
- else
- dx_buf[i] = (glyphs[i+1].x - glyphs[i].x) * WIN32_FONT_LOGICAL_SCALE;
-
- if (i == num_glyphs - 1 || glyphs[i].y != glyphs[i+1].y) {
- const int offset = (i - output_count) + 1;
- win_result = ExtTextOutW(dst->dc,
- glyphs[offset].x * WIN32_FONT_LOGICAL_SCALE,
- last_y * WIN32_FONT_LOGICAL_SCALE,
- ETO_GLYPH_INDEX,
- NULL,
- glyph_buf + offset,
- output_count,
- dx_buf + offset);
- if (!win_result) {
- _cairo_win32_print_gdi_error("_cairo_win32_surface_show_glyphs(ExtTextOutW failed)");
- goto FAIL;
- }
-
- output_count = 0;
- }
-
- last_y = glyphs[i].y;
- }
-
-FAIL:
- RestoreDC(dst->dc, -1);
-
- if (glyph_buf != glyph_buf_stack) {
- free(glyph_buf);
- free(dx_buf);
- }
- return (win_result) ? CAIRO_STATUS_SUCCESS : CAIRO_INT_STATUS_UNSUPPORTED;
-}
-
-#undef STACK_GLYPH_SIZE
-
/**
* cairo_win32_surface_create:
* @hdc: the DC to create a surface for
@@ -1267,7 +1162,7 @@ static const cairo_surface_backend_t cai
NULL, /* mask */
NULL, /* stroke */
NULL, /* fill */
- _cairo_win32_surface_show_glyphs,
+ NULL, /* show_glyphs */
NULL /* snapshot */
};
diff-tree 48d54e8a323adbbc725d9639ddbef2d99c495b0d (from 76026c89c24c97abfa455854e1c045c64af0b87c)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Nov 1 19:00:26 2006 -0500
[slim] hide cairo_pattern_status() #8551
(cherry picked from a13d58ff3af5ed85313b5af651c1d69f5e38fa06 commit)
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 5bb906d..68ea7f0 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -541,6 +541,7 @@ cairo_pattern_status (cairo_pattern_t *p
{
return pattern->status;
}
+slim_hidden_def (cairo_pattern_status);
/**
* cairo_pattern_destroy:
diff --git a/src/cairoint.h b/src/cairoint.h
index 3abe718..e97f0e7 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2362,6 +2362,7 @@ slim_hidden_proto (cairo_pattern_get_ext
slim_hidden_proto (cairo_pattern_get_type);
slim_hidden_proto (cairo_pattern_reference);
slim_hidden_proto (cairo_pattern_set_matrix);
+slim_hidden_proto (cairo_pattern_status);
slim_hidden_proto (cairo_pop_group);
slim_hidden_proto (cairo_pop_group_to_source);
slim_hidden_proto (cairo_push_group);
diff-tree 76026c89c24c97abfa455854e1c045c64af0b87c (from 510aae20005acf4ed1d91edcb07df688f6ce1fed)
Author: Jamey Sharp <jamey at minilop.net>
Date: Wed Nov 1 18:59:24 2006 -0500
[slim] hide cairo_version_string()
Adrian's recent commits broke PLT hiding by calling cairo_version_string
from inside cairo. Add slim_hidden_def and slim_hidden_proto for it.
(cherry picked from 445251cc79d87b73a2ccd7891f9a5a33b89927a4 commit)
diff --git a/src/cairo.c b/src/cairo.c
index 6014508..c2192a5 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -155,6 +155,7 @@ cairo_version_string (void)
{
return CAIRO_VERSION_STRING;
}
+slim_hidden_def (cairo_version_string);
/**
* cairo_create:
diff --git a/src/cairoint.h b/src/cairoint.h
index 690809d..3abe718 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2396,6 +2396,7 @@ slim_hidden_proto (cairo_surface_set_dev
slim_hidden_proto (cairo_surface_set_fallback_resolution);
slim_hidden_proto (cairo_surface_status);
slim_hidden_proto (cairo_surface_write_to_png_stream);
+slim_hidden_proto (cairo_version_string);
CAIRO_END_DECLS
diff-tree 510aae20005acf4ed1d91edcb07df688f6ce1fed (from b20171cf303cd4404fee31da77128a57c3ad4a8d)
Author: Miklós Erdélyi <erdelyim at gmail.com>
Date: Wed Nov 1 16:08:30 2006 -0500
Pass correct surface to create_similar in _cairo_clip_init_deep_copy()
This is already done in master as part of other changes.
Submitted here:
http://lists.freedesktop.org/archives/cairo/2006-August/007698.html
diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 630ec89..a201dd6 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -525,7 +525,7 @@ _cairo_clip_init_deep_copy (cairo_clip_t
}
if (other->surface) {
- _cairo_surface_clone_similar (target, clip->surface, &clip->surface);
+ _cairo_surface_clone_similar (target, other->surface, &clip->surface);
clip->surface_rect = other->surface_rect;
}
diff-tree b20171cf303cd4404fee31da77128a57c3ad4a8d (from cc8dd91ac2bdbd5d366ab29872f71a9a3a7a25a0)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Oct 25 21:40:08 2006 -0400
[PDF] Set CTM before path construction
The previous order is undefined according to the PDF spec. The resulting PDF
was being misrendered using OS X Preview viewer. This was reported in this
thread:
http://lists.freedesktop.org/archives/cairo/2006-October/008271.html
(cherry picked from e1ded5b1e042c8cefa7f136228d5a63a7bdf84b5 commit)
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index df43a5d..49d76a7 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -2506,6 +2506,11 @@ _cairo_pdf_surface_stroke (void *abstr
info.output = surface->output;
info.ctm_inverse = ctm_inverse;
+ _cairo_output_stream_printf (surface->output,
+ "q %f %f %f %f %f %f cm\r\n",
+ ctm->xx, ctm->yx, ctm->xy, ctm->yy,
+ ctm->x0, ctm->y0);
+
status = _cairo_path_fixed_interpret (path,
CAIRO_DIRECTION_FORWARD,
_cairo_pdf_path_move_to,
@@ -2514,11 +2519,6 @@ _cairo_pdf_surface_stroke (void *abstr
_cairo_pdf_path_close_path,
&info);
- _cairo_output_stream_printf (surface->output,
- "q %f %f %f %f %f %f cm\r\n",
- ctm->xx, ctm->yx, ctm->xy, ctm->yy,
- ctm->x0, ctm->y0);
-
_cairo_output_stream_printf (surface->output, "S Q\r\n");
return status;
diff-tree cc8dd91ac2bdbd5d366ab29872f71a9a3a7a25a0 (from 28fec29345e6e115d14fbdabe91f82100191c3d7)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Oct 23 11:57:16 2006 -0700
test: Update reference images due to previous change to _cairo_color_compute_shorts
The previous change was in b62710d4f8602203d848daf2d444865b611fff09
We just forgot to update the reference images at the time so there
have been false failure results in the test suite until now.
(cherry picked from 670b3ce2432154cc0611a31c5b5e37c8a3ddf1f5 commit)
diff --git a/test/caps-joins-alpha-ref.png b/test/caps-joins-alpha-ref.png
index 85cccf2..1d34c73 100644
Binary files a/test/caps-joins-alpha-ref.png and b/test/caps-joins-alpha-ref.png differ
diff --git a/test/fill-and-stroke-alpha-add-ref.png b/test/fill-and-stroke-alpha-add-ref.png
index d1da40a..412dd4f 100644
Binary files a/test/fill-and-stroke-alpha-add-ref.png and b/test/fill-and-stroke-alpha-add-ref.png differ
diff --git a/test/fill-and-stroke-alpha-ref.png b/test/fill-and-stroke-alpha-ref.png
index f1e8e23..fd4b81b 100644
Binary files a/test/fill-and-stroke-alpha-ref.png and b/test/fill-and-stroke-alpha-ref.png differ
diff --git a/test/linear-gradient-ref.png b/test/linear-gradient-ref.png
index 00626bb..cb8f908 100644
Binary files a/test/linear-gradient-ref.png and b/test/linear-gradient-ref.png differ
diff --git a/test/mask-ref.png b/test/mask-ref.png
index 7456d2b..b7cee99 100644
Binary files a/test/mask-ref.png and b/test/mask-ref.png differ
diff --git a/test/mask-rgb24-ref.png b/test/mask-rgb24-ref.png
index 4c7b0bd..5e60fee 100644
Binary files a/test/mask-rgb24-ref.png and b/test/mask-rgb24-ref.png differ
diff --git a/test/operator-source-ref.png b/test/operator-source-ref.png
index f0e6d30..9f1a626 100644
Binary files a/test/operator-source-ref.png and b/test/operator-source-ref.png differ
diff --git a/test/operator-source-rgb24-ref.png b/test/operator-source-rgb24-ref.png
index 3865871..41316ee 100644
Binary files a/test/operator-source-rgb24-ref.png and b/test/operator-source-rgb24-ref.png differ
diff --git a/test/paint-source-alpha-pdf-argb32-ref.png b/test/paint-source-alpha-pdf-argb32-ref.png
index 98004a3..d1c23e8 100644
Binary files a/test/paint-source-alpha-pdf-argb32-ref.png and b/test/paint-source-alpha-pdf-argb32-ref.png differ
diff --git a/test/paint-source-alpha-ref.png b/test/paint-source-alpha-ref.png
index 32a3eed..548bcd7 100644
Binary files a/test/paint-source-alpha-ref.png and b/test/paint-source-alpha-ref.png differ
diff --git a/test/paint-with-alpha-ref.png b/test/paint-with-alpha-ref.png
index 3e3942a..ab7ce3e 100644
Binary files a/test/paint-with-alpha-ref.png and b/test/paint-with-alpha-ref.png differ
diff --git a/test/push-group-ref.png b/test/push-group-ref.png
index f1dead1..4d38ac3 100644
Binary files a/test/push-group-ref.png and b/test/push-group-ref.png differ
diff --git a/test/push-group-rgb24-ref.png b/test/push-group-rgb24-ref.png
index d658851..18adc4b 100644
Binary files a/test/push-group-rgb24-ref.png and b/test/push-group-rgb24-ref.png differ
diff --git a/test/set-source-ref.png b/test/set-source-ref.png
index c5d5e92..19793e0 100644
Binary files a/test/set-source-ref.png and b/test/set-source-ref.png differ
diff --git a/test/set-source.c b/test/set-source.c
index 7737897..eca3f18 100644
--- a/test/set-source.c
+++ b/test/set-source.c
@@ -38,9 +38,7 @@ static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
int i;
- /* This color value might need to change in the future when we fix
- * the rounding in cairo-color.c */
- uint32_t color = 0x7f19334C;
+ uint32_t color = 0x8019334c;
cairo_surface_t *surface;
cairo_pattern_t *pattern;
diff --git a/test/trap-clip-ref.png b/test/trap-clip-ref.png
index 6c1f1e3..3ce2431 100644
Binary files a/test/trap-clip-ref.png and b/test/trap-clip-ref.png differ
diff-tree 28fec29345e6e115d14fbdabe91f82100191c3d7 (from 60d65de1593d349d545516e360c5fb04cbdbbc71)
Author: Christian Biesinger <cbiesinger at web.de>
Date: Sun Oct 22 12:47:43 2006 +0200
Add missing ) in comment
(cherry picked from d6ebe07be214461b6d456ebdbdc5acfd432e0178 commit)
diff --git a/configure.in b/configure.in
index 2943b24..9d36c53 100644
--- a/configure.in
+++ b/configure.in
@@ -569,7 +569,7 @@ dnl Use lots of warning flags with with
dnl Note: if you change the following variable, the cache is automatically
dnl skipped and all flags rechecked. So there's no need to do anything
dnl else. If for any reason you need to force a recheck, just change
-dnl MAYBE_WARN in an ignorable way (like adding whitespace
+dnl MAYBE_WARN in an ignorable way (like adding whitespace)
MAYBE_WARN="-Wall -Wextra \
-Wsign-compare -Werror-implicit-function-declaration \
diff-tree 60d65de1593d349d545516e360c5fb04cbdbbc71 (from d0bca72499c7fc54ab2beff57b7985b56633f50b)
Author: Carl Worth <cworth at cworth.org>
Date: Wed Oct 18 15:18:11 2006 -0700
Add neglected reference images for infinite-join test
(cherry picked from 40e1c0246da1e79b70d4b89b7735e6fec329c56e commit)
diff --git a/test/.gitignore b/test/.gitignore
index d434149..fb3c014 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -55,6 +55,7 @@ get-group-target
glyph-cache-pressure
gradient-alpha
imagediff
+infinite-join
leaky-dash
leaky-polygon
line-width
diff --git a/test/Makefile.am b/test/Makefile.am
index a5ce1c3..32c4329 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -230,6 +230,8 @@ glyph-cache-pressure-ps-argb32-ref.png
glyph-cache-pressure-svg-ref.png \
gradient-alpha-ref.png \
gradient-alpha-rgb24-ref.png \
+infinite-join-ref.png \
+infinite-join-ps-argb32-ref.png \
leaky-dash-ref.png \
leaky-polygon-ref.png \
leaky-polygon-ps-argb32-ref.png \
diff --git a/test/infinite-join-ps-argb32-ref.png b/test/infinite-join-ps-argb32-ref.png
new file mode 100644
index 0000000..1db6622
Binary files /dev/null and b/test/infinite-join-ps-argb32-ref.png differ
diff --git a/test/infinite-join-ref.png b/test/infinite-join-ref.png
new file mode 100644
index 0000000..5347d3b
Binary files /dev/null and b/test/infinite-join-ref.png differ
diff-tree d0bca72499c7fc54ab2beff57b7985b56633f50b (from 137ced1dd7a8d6a161be8f3b7e186cf60ce59d91)
Author: Carl Worth <cworth at cworth.org>
Date: Thu Sep 21 15:17:59 2006 -0700
Fix infinite-join test case (bug #8379)
The trick for this was to carefully ensure that the pen always has
at least 4 vertices. There was a previous attempt at this in the
code already but the test case had a combination of matrix and radius
that resulted in a value that was just able to sneak past the previous
check.
(cherry picked from 10cd23d51fbfc99d6e3e401440eebb56df3b3327 commit)
diff --git a/src/cairo-pen.c b/src/cairo-pen.c
index 3d42314..0e24f2d 100644
--- a/src/cairo-pen.c
+++ b/src/cairo-pen.c
@@ -270,7 +270,12 @@ _cairo_pen_vertices_needed (double t
/* number of vertices must be even */
if (num_vertices % 2)
num_vertices++;
+
+ /* And we must always have at least 4 vertices. */
+ if (num_vertices < 4)
+ num_vertices = 4;
}
+
return num_vertices;
}
diff-tree 137ced1dd7a8d6a161be8f3b7e186cf60ce59d91 (from 75b6d21ed5af7bb25d760423f6de2610bbbc24f0)
Author: Carl Worth <cworth at cworth.org>
Date: Wed Oct 18 15:01:58 2006 -0700
test/infinite-join: Modify to draw something visible, and make the output a more reasonable size.
The modification was performed with care to ensure that the bug
is still exercised. Also, reference images are added.
(cherry picked from 5b7a7f39ad8b726e9ee582bcd10500a1e5b16554 commit)
diff --git a/test/infinite-join.c b/test/infinite-join.c
index fffb386..74d4206 100644
--- a/test/infinite-join.c
+++ b/test/infinite-join.c
@@ -38,13 +38,18 @@ static cairo_test_draw_function_t draw;
cairo_test_t test = {
"infinite-join",
"Test case for infinite loop when stroking with round joins",
- 120, 70,
+ 8, 8,
draw
};
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
+ /* Paint white, then draw in black. */
+ cairo_set_source_rgb (cr, 1, 1, 1); /* white */
+ cairo_paint (cr);
+ cairo_set_source_rgb (cr, 0, 0, 0); /* black */
+
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
/* scaling 2 times causes a slight rounding error in the ctm.
@@ -55,11 +60,13 @@ draw (cairo_t *cr, int width, int height
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
cairo_set_line_width (cr, 20);
+ cairo_translate (cr, -18300, -13200);
+
cairo_new_path (cr);
cairo_move_to (cr, 18928, 13843);
- cairo_line_to (cr, -6928, 13843);
- cairo_line_to (cr, -6928, -6842);
- cairo_line_to (cr, 18928, -6842);
+ cairo_line_to (cr, 18500, 13843);
+ cairo_line_to (cr, 18500, 13400);
+ cairo_line_to (cr, 18928, 13400);
cairo_line_to (cr, 18928, 13843);
cairo_stroke (cr);
diff-tree 75b6d21ed5af7bb25d760423f6de2610bbbc24f0 (from 16a08ff1b03a7fc110dc3359f030ea6ff8af03a7)
Author: Carl Worth <cworth at cworth.org>
Date: Thu Sep 21 15:15:02 2006 -0700
Add assert statement so the infinite-join test simply exits rather than looping infinitely.
(cherry picked from 5492a7c7618a747130b844a509fb79b886f1bc54 commit)
diff --git a/src/cairo-pen.c b/src/cairo-pen.c
index 87de9a4..3d42314 100644
--- a/src/cairo-pen.c
+++ b/src/cairo-pen.c
@@ -315,6 +315,8 @@ _cairo_pen_find_active_cw_vertex_index (
break;
}
+ assert (i < pen->num_vertices);
+
*active = i;
return CAIRO_STATUS_SUCCESS;
diff-tree 16a08ff1b03a7fc110dc3359f030ea6ff8af03a7 (from 459223945e0e974e4de7ae158d0a218c67434add)
Author: Carl Worth <cworth at cworth.org>
Date: Thu Sep 21 15:13:47 2006 -0700
Add test case from bug #8379 demonstrating infinite loop during round join
(cherry picked from 8744929030ed8d42c271d9abb202975f62de166c commit)
diff --git a/test/Makefile.am b/test/Makefile.am
index 335a70c..a5ce1c3 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -38,6 +38,7 @@ glyph-cache-pressure \
get-and-set \
get-group-target \
gradient-alpha \
+infinite-join \
leaky-dash \
leaky-polygon \
line-width \
diff --git a/test/infinite-join.c b/test/infinite-join.c
new file mode 100644
index 0000000..fffb386
--- /dev/null
+++ b/test/infinite-join.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright © 2006 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 the
+ * copyright holders not be used in advertising or publicity
+ * pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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 D. Worth <cworth at cworth.org>
+ */
+
+/* Test case for bug #8379:
+ *
+ * infinite loop when stroking
+ * https://bugs.freedesktop.org/show_bug.cgi?id=8379
+ */
+
+#include "cairo-test.h"
+
+static cairo_test_draw_function_t draw;
+
+cairo_test_t test = {
+ "infinite-join",
+ "Test case for infinite loop when stroking with round joins",
+ 120, 70,
+ draw
+};
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
+
+ /* scaling 2 times causes a slight rounding error in the ctm.
+ * Without that, the bug doesn't happen. */
+ cairo_scale (cr, 20 / 100., 20 / 100.);
+ cairo_scale (cr, 1. / 20, 1. / 20);
+
+ cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
+ cairo_set_line_width (cr, 20);
+
+ cairo_new_path (cr);
+ cairo_move_to (cr, 18928, 13843);
+ cairo_line_to (cr, -6928, 13843);
+ cairo_line_to (cr, -6928, -6842);
+ cairo_line_to (cr, 18928, -6842);
+ cairo_line_to (cr, 18928, 13843);
+ cairo_stroke (cr);
+
+ return 0;
+}
+
+int
+main (void)
+{
+ return cairo_test (&test);
+}
diff-tree 459223945e0e974e4de7ae158d0a218c67434add (from d2ab45fed7bd38cde000a158294784bd2292ca26)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Oct 18 10:59:10 2006 -0400
[configure.in] Require pkg-config 0.19. (#8686)
(cherry picked from 157663e1fdf120a71c6cc8222b88d2915a5a73eb commit)
diff --git a/configure.in b/configure.in
index db3ffb2..2943b24 100644
--- a/configure.in
+++ b/configure.in
@@ -86,7 +86,7 @@ AC_CHECK_LIB(z, compress,
dnl ===========================================================================
-PKG_PROG_PKG_CONFIG
+PKG_PROG_PKG_CONFIG(0.19)
dnl ===========================================================================
dnl
diff-tree d2ab45fed7bd38cde000a158294784bd2292ca26 (from 97a712ce4e8a237c0dd55a1ba7ed8fce1f7e78d9)
Author: Carl Worth <cworth at cworth.org>
Date: Wed Aug 30 14:43:21 2006 -0700
Bug #7497: Change _cairo_color_compute_shorts to not rely on any particular floating-point epsilon value.
(cherry picked from b62710d4f8602203d848daf2d444865b611fff09 commit)
diff --git a/src/cairo-color.c b/src/cairo-color.c
index e202af2..a348839 100644
--- a/src/cairo-color.c
+++ b/src/cairo-color.c
@@ -89,19 +89,27 @@ _cairo_color_init_rgb (cairo_color_t *co
_cairo_color_init_rgba (color, red, green, blue, 1.0);
}
-/* We multiply colors by (0x10000 - epsilon), such that we get a uniform
- * range even for 0xffff. In other words, (1.0 - epsilon) would convert
- * to 0xffff, not 0xfffe.
+/* Convert a double in [0.0, 1.0] to an integer in [0, 65535]
+ * The conversion is designed to divide the input range into 65536
+ * equally-sized regions. This is achieved by multiplying by 65536 and
+ * then special-casing the result of an input value of 1.0 so that it
+ * maps to 65535 instead of 65536.
*/
-#define CAIRO_COLOR_ONE_MINUS_EPSILON (65536.0 - 1e-5)
+static inline uint16_t _color_to_short (double d)
+{
+ uint32_t i;
+ i = (uint32_t) (d * 65536);
+ i -= (i >> 16);
+ return i;
+}
static void
_cairo_color_compute_shorts (cairo_color_t *color)
{
- color->red_short = color->red * color->alpha * CAIRO_COLOR_ONE_MINUS_EPSILON;
- color->green_short = color->green * color->alpha * CAIRO_COLOR_ONE_MINUS_EPSILON;
- color->blue_short = color->blue * color->alpha * CAIRO_COLOR_ONE_MINUS_EPSILON;
- color->alpha_short = color->alpha * CAIRO_COLOR_ONE_MINUS_EPSILON;
+ color->red_short = _color_to_short (color->red * color->alpha);
+ color->green_short = _color_to_short (color->green * color->alpha);
+ color->blue_short = _color_to_short (color->blue * color->alpha);
+ color->alpha_short = _color_to_short (color->alpha);
}
void
diff-tree 97a712ce4e8a237c0dd55a1ba7ed8fce1f7e78d9 (from 916ccab198546c3d32daa3f79071ded83bd5809a)
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Oct 15 23:11:30 2006 +0930
PDF: Add cairo version to document info dictionary
(cherry picked from 830804c7aec0334953bdc6f4704da6d404fc030a commit)
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index e066fbe..df43a5d 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -1473,11 +1473,13 @@ _cairo_pdf_surface_write_info (cairo_pdf
info = _cairo_pdf_surface_new_object (surface);
_cairo_output_stream_printf (surface->output,
"%d 0 obj\r\n"
- "<< /Creator (cairographics.org)\r\n"
- " /Producer (cairographics.org)\r\n"
+ "<< /Creator (cairo %s (http://cairographics.org))\r\n"
+ " /Producer (cairo %s (http://cairographics.org))\r\n"
">>\r\n"
"endobj\r\n",
- info.id);
+ info.id,
+ cairo_version_string (),
+ cairo_version_string ());
return info;
}
diff-tree 916ccab198546c3d32daa3f79071ded83bd5809a (from d883217773913f3f6fc67e8ce97737ddd53b0d28)
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Oct 15 23:11:01 2006 +0930
PS: Add cairo version to PS header
(cherry picked from 5aaa1988c7e27ed7acd002ee0fb8d344444b46dd commit)
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 019a53d..d809fbd 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -329,10 +329,11 @@ _cairo_ps_surface_emit_header (cairo_ps_
_cairo_output_stream_printf (surface->final_stream,
"%%!PS-Adobe-3.0\n"
- "%%%%Creator: cairo (http://cairographics.org)\n"
+ "%%%%Creator: cairo %s (http://cairographics.org)\n"
"%%%%CreationDate: %s"
"%%%%Pages: %d\n"
"%%%%BoundingBox: %d %d %d %d\n",
+ cairo_version_string (),
ctime (&now),
surface->num_pages,
0, 0,
diff-tree d883217773913f3f6fc67e8ce97737ddd53b0d28 (from df7faeff4e4bbb66c0651a066b694581c4165ad3)
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Oct 15 23:09:35 2006 +0930
Type1 subsetting: Don't put .notdef in Encoding when there are 256 glyphs
Type1 subsetting adds the .notdef glyph to the subset because the Type 1
spec requires that it be defined. However if the subset already has
256 glyphs, this will cause the Encoding vector to have 257 entries
which ghostscript does not like.
(cherry picked from 753763ff258760688ef5a594a204fa8f2be7e4a4 commit)
diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index 6f1be2c..6e9afab 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -280,7 +280,7 @@ cairo_type1_font_subset_write_header (ca
_cairo_output_stream_printf (font->output,
"/Encoding 256 array\n"
"0 1 255 {1 index exch /.notdef put} for\n");
- for (i = 0; i < font->base.num_glyphs; i++) {
+ for (i = 1; i < font->base.num_glyphs; i++) {
if (font->glyphs[i].subset_index < 0)
continue;
_cairo_output_stream_printf (font->output,
diff-tree df7faeff4e4bbb66c0651a066b694581c4165ad3 (from 3f519f672a22626f97118d96051bc793a2c4cd6b)
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Oct 15 23:02:20 2006 +0930
Correct an unsigned to signed conversion problem in truetype subsetting bbox
(cherry picked from d1fb02b5b93c9a456411e9eb56f3ee136b33d9e7 commit)
diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index 8b1c5f5..86509df 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -194,12 +194,12 @@ _cairo_truetype_font_create (cairo_scale
goto fail3;
font->base.num_glyphs = 0;
- font->base.x_min = be16_to_cpu (head.x_min);
- font->base.y_min = be16_to_cpu (head.y_min);
- font->base.x_max = be16_to_cpu (head.x_max);
- font->base.y_max = be16_to_cpu (head.y_max);
- font->base.ascent = be16_to_cpu (hhea.ascender);
- font->base.descent = be16_to_cpu (hhea.descender);
+ font->base.x_min = (int16_t) be16_to_cpu (head.x_min);
+ font->base.y_min = (int16_t) be16_to_cpu (head.y_min);
+ font->base.x_max = (int16_t) be16_to_cpu (head.x_max);
+ font->base.y_max = (int16_t) be16_to_cpu (head.y_max);
+ font->base.ascent = (int16_t) be16_to_cpu (hhea.ascender);
+ font->base.descent = (int16_t) be16_to_cpu (hhea.descender);
/* Extract the font name from the name table. At present this
* just looks for the Mac platform/Roman encoded font name. It
diff-tree 3f519f672a22626f97118d96051bc793a2c4cd6b (from 07009ab72f1205680a5661dbea1681c9ad8f68c4)
Author: Christian Biesinger <cbiesinger at web.de>
Date: Tue Oct 10 12:38:33 2006 -0700
fix comment: pixman_private needs to be before the type of a variable
Makes the documentation match the code.
Compare also commit 34d11aa3c45ba672b34d0a17f672f907305f3893
(cherry picked from 38dcddd79ef95b04bf8d6ff8336cb997875df41b commit)
diff --git a/pixman/src/slim_internal.h b/pixman/src/slim_internal.h
index 9a93972..fc73cc3 100644
--- a/pixman/src/slim_internal.h
+++ b/pixman/src/slim_internal.h
@@ -39,9 +39,9 @@
pixman_private int
somefunction(void);
- or after a data name,
+ or before the type of a variable,
- extern int somedata pixman_private;
+ extern pixman_private int somedata;
The ELF visibility attribute did not exist before gcc 3.3. */
/* ??? Not marked with "slim" because that makes it look too much
diff-tree 07009ab72f1205680a5661dbea1681c9ad8f68c4 (from 2734968e2999eb7693f2bf6fb62446e593db749c)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Oct 8 17:07:17 2006 -0400
[slim] hide cairo_glitz_surface_create() (#8551)
(cherry picked from f6a2811c87def7b1bc70a2014d93df8feab2e2f4 commit)
diff --git a/src/Makefile.am b/src/Makefile.am
index 90a6cd3..b6b7c50 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -91,7 +91,7 @@ endif
if CAIRO_HAS_GLITZ_SURFACE
libcairo_glitz_headers = cairo-glitz.h
-libcairo_glitz_sources = cairo-glitz-surface.c
+libcairo_glitz_sources = cairo-glitz-surface.c cairo-glitz-private.h
backend_pkgconfigs += cairo-glitz.pc
endif
diff --git a/src/cairo-glitz-private.h b/src/cairo-glitz-private.h
new file mode 100644
index 0000000..8a876ee
--- /dev/null
+++ b/src/cairo-glitz-private.h
@@ -0,0 +1,41 @@
+/* Cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2005 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it either under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
+ *
+ * The Original Code is the cairo graphics library.
+ *
+ * The Initial Developer of the Original Code is Red Hat, Inc.
+ */
+
+#ifndef CAIRO_GLITZ_PRIVATE_H
+#define CAIRO_GLITZ_PRIVATE_H
+
+#include "cairoint.h"
+#include "cairo-glitz.h"
+
+slim_hidden_proto (cairo_glitz_surface_create);
+
+#endif /* CAIRO_GLITZ_PRIVATE_H */
diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c
index c7d6aa3..3536619 100644
--- a/src/cairo-glitz-surface.c
+++ b/src/cairo-glitz-surface.c
@@ -26,6 +26,7 @@
#include "cairoint.h"
#include "cairo-glitz.h"
+#include "cairo-glitz-private.h"
typedef struct _cairo_glitz_surface {
cairo_surface_t base;
@@ -2196,3 +2197,4 @@ cairo_glitz_surface_create (glitz_surfac
return (cairo_surface_t *) crsurface;
}
+slim_hidden_def (cairo_glitz_surface_create);
diff-tree 2734968e2999eb7693f2bf6fb62446e593db749c (from c6beeda701b24e5056615a261f21da12a42636ab)
Author: Carl Worth <cworth at cworth.org>
Date: Wed Oct 4 18:34:09 2006 -0700
Fix typo that was resulting in device glyph_extents of INT16_MAX in some cases.
(cherry picked from f1db0135476a039ea43dfd67c56763b05aea2ec4 commit)
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 700f209..0a96b9d 100755
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -834,7 +834,7 @@ _cairo_scaled_font_glyph_device_extents
cairo_status_t status = CAIRO_STATUS_SUCCESS;
int i;
int min_x = INT16_MAX, max_x = INT16_MIN;
- int min_y = INT16_MAX, max_y = INT16_MAX;
+ int min_y = INT16_MAX, max_y = INT16_MIN;
if (scaled_font->status)
return scaled_font->status;
diff-tree c6beeda701b24e5056615a261f21da12a42636ab (from 405d5b7dcabb33c94b648460c7196bd188690cea)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Oct 5 11:51:25 2006 -0400
[Makefile.am] Pass srcdir down to the tests
(cherry picked from 2041db91968c7c06cdb2e454f572c50d75144d29 commit)
diff --git a/src/Makefile.am b/src/Makefile.am
index c0171ef..90a6cd3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -263,6 +263,7 @@ install-data-local:
false ; \
fi
+TESTS_ENVIRONMENT = srcdir="$(srcdir)"
TESTS = check-def.sh check-plt.sh check-headers.sh
EXTRA_DIST += $(TESTS)
diff-tree 405d5b7dcabb33c94b648460c7196bd188690cea (from 20d7a556cef03405f57d1380370682a3579eb729)
Author: Carl Worth <cworth at cworth.org>
Date: Wed Oct 4 14:58:06 2006 -0700
Add new _cairo_pattern_create_for_status so that patterns properly propagate errors.
In particular, many possible error values on a surface provided
to cairo_pattern_create_for_surface were previously being swallowed
and a nil pattern was returned that erroneously reported
CAIRO_STATUS_NO_MEMORY.
(cherry picked from 01502471e31aa28a910039a918ff2aec3810d3c1 commit)
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index a859e52..5bb906d 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -47,40 +47,6 @@ static const cairo_solid_pattern_t cairo
CAIRO_EXTEND_GRADIENT_DEFAULT }, /* extend */
};
-static const cairo_solid_pattern_t cairo_pattern_nil_file_not_found = {
- { CAIRO_PATTERN_TYPE_SOLID, /* type */
- CAIRO_REF_COUNT_INVALID, /* ref_count */
- CAIRO_STATUS_FILE_NOT_FOUND, /* status */
- { 1., 0., 0., 1., 0., 0., }, /* matrix */
- CAIRO_FILTER_DEFAULT, /* filter */
- CAIRO_EXTEND_GRADIENT_DEFAULT }, /* extend */
-};
-
-static const cairo_solid_pattern_t cairo_pattern_nil_read_error = {
- { CAIRO_PATTERN_TYPE_SOLID, /* type */
- CAIRO_REF_COUNT_INVALID, /* ref_count */
- CAIRO_STATUS_READ_ERROR, /* status */
- { 1., 0., 0., 1., 0., 0., }, /* matrix */
- CAIRO_FILTER_DEFAULT, /* filter */
- CAIRO_EXTEND_GRADIENT_DEFAULT }, /* extend */
-};
-
-static const cairo_pattern_t *
-_cairo_pattern_nil_for_status (cairo_status_t status)
-{
- /* A switch statement would be more natural here, but we're
- * avoiding that to prevent a "false positive" warning from
- * -Wswitch-enum, (and I don't want to maintain a list of all
- * status values here). */
- if (status == CAIRO_STATUS_NULL_POINTER)
- return &cairo_pattern_nil_null_pointer.base;
- if (status == CAIRO_STATUS_FILE_NOT_FOUND)
- return &cairo_pattern_nil_file_not_found.base;
- if (status == CAIRO_STATUS_READ_ERROR)
- return &cairo_pattern_nil_read_error.base;
- return &cairo_pattern_nil.base;
-}
-
/**
* _cairo_pattern_set_error:
* @pattern: a pattern
@@ -293,6 +259,20 @@ _cairo_pattern_create_solid (const cairo
return &pattern->base;
}
+static const cairo_pattern_t *
+_cairo_pattern_create_for_status (cairo_status_t status)
+{
+ cairo_pattern_t *pattern;
+
+ pattern = _cairo_pattern_create_solid (_cairo_stock_color (CAIRO_STOCK_BLACK));
+ if (cairo_pattern_status (pattern))
+ return pattern;
+
+ _cairo_pattern_set_error (pattern, status);
+
+ return pattern;
+}
+
/**
* cairo_pattern_create_rgb:
* @red: red component of the color
@@ -397,10 +377,10 @@ cairo_pattern_create_for_surface (cairo_
cairo_surface_pattern_t *pattern;
if (surface == NULL)
- return (cairo_pattern_t*) _cairo_pattern_nil_for_status (CAIRO_STATUS_NULL_POINTER);
+ return (cairo_pattern_t*) &cairo_pattern_nil_null_pointer;
if (surface->status)
- return (cairo_pattern_t*) _cairo_pattern_nil_for_status (surface->status);
+ return (cairo_pattern_t*) _cairo_pattern_create_for_status (surface->status);
pattern = malloc (sizeof (cairo_surface_pattern_t));
if (pattern == NULL) {
diff-tree 20d7a556cef03405f57d1380370682a3579eb729 (from e4ff87ea596ce6316b1cad8008cb5436eef9a86b)
Author: Carl Worth <cworth at cworth.org>
Date: Wed Oct 4 14:56:33 2006 -0700
Fix cairo_image_surface_create to report INVALID_FORMAT errors.
This adds a new nil cairo_image_surface to hold CAIRO_STATUS_INVALID_FORMAT.
Previously the detected error was being lost and a nil surface was
returned that erroneously reported CAIRO_STATUS_NO_MEMORY.
(cherry picked from 4d2b54a271f722de9802ca68246ce6afba89f830 commit)
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 7f869dc..a9c610f 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -36,6 +36,52 @@
#include "cairoint.h"
+const cairo_image_surface_t _cairo_image_surface_nil_invalid_format = {
+ {
+ &cairo_image_surface_backend, /* backend */
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR,
+ CAIRO_REF_COUNT_INVALID, /* ref_count */
+ CAIRO_STATUS_INVALID_FORMAT, /* status */
+ FALSE, /* finished */
+ { 0, /* size */
+ 0, /* num_elements */
+ 0, /* element_size */
+ NULL, /* elements */
+ }, /* user_data */
+ { 1.0, 0.0,
+ 0.0, 1.0,
+ 0.0, 0.0
+ }, /* device_transform */
+ { 1.0, 0.0,
+ 0.0, 1.0,
+ 0.0, 0.0
+ }, /* device_transform_inverse */
+ 0.0, /* x_fallback_resolution */
+ 0.0, /* y_fallback_resolution */
+ NULL, /* clip */
+ 0, /* next_clip_serial */
+ 0, /* current_clip_serial */
+ FALSE, /* is_snapshot */
+ FALSE, /* has_font_options */
+ { CAIRO_ANTIALIAS_DEFAULT,
+ CAIRO_SUBPIXEL_ORDER_DEFAULT,
+ CAIRO_HINT_STYLE_DEFAULT,
+ CAIRO_HINT_METRICS_DEFAULT
+ } /* font_options */
+ }, /* base */
+ CAIRO_FORMAT_ARGB32, /* format */
+ NULL, /* data */
+ FALSE, /* owns_data */
+ FALSE, /* has_clip */
+ 0, /* width */
+ 0, /* height */
+ 0, /* stride */
+ 0, /* depth */
+ NULL /* pixman_image */
+};
+
+
static int
_cairo_format_bpp (cairo_format_t format)
{
@@ -253,8 +299,10 @@ cairo_image_surface_create (cairo_format
pixman_format_t *pixman_format;
pixman_image_t *pixman_image;
- if (! CAIRO_FORMAT_VALID (format))
- return (cairo_surface_t*) &_cairo_surface_nil;
+ if (! CAIRO_FORMAT_VALID (format)) {
+ _cairo_error (CAIRO_STATUS_INVALID_FORMAT);
+ return (cairo_surface_t*) &_cairo_image_surface_nil_invalid_format;
+ }
pixman_format = _create_pixman_format (format);
if (pixman_format == NULL) {
diff-tree e4ff87ea596ce6316b1cad8008cb5436eef9a86b (from 372e631a833c3d61b03804c3184359002b1861f3)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Oct 2 14:35:35 2006 -0400
[check-headers.sh] Don't use '\>' regexp syntax
(cherry picked from 1e0e2075090c181dcd9f431833a8a9c2665d763e commit)
diff --git a/src/check-headers.sh b/src/check-headers.sh
index 1e8d590..91a52a0 100755
--- a/src/check-headers.sh
+++ b/src/check-headers.sh
@@ -12,7 +12,7 @@ xargs grep -B 1 '^cairo_.*[ ]\+(' |
awk '
/^--$/ { context=""; public=0; next; }
/:cairo_.*[ ]+\(/ { if (!public) {print context; print; print "--";} next; }
-/-cairo_public\>/ {public=1;}
+/-cairo_public[ ]/ {public=1;}
{ context=$0; }
' |
sed 's/[.]h-/.h:/' |
diff-tree 372e631a833c3d61b03804c3184359002b1861f3 (from a3ac198b0ab380225f8998f20e5423036f0dadcb)
Author: Alfred Peng <alfred.peng at sun.com>
Date: Fri Sep 29 17:17:27 2006 -0700
Use pixman_private consistently as prefix not suffix
(cherry picked from 34d11aa3c45ba672b34d0a17f672f907305f3893 commit)
diff --git a/pixman/src/icint.h b/pixman/src/icint.h
index a489bb7..17b13b4 100644
--- a/pixman/src/icint.h
+++ b/pixman/src/icint.h
@@ -985,7 +985,7 @@ typedef struct _PictFormat *PictFormatPt
#define PictureCmapPolicyColor 3
#define PictureCmapPolicyAll 4
-extern int PictureCmapPolicy pixman_private;
+extern pixman_private int PictureCmapPolicy;
int PictureParseCmapPolicy (const char *name);
diff --git a/pixman/src/icrop.h b/pixman/src/icrop.h
index 4e6ac82..99fc8e5 100644
--- a/pixman/src/icrop.h
+++ b/pixman/src/icrop.h
@@ -29,7 +29,7 @@ typedef struct _mergeRopBits {
FbBits ca1, cx1, ca2, cx2;
} FbMergeRopRec, *FbMergeRopPtr;
-extern const FbMergeRopRec FbMergeRopBits[16] pixman_private;
+extern pixman_private const FbMergeRopRec FbMergeRopBits[16];
#define FbDeclareMergeRop() FbBits _ca1, _cx1, _ca2, _cx2;
#define FbDeclarePrebuiltMergeRop() FbBits _cca, _ccx;
@@ -98,7 +98,7 @@ extern const FbMergeRopRec FbMergeRopBit
*/
/* half of table */
-extern const pixman_bits_t fbStipple16Bits[256] pixman_private;
+extern pixman_private const pixman_bits_t fbStipple16Bits[256];
#define FbStipple16Bits(b) \
(fbStipple16Bits[(b)&0xff] | fbStipple16Bits[(b) >> 8] << FB_HALFUNIT)
diff-tree a3ac198b0ab380225f8998f20e5423036f0dadcb (from ba8b0c0268e7f2cfcc32b7918730d0b10eadcf61)
Author: Alfred Peng <alfred.peng at sun.com>
Date: Fri Sep 29 17:16:47 2006 -0700
Add Sun Pro C definition of pixman_private
(cherry picked from c1495742f76ce380aaa48389bc331723b7a3a141 commit)
diff --git a/pixman/src/slim_internal.h b/pixman/src/slim_internal.h
index 3d1e9a6..9a93972 100644
--- a/pixman/src/slim_internal.h
+++ b/pixman/src/slim_internal.h
@@ -49,7 +49,9 @@
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
#define pixman_private __attribute__((__visibility__("hidden")))
-#else
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define pixman_private __hidden
+#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
#define pixman_private
#endif
diff-tree ba8b0c0268e7f2cfcc32b7918730d0b10eadcf61 (from 4c838dddd1912562042db3fe1b9f078ec583d63a)
Author: Carl Worth <cworth at cworth.org>
Date: Fri Sep 29 17:08:53 2006 -0700
Fix dependency of 'make doc' so that necessary header files are built first.
(cherry picked from 28cc64aa20cd15f78109f4481bd1c08627c87e46 commit)
diff --git a/Makefile.am b/Makefile.am
index 9d68de7..cf8e95e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,9 @@ DIST_SUBDIRS = pixman src test doc
SUBDIRS = pixman src doc
.PHONY: doc test retest recheck check-valgrind
-doc:
+# We have some generated header files, so we really need to build the
+# library before we can build the docs
+doc: all
cd doc && $(MAKE) $(AM_MAKEFLAGS) doc
test: all
cd test && $(MAKE) $(AM_MAKEFLAGS) test
@@ -182,9 +184,7 @@ release-publish-message: releases/$(sha1
release-publish: release-upload release-publish-message
-# XXX: Depending on all here is rather overkill. We don't really need
-# the library built in order to create the documentation.
-doc-publish: all
+doc-publish: doc
cp -a doc/public/html $(MANUAL_DATED)
tar czf $(MANUAL_TAR_FILE) $(MANUAL_DATED)
scp $(MANUAL_TAR_FILE) $(RELEASE_UPLOAD_HOST):$(MANUAL_UPLOAD_DIR)
diff-tree 4c838dddd1912562042db3fe1b9f078ec583d63a (from d65a8fd422effc4a943bae8d82e5531e7924f12b)
Author: Carl Worth <cworth at cworth.org>
Date: Fri Sep 29 16:59:27 2006 -0700
Rename docs-publish target to doc-publish in order to be consistent with the doc target.
(cherry picked from deef1a667536ec67ff1d7b42a1f8179e1eac4715 commit)
diff --git a/Makefile.am b/Makefile.am
index cb4496c..9d68de7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -184,7 +184,7 @@ release-publish: release-upload release-
# XXX: Depending on all here is rather overkill. We don't really need
# the library built in order to create the documentation.
-docs-publish: all
+doc-publish: all
cp -a doc/public/html $(MANUAL_DATED)
tar czf $(MANUAL_TAR_FILE) $(MANUAL_DATED)
scp $(MANUAL_TAR_FILE) $(RELEASE_UPLOAD_HOST):$(MANUAL_UPLOAD_DIR)
diff-tree d65a8fd422effc4a943bae8d82e5531e7924f12b (from 0a59ab7d553a3307bf1fb86487ef9cc0823fe625)
Author: Carl Worth <cworth at cworth.org>
Date: Fri Sep 29 16:58:51 2006 -0700
Fix Makefile bug preventing 'make doc' from succeeding
(cherry picked from e6575fb3c76ec2cda742e05c24958a7000d488dd commit)
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 4bca815..821d5c9 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=public
.PHONY: doc
doc:
- cd public && $(MAKE) $(AM_MAKEFLAGS) public doc
+ cd public && $(MAKE) $(AM_MAKEFLAGS) doc
diff-tree 0a59ab7d553a3307bf1fb86487ef9cc0823fe625 (from 57bca39e08f003ee4685d1cfb9fc88901dd1b520)
Author: Carl Worth <cworth at cworth.org>
Date: Fri Sep 29 16:46:39 2006 -0700
Fix typo in documentation of cairo_in_fill (thanks to Jonathan Watt) and clarify a bit.
(cherry picked from b99d41a0b075ec405d14ea8b6bbcaa50aa35e890 commit)
diff --git a/src/cairo.c b/src/cairo.c
index 61dbe6a..6014508 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -1948,18 +1948,21 @@ cairo_show_page (cairo_t *cr)
* @x: X coordinate of the point to test
* @y: Y coordinate of the point to test
*
- * Tests whether the given point is on the area stroked by doing a
- * cairo_stroke() operation on @cr given the current path and stroking
- * parameters.
+ * Tests whether the given point is inside the area that would be
+ * stroked by doing a cairo_stroke() operation on @cr given the
+ * current path and stroking parameters.
*
- * See cairo_stroke, cairo_set_line_width(), cairo_set_line_join(),
+ * See cairo_stroke(), cairo_set_line_width(), cairo_set_line_join(),
* cairo_set_line_cap(), cairo_set_dash(), and
* cairo_stroke_preserve().
+ *
+ * Return value: A non-zero value if the point is inside, or zero if
+ * outside.
**/
cairo_bool_t
cairo_in_stroke (cairo_t *cr, double x, double y)
{
- int inside;
+ cairo_bool_t inside;
if (cr->status)
return 0;
@@ -1979,16 +1982,19 @@ cairo_in_stroke (cairo_t *cr, double x,
* @x: X coordinate of the point to test
* @y: Y coordinate of the point to test
*
- * Tests whether the given point is on the area filled by doing a
- * cairo_stroke() operation on @cr given the current path and filling
- * parameters.
+ * Tests whether the given point is inside the area that would be
+ * filled by doing a cairo_fill() operation on @cr given the current
+ * path and filling parameters.
*
* See cairo_fill(), cairo_set_fill_rule() and cairo_fill_preserve().
+ *
+ * Return value: A non-zero value if the point is inside, or zero if
+ * outside.
**/
cairo_bool_t
cairo_in_fill (cairo_t *cr, double x, double y)
{
- int inside;
+ cairo_bool_t inside;
if (cr->status)
return 0;
diff-tree 57bca39e08f003ee4685d1cfb9fc88901dd1b520 (from b586c0456ee8ea96bcf91b24a5d0b80aed91db44)
Author: Robert O'Callahan <rocallahan at novell.com>
Date: Mon Sep 25 16:24:33 2006 -0700
Remove redundant call to _cairo_surface_get_extents
We called it just above with the same parameters.
(cherry picked from 17eeacfba844ea5f9592dff4621e6f721c27d6c5 commit)
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index 090da70..2d23411 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -548,10 +548,6 @@ _clip_and_composite_trapezoids (cairo_pa
* _cairo_surface_fill_rectangles() or to drawing with a
* clip region, then we have an additional region to clear.
*/
- status = _cairo_surface_get_extents (dst, &extents);
- if (status)
- return status;
-
clear_region = _cairo_region_create_from_rectangle (&extents);
if (clear_region == NULL)
return CAIRO_STATUS_NO_MEMORY;
diff-tree b586c0456ee8ea96bcf91b24a5d0b80aed91db44 (from cfffc5022e4d40f0e7a4d179bcd5daf7107b18c8)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Sep 25 16:16:35 2006 -0700
Rename test from stale path-data name to copy-path
(cherry picked from e4dc73ab1cafeb8dd77d3ee3dc92d9a92be69542 commit)
diff --git a/test/Makefile.am b/test/Makefile.am
index 651a209..335a70c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -14,6 +14,7 @@ close-path \
composite-integer-translate-source \
composite-integer-translate-over \
composite-integer-translate-over-repeat \
+copy-path \
create-for-stream \
create-from-png \
create-from-png-stream \
@@ -54,7 +55,6 @@ operator-source \
paint \
paint-source-alpha \
paint-with-alpha \
-path-data \
pattern-get-type \
pixman-rotate \
rectangle-rounding-error \
@@ -183,6 +183,8 @@ composite-integer-translate-over-pdf-arg
composite-integer-translate-over-svg-ref.png \
composite-integer-translate-over-repeat-ref.png \
composite-integer-translate-source-ref.png \
+copy-path-ref.png \
+copy-path-ps-argb32-ref.png \
create-from-png-ref.png \
create-from-png-stream-ref.png \
dash-caps-joins-ref.png \
@@ -268,8 +270,6 @@ paint-source-alpha-pdf-argb32-ref.png
paint-source-alpha-svg-ref.png \
paint-with-alpha-ref.png \
paint-with-alpha-svg-ref.png \
-path-data-ref.png \
-path-data-ps-argb32-ref.png \
pixman-rotate-ref.png \
pixman-rotate-rgb24-ref.png \
push-group-ref.png \
diff --git a/test/copy-path-ps-argb32-ref.png b/test/copy-path-ps-argb32-ref.png
new file mode 100644
index 0000000..647fafb
Binary files /dev/null and b/test/copy-path-ps-argb32-ref.png differ
diff --git a/test/copy-path-ref.png b/test/copy-path-ref.png
new file mode 100644
index 0000000..3e9c304
Binary files /dev/null and b/test/copy-path-ref.png differ
diff --git a/test/copy-path.c b/test/copy-path.c
new file mode 100644
index 0000000..b763546
--- /dev/null
+++ b/test/copy-path.c
@@ -0,0 +1,234 @@
+/*
+ * 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 D. Worth <cworth at cworth.org>
+ */
+
+#include <stdlib.h>
+#include "cairo-test.h"
+
+static cairo_test_draw_function_t draw;
+
+cairo_test_t test = {
+ "copy-path",
+ "Tests calls to path_data functions: cairo_copy_path, cairo_copy_path_flat, and cairo_append_path",
+ 45, 53,
+ draw
+};
+
+static void
+scale_by_two (double *x, double *y)
+{
+ *x = *x * 2.0;
+ *y = *y * 2.0;
+}
+
+typedef void (*munge_func_t) (double *x, double *y);
+
+static void
+munge_and_set_path (cairo_t *cr,
+ cairo_path_t *path,
+ munge_func_t munge)
+{
+ int i;
+ cairo_path_data_t *p;
+ double x1, y1, x2, y2, x3, y3;
+
+ for (i=0; i < path->num_data; i += path->data[i].header.length) {
+ p = &path->data[i];
+ switch (p->header.type) {
+ case CAIRO_PATH_MOVE_TO:
+ x1 = p[1].point.x; y1 = p[1].point.y;
+ (munge) (&x1, &y1);
+ cairo_move_to (cr, x1, y1);
+ break;
+ case CAIRO_PATH_LINE_TO:
+ x1 = p[1].point.x; y1 = p[1].point.y;
+ (munge) (&x1, &y1);
+ cairo_line_to (cr, x1, y1);
+ break;
+ case CAIRO_PATH_CURVE_TO:
+ x1 = p[1].point.x; y1 = p[1].point.y;
+ x2 = p[2].point.x; y2 = p[2].point.y;
+ x3 = p[3].point.x; y3 = p[3].point.y;
+ (munge) (&x1, &y1);
+ (munge) (&x2, &y2);
+ (munge) (&x3, &y3);
+ cairo_curve_to (cr,
+ x1, y1,
+ x2, y2,
+ x3, y3);
+ break;
+ case CAIRO_PATH_CLOSE_PATH:
+ cairo_close_path (cr);
+ break;
+ }
+ }
+}
+
+static void
+make_path (cairo_t *cr)
+{
+ cairo_rectangle (cr, 0, 0, 5, 5);
+ cairo_move_to (cr, 15, 2.5);
+ cairo_arc (cr, 12.5, 2.5, 2.5, 0, 2 * M_PI);
+}
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ cairo_path_t *path;
+ cairo_t *cr_error;
+
+ /* Ensure that calling cairo_copy_path on an in-error cairo_t will
+ * propagate the error. */
+ cr_error = cairo_create (NULL);
+ path = cairo_copy_path (cr_error);
+ if (path->status == CAIRO_STATUS_SUCCESS ||
+ path->status != cairo_status (cr_error)) {
+ cairo_test_log ("Error: cairo_copy_path returned status of %s rather than propagating %s\n",
+ cairo_status_to_string (path->status),
+ cairo_status_to_string (cairo_status (cr_error)));
+ cairo_path_destroy (path);
+ return CAIRO_TEST_FAILURE;
+ }
+ cairo_path_destroy (path);
+
+ path = cairo_copy_path_flat (cr_error);
+ if (path->status == CAIRO_STATUS_SUCCESS ||
+ path->status != cairo_status (cr_error)) {
+ cairo_test_log ("Error: cairo_copy_path_flat returned status of %s rather than propagating %s\n",
+ cairo_status_to_string (path->status),
+ cairo_status_to_string (cairo_status (cr_error)));
+ cairo_path_destroy (path);
+ return CAIRO_TEST_FAILURE;
+ }
+ cairo_path_destroy (path);
+
+ /* We draw in the default black, so paint white first. */
+ cairo_save (cr);
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
+ cairo_paint (cr);
+ cairo_restore (cr);
+
+ /* copy path, munge, and fill */
+ cairo_translate (cr, 5, 5);
+ make_path (cr);
+ path = cairo_copy_path (cr);
+
+ cairo_new_path (cr);
+ munge_and_set_path (cr, path, scale_by_two);
+ cairo_path_destroy (path);
+ cairo_fill (cr);
+
+ /* copy flattened path, munge, and fill */
+ cairo_translate (cr, 0, 15);
+ make_path (cr);
+ path = cairo_copy_path_flat (cr);
+
+ cairo_new_path (cr);
+ munge_and_set_path (cr, path, scale_by_two);
+ cairo_path_destroy (path);
+ cairo_fill (cr);
+
+ /* append two copies of path, and fill */
+ cairo_translate (cr, 0, 15);
+ cairo_scale (cr, 2.0, 2.0);
+ make_path (cr);
+ path = cairo_copy_path (cr);
+
+ cairo_new_path (cr);
+ cairo_append_path (cr, path);
+ cairo_translate (cr, 2.5, 2.5);
+ cairo_append_path (cr, path);
+
+ cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+ cairo_fill (cr);
+
+ cairo_path_destroy (path);
+
+ return CAIRO_TEST_SUCCESS;
+}
+
+int
+main (void)
+{
+ cairo_t *cr;
+ cairo_path_data_t data;
+ cairo_path_t path;
+ cairo_surface_t *surface;
+
+ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
+
+ /* Test a few error cases for cairo_append_path_data */
+ cr = cairo_create (surface);
+ cairo_append_path (cr, NULL);
+ if (cairo_status (cr) != CAIRO_STATUS_NULL_POINTER)
+ return 1;
+ cairo_destroy (cr);
+
+ cr = cairo_create (surface);
+ path.status = -1;
+ cairo_append_path (cr, &path);
+ if (cairo_status (cr) != CAIRO_STATUS_INVALID_STATUS)
+ return 1;
+ cairo_destroy (cr);
+
+ cr = cairo_create (surface);
+ path.status = CAIRO_STATUS_NO_MEMORY;
+ cairo_append_path (cr, &path);
+ if (cairo_status (cr) != CAIRO_STATUS_NO_MEMORY)
+ return 1;
+ cairo_destroy (cr);
+
+ cr = cairo_create (surface);
+ path.data = NULL;
+ path.num_data = 0;
+ path.status = CAIRO_STATUS_SUCCESS;
+ cairo_append_path (cr, &path);
+ if (cairo_status (cr) != CAIRO_STATUS_NULL_POINTER)
+ return 1;
+ cairo_destroy (cr);
+
+ cr = cairo_create (surface);
+ /* Intentionally insert bogus header.length value (otherwise would be 2) */
+ data.header.type = CAIRO_PATH_MOVE_TO;
+ data.header.length = 1;
+ path.data = &data;
+ path.num_data = 1;
+ cairo_append_path (cr, &path);
+ if (cairo_status (cr) != CAIRO_STATUS_INVALID_PATH_DATA)
+ return 1;
+ cairo_destroy (cr);
+
+ /* And test the degnerate case */
+ cr = cairo_create (surface);
+ path.num_data = 0;
+ cairo_append_path (cr, &path);
+ if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
+ return 1;
+ cairo_destroy (cr);
+
+ cairo_surface_destroy (surface);
+
+ return cairo_test (&test);
+}
diff --git a/test/path-data-ps-argb32-ref.png b/test/path-data-ps-argb32-ref.png
deleted file mode 100644
index 647fafb..0000000
Binary files a/test/path-data-ps-argb32-ref.png and /dev/null differ
diff --git a/test/path-data-ref.png b/test/path-data-ref.png
deleted file mode 100644
index 3e9c304..0000000
Binary files a/test/path-data-ref.png and /dev/null differ
diff --git a/test/path-data.c b/test/path-data.c
deleted file mode 100644
index f1e0442..0000000
--- a/test/path-data.c
+++ /dev/null
@@ -1,234 +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 D. Worth <cworth at cworth.org>
- */
-
-#include <stdlib.h>
-#include "cairo-test.h"
-
-static cairo_test_draw_function_t draw;
-
-cairo_test_t test = {
- "path-data",
- "Tests calls to path_data functions: cairo_copy_path, cairo_copy_path_flat, and cairo_append_path",
- 45, 53,
- draw
-};
-
-static void
-scale_by_two (double *x, double *y)
-{
- *x = *x * 2.0;
- *y = *y * 2.0;
-}
-
-typedef void (*munge_func_t) (double *x, double *y);
-
-static void
-munge_and_set_path (cairo_t *cr,
- cairo_path_t *path,
- munge_func_t munge)
-{
- int i;
- cairo_path_data_t *p;
- double x1, y1, x2, y2, x3, y3;
-
- for (i=0; i < path->num_data; i += path->data[i].header.length) {
- p = &path->data[i];
- switch (p->header.type) {
- case CAIRO_PATH_MOVE_TO:
- x1 = p[1].point.x; y1 = p[1].point.y;
- (munge) (&x1, &y1);
- cairo_move_to (cr, x1, y1);
- break;
- case CAIRO_PATH_LINE_TO:
- x1 = p[1].point.x; y1 = p[1].point.y;
- (munge) (&x1, &y1);
- cairo_line_to (cr, x1, y1);
- break;
- case CAIRO_PATH_CURVE_TO:
- x1 = p[1].point.x; y1 = p[1].point.y;
- x2 = p[2].point.x; y2 = p[2].point.y;
- x3 = p[3].point.x; y3 = p[3].point.y;
- (munge) (&x1, &y1);
- (munge) (&x2, &y2);
- (munge) (&x3, &y3);
- cairo_curve_to (cr,
- x1, y1,
- x2, y2,
- x3, y3);
- break;
- case CAIRO_PATH_CLOSE_PATH:
- cairo_close_path (cr);
- break;
- }
- }
-}
-
-static void
-make_path (cairo_t *cr)
-{
- cairo_rectangle (cr, 0, 0, 5, 5);
- cairo_move_to (cr, 15, 2.5);
- cairo_arc (cr, 12.5, 2.5, 2.5, 0, 2 * M_PI);
-}
-
-static cairo_test_status_t
-draw (cairo_t *cr, int width, int height)
-{
- cairo_path_t *path;
- cairo_t *cr_error;
-
- /* Ensure that calling cairo_copy_path on an in-error cairo_t will
- * propagate the error. */
- cr_error = cairo_create (NULL);
- path = cairo_copy_path (cr_error);
- if (path->status == CAIRO_STATUS_SUCCESS ||
- path->status != cairo_status (cr_error)) {
- cairo_test_log ("Error: cairo_copy_path returned status of %s rather than propagating %s\n",
- cairo_status_to_string (path->status),
- cairo_status_to_string (cairo_status (cr_error)));
- cairo_path_destroy (path);
- return CAIRO_TEST_FAILURE;
- }
- cairo_path_destroy (path);
-
- path = cairo_copy_path_flat (cr_error);
- if (path->status == CAIRO_STATUS_SUCCESS ||
- path->status != cairo_status (cr_error)) {
- cairo_test_log ("Error: cairo_copy_path_flat returned status of %s rather than propagating %s\n",
- cairo_status_to_string (path->status),
- cairo_status_to_string (cairo_status (cr_error)));
- cairo_path_destroy (path);
- return CAIRO_TEST_FAILURE;
- }
- cairo_path_destroy (path);
-
- /* We draw in the default black, so paint white first. */
- cairo_save (cr);
- cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
- cairo_paint (cr);
- cairo_restore (cr);
-
- /* copy path, munge, and fill */
- cairo_translate (cr, 5, 5);
- make_path (cr);
- path = cairo_copy_path (cr);
-
- cairo_new_path (cr);
- munge_and_set_path (cr, path, scale_by_two);
- cairo_path_destroy (path);
- cairo_fill (cr);
-
- /* copy flattened path, munge, and fill */
- cairo_translate (cr, 0, 15);
- make_path (cr);
- path = cairo_copy_path_flat (cr);
-
- cairo_new_path (cr);
- munge_and_set_path (cr, path, scale_by_two);
- cairo_path_destroy (path);
- cairo_fill (cr);
-
- /* append two copies of path, and fill */
- cairo_translate (cr, 0, 15);
- cairo_scale (cr, 2.0, 2.0);
- make_path (cr);
- path = cairo_copy_path (cr);
-
- cairo_new_path (cr);
- cairo_append_path (cr, path);
- cairo_translate (cr, 2.5, 2.5);
- cairo_append_path (cr, path);
-
- cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
- cairo_fill (cr);
-
- cairo_path_destroy (path);
-
- return CAIRO_TEST_SUCCESS;
-}
-
-int
-main (void)
-{
- cairo_t *cr;
- cairo_path_data_t data;
- cairo_path_t path;
- cairo_surface_t *surface;
-
- surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
-
- /* Test a few error cases for cairo_append_path_data */
- cr = cairo_create (surface);
- cairo_append_path (cr, NULL);
- if (cairo_status (cr) != CAIRO_STATUS_NULL_POINTER)
- return 1;
- cairo_destroy (cr);
-
- cr = cairo_create (surface);
- path.status = -1;
- cairo_append_path (cr, &path);
- if (cairo_status (cr) != CAIRO_STATUS_INVALID_STATUS)
- return 1;
- cairo_destroy (cr);
-
- cr = cairo_create (surface);
- path.status = CAIRO_STATUS_NO_MEMORY;
- cairo_append_path (cr, &path);
- if (cairo_status (cr) != CAIRO_STATUS_NO_MEMORY)
- return 1;
- cairo_destroy (cr);
-
- cr = cairo_create (surface);
- path.data = NULL;
- path.num_data = 0;
- path.status = CAIRO_STATUS_SUCCESS;
- cairo_append_path (cr, &path);
- if (cairo_status (cr) != CAIRO_STATUS_NULL_POINTER)
- return 1;
- cairo_destroy (cr);
-
- cr = cairo_create (surface);
- /* Intentionally insert bogus header.length value (otherwise would be 2) */
- data.header.type = CAIRO_PATH_MOVE_TO;
- data.header.length = 1;
- path.data = &data;
- path.num_data = 1;
- cairo_append_path (cr, &path);
- if (cairo_status (cr) != CAIRO_STATUS_INVALID_PATH_DATA)
- return 1;
- cairo_destroy (cr);
-
- /* And test the degnerate case */
- cr = cairo_create (surface);
- path.num_data = 0;
- cairo_append_path (cr, &path);
- if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
- return 1;
- cairo_destroy (cr);
-
- cairo_surface_destroy (surface);
-
- return cairo_test (&test);
-}
diff-tree cfffc5022e4d40f0e7a4d179bcd5daf7107b18c8 (from b74b14ad45bf78679bf480e3080d088c15371533)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Sep 25 16:03:02 2006 -0700
Fix cairo_copy_path and cairo_copy_path_flat to propagate errors.
One of these functions was already documented to be doing this, and
the other one should have been. Now the documentation and behavior
for both are consistent, (and the path-data test case verifies this).
(cherry picked from 5f833c134bd002853b9d1458b58350cfb1d40a94 commit)
diff --git a/src/cairo-path-data-private.h b/src/cairo-path-data-private.h
index 3208bc1..28b70ee 100644
--- a/src/cairo-path-data-private.h
+++ b/src/cairo-path-data-private.h
@@ -48,6 +48,9 @@ cairo_private cairo_path_t *
_cairo_path_data_create_flat (cairo_path_fixed_t *path,
cairo_gstate_t *gstate);
+cairo_private cairo_path_t *
+_cairo_path_data_create_for_status (cairo_status_t status);
+
cairo_private cairo_status_t
_cairo_path_data_append_to_context (cairo_path_t *path,
cairo_t *cr);
diff --git a/src/cairo-path-data.c b/src/cairo-path-data.c
index cd15192..880a8f1 100644
--- a/src/cairo-path-data.c
+++ b/src/cairo-path-data.c
@@ -331,6 +331,22 @@ _cairo_path_data_populate (cairo_path_t
assert (cpdp.data - path->data == path->num_data);
}
+cairo_path_t *
+_cairo_path_data_create_for_status (cairo_status_t status)
+{
+ cairo_path_t *path;
+
+ path = malloc (sizeof (cairo_path_t));
+ if (path == NULL)
+ return (cairo_path_t*) &_cairo_path_nil;
+
+ path->num_data = 0;
+ path->data = NULL;
+ path->status = status;
+
+ return path;
+}
+
static cairo_path_t *
_cairo_path_data_create_real (cairo_path_fixed_t *path_fixed,
cairo_gstate_t *gstate,
diff --git a/src/cairo.c b/src/cairo.c
index 425a717..61dbe6a 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -2835,8 +2835,12 @@ cairo_get_group_target (cairo_t *cr)
* conditions hold:
*
* <orderedlist>
- * <listitem>If there is insufficient memory to copy the path.</listitem>
- * <listitem>If @cr is already in an error state.</listitem>
+ * <listitem>If there is insufficient memory to copy the path. In this
+ * case <literal>path->status</literal> will be set to
+ * %CAIRO_STATUS_NO_MEMORY.</listitem>
+ * <listitem>If @cr is already in an error state. In this case
+ * <literal>path->status</literal> will contain the same status that
+ * would be returned by cairo_status().</listitem>
* </orderedlist>
*
* In either case, <literal>path->status</literal> will be set to
@@ -2851,7 +2855,7 @@ cairo_path_t *
cairo_copy_path (cairo_t *cr)
{
if (cr->status)
- return (cairo_path_t*) &_cairo_path_nil;
+ return _cairo_path_data_create_for_status (cr->status);
return _cairo_path_data_create (&cr->path, cr->gstate);
}
@@ -2893,9 +2897,9 @@ cairo_path_t *
cairo_copy_path_flat (cairo_t *cr)
{
if (cr->status)
- return (cairo_path_t*) &_cairo_path_nil;
- else
- return _cairo_path_data_create_flat (&cr->path, cr->gstate);
+ return _cairo_path_data_create_for_status (cr->status);
+
+ return _cairo_path_data_create_flat (&cr->path, cr->gstate);
}
/**
diff --git a/test/path-data.c b/test/path-data.c
index 903e92c..f1e0442 100644
--- a/test/path-data.c
+++ b/test/path-data.c
@@ -30,7 +30,7 @@ static cairo_test_draw_function_t draw;
cairo_test_t test = {
"path-data",
- "Tests calls to path_data functions: cairo_copy_path_data, cairo_copy_path_data_flat, and cairo_append_path_data",
+ "Tests calls to path_data functions: cairo_copy_path, cairo_copy_path_flat, and cairo_append_path",
45, 53,
draw
};
@@ -97,6 +97,32 @@ static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_path_t *path;
+ cairo_t *cr_error;
+
+ /* Ensure that calling cairo_copy_path on an in-error cairo_t will
+ * propagate the error. */
+ cr_error = cairo_create (NULL);
+ path = cairo_copy_path (cr_error);
+ if (path->status == CAIRO_STATUS_SUCCESS ||
+ path->status != cairo_status (cr_error)) {
+ cairo_test_log ("Error: cairo_copy_path returned status of %s rather than propagating %s\n",
+ cairo_status_to_string (path->status),
+ cairo_status_to_string (cairo_status (cr_error)));
+ cairo_path_destroy (path);
+ return CAIRO_TEST_FAILURE;
+ }
+ cairo_path_destroy (path);
+
+ path = cairo_copy_path_flat (cr_error);
+ if (path->status == CAIRO_STATUS_SUCCESS ||
+ path->status != cairo_status (cr_error)) {
+ cairo_test_log ("Error: cairo_copy_path_flat returned status of %s rather than propagating %s\n",
+ cairo_status_to_string (path->status),
+ cairo_status_to_string (cairo_status (cr_error)));
+ cairo_path_destroy (path);
+ return CAIRO_TEST_FAILURE;
+ }
+ cairo_path_destroy (path);
/* We draw in the default black, so paint white first. */
cairo_save (cr);
diff-tree b74b14ad45bf78679bf480e3080d088c15371533 (from bdff62a4b61dac260d815ae0cdaa5b34d909c814)
Author: Kristian Høgsberg <krh at redhat.com>
Date: Tue Sep 26 17:33:29 2006 -0400
Compute right index when looking up left side bearing.
When looking up the short entries in the second part of
the hmtx table, compute the size of the first part correctly.
Fix from Adrian, see:
https://bugs.freedesktop.org/show_bug.cgi?id=8180#c12
(cherry picked from f9165638bf485591abae52b759fba82caf048dc5 commit)
diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index c5e1799..8b1c5f5 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -591,10 +591,9 @@ cairo_truetype_font_write_hmtx_table (ca
}
font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
TT_TAG_hmtx,
- (num_hmetrics - 1) * long_entry_size +
- (font->glyphs[i].parent_index - num_hmetrics)
- * short_entry_size,
- (unsigned char *) (p+1), &short_entry_size);
+ num_hmetrics * long_entry_size +
+ (font->glyphs[i].parent_index - num_hmetrics) * short_entry_size,
+ (unsigned char *) (p + 1), &short_entry_size);
}
font->base.widths[i] = be16_to_cpu (p[0]);
}
diff-tree bdff62a4b61dac260d815ae0cdaa5b34d909c814 (from 4085afc75d0b2e85011e05b8d79f8d2a3ebef6ce)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 26 13:54:03 2006 -0400
[configure] Print out whether SVG and PDF surfaces can be tested
(cherry picked from 7c3062240ac036c8091ee9f0acce0aa3ea9df8ea commit)
diff --git a/configure.in b/configure.in
index 6d231a0..db3ffb2 100644
--- a/configure.in
+++ b/configure.in
@@ -489,7 +489,8 @@ CAIRO_BACKEND_ENABLE(pdf, PDF, pdf, PDF_
POPPLER_VERSION_REQUIRED=0.4.1
test_pdf=no
if test "x$use_pdf" = "xyes"; then
- PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_VERSION_REQUIRED pango gtk+-2.0, [test_pdf=yes], [test_pdf=no])
+ poppler_DEPENDENCY="poppler-glib >= $POPPLER_VERSION_REQUIRED"
+ PKG_CHECK_MODULES(POPPLER, $poppler_DEPENDENCY pango gtk+-2.0, [test_pdf=yes], [test_pdf="no (requires $poppler_DEPENDENCY)"])
if test "x$test_pdf" = "xyes"; then
AC_DEFINE([CAIRO_CAN_TEST_PDF_SURFACE], 1, [Define to 1 if the PDF backend can be tested (need poppler and other dependencies for pdf2png)])
else
@@ -513,7 +514,8 @@ CAIRO_BACKEND_ENABLE(svg, SVG, svg, SVG_
LIBRSVG_VERSION_REQUIRED=2.14.0
if test "x$use_svg" = "xyes"; then
- PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= $LIBRSVG_VERSION_REQUIRED gdk-2.0, [test_svg=yes], [test_svg=no])
+ librsvg_DEPENDENCY="librsvg-2.0 >= $LIBRSVG_VERSION_REQUIRED"
+ PKG_CHECK_MODULES(LIBRSVG, $librsvg_DEPENDENCY gdk-2.0, [test_svg=yes], [test_svg="no (requires $librsvg_DEPENDENCY)"])
if test "x$test_svg" = "xyes"; then
AC_DEFINE([CAIRO_CAN_TEST_SVG_SURFACE], 1, [Define to 1 if the SVG backend can be tested])
else
@@ -835,6 +837,8 @@ echo ""
echo "and the following debug options:"
echo " gcov support: $use_gcov"
echo " test surfaces: $use_test_surfaces"
+echo " pdf testing: $test_pdf"
+echo " svg testing: $test_svg"
echo ""
echo "using CFLAGS:"
echo $CAIRO_CFLAGS
diff --git a/src/check-def.sh b/src/check-def.sh
index 3545851..aae3fc6 100755
--- a/src/check-def.sh
+++ b/src/check-def.sh
@@ -22,7 +22,7 @@ for def in $defs; do
{
echo EXPORTS
- nm $so | grep ' T ' | cut -d' ' -f3 | grep -v '^_cairo.*_test_\|^_fini\|^_init' | sort -u
+ nm $so | grep ' T ' | cut -d' ' -f3 | grep -v '^_cairo_.*_test_\|^_fini\|^_init' | sort -u
# cheat: copy the last line from the def file!
tail -n1 $def
} | diff $def - || status=1
diff-tree 4085afc75d0b2e85011e05b8d79f8d2a3ebef6ce (from 6e7610cc1f7f2431aa4b2455d4327d9de8b3a5dc)
Author: Carl Worth <cworth at cworth.org>
Date: Tue Sep 19 10:13:36 2006 -0700
Add missing pixman_private to _FbOnes when a function.
This was thanks to a report from crucible (run #2113) since it tested
with older versions of gcc (3.3.6) than most of the cairo developers
use, (so we had been getting the _FbOnes macro not the function).
(cherry picked from 82b710ebc214c46df6666ede486c0174b335bfdb commit)
diff --git a/pixman/src/icint.h b/pixman/src/icint.h
index c846a51..a489bb7 100644
--- a/pixman/src/icint.h
+++ b/pixman/src/icint.h
@@ -811,7 +811,7 @@ fbRasterizeTrapezoid (pixman_image_t *p
# endif
#else
# define ICINT_NEED_IC_ONES
-int
+pixman_private int
_FbOnes(unsigned long mask);
#endif
diff-tree 6e7610cc1f7f2431aa4b2455d4327d9de8b3a5dc (from 73e7dff756df30ef064a4a9f36119ba72c4f3728)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 19 13:05:29 2006 -0400
check-def.sh: Only allow _cairo_.*_test_.* symbols, not all _cairo.* ones
(cherry picked from 42a0c6bd59e41c22a88386b389af36f37418de82 commit)
diff --git a/src/check-def.sh b/src/check-def.sh
index 9417dbe..3545851 100755
--- a/src/check-def.sh
+++ b/src/check-def.sh
@@ -22,7 +22,7 @@ for def in $defs; do
{
echo EXPORTS
- nm $so | grep ' T ' | cut -d' ' -f3 | grep -v '^_cairo\|^_fini\|^_init' | sort -u
+ nm $so | grep ' T ' | cut -d' ' -f3 | grep -v '^_cairo.*_test_\|^_fini\|^_init' | sort -u
# cheat: copy the last line from the def file!
tail -n1 $def
} | diff $def - || status=1
diff-tree 73e7dff756df30ef064a4a9f36119ba72c4f3728 (from ba76564270339ad9b3fca7ebd680aa94ed79b215)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 18 13:32:19 2006 -0400
cairo-directfb.h: Add missing cairo_public decorators
(cherry picked from 6c01b2ffb3c7a023f3932328b8067f4f5b83936c commit)
diff --git a/src/cairo-directfb.h b/src/cairo-directfb.h
index b777196..845f3de 100644
--- a/src/cairo-directfb.h
+++ b/src/cairo-directfb.h
@@ -43,7 +43,8 @@
CAIRO_BEGIN_DECLS
-cairo_surface_t * cairo_directfb_surface_create (IDirectFB *dfb,IDirectFBSurface *surface);
+cairo_public cairo_surface_t *
+cairo_directfb_surface_create (IDirectFB *dfb,IDirectFBSurface *surface);
CAIRO_END_DECLS
diff-tree ba76564270339ad9b3fca7ebd680aa94ed79b215 (from 8a1d9ca2ddb3da8338d2d9f9f1c7cc29718cc78c)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 18 13:32:00 2006 -0400
cairo-pdf.h: Add missing cairo_public decorators
(cherry picked from 7bb72f645325960e0bef4595ed7e9f1bb391796c commit)
diff --git a/src/cairo-pdf.h b/src/cairo-pdf.h
index 53699d4..52a8974 100644
--- a/src/cairo-pdf.h
+++ b/src/cairo-pdf.h
@@ -54,7 +54,7 @@ cairo_pdf_surface_create_for_stream (cai
double width_in_points,
double height_in_points);
-void
+cairo_public void
cairo_pdf_surface_set_size (cairo_surface_t *surface,
double width_in_points,
double height_in_points);
diff-tree 8a1d9ca2ddb3da8338d2d9f9f1c7cc29718cc78c (from cb46125b5f6676f15fef9091c7912d6ec369b626)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 18 13:28:29 2006 -0400
check-headers.sh: Add a test for cairo_public decorators in public headers
Test fails currently because of bug 8313 and similar issues.
(cherry picked from 01f10fb27a675ff26bb0c0ca6748479215e6d6bd commit)
diff --git a/src/Makefile.am b/src/Makefile.am
index 3141c2e..c0171ef 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -263,7 +263,7 @@ install-data-local:
false ; \
fi
-TESTS = check-def.sh check-plt.sh
+TESTS = check-def.sh check-plt.sh check-headers.sh
EXTRA_DIST += $(TESTS)
CLEANFILES = cairo.def cairo-features.h
diff --git a/src/check-headers.sh b/src/check-headers.sh
new file mode 100755
index 0000000..1e8d590
--- /dev/null
+++ b/src/check-headers.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+LANG=C
+
+test -z "$srcdir" && srcdir=.
+status=0
+
+echo Checking public headers for missing cairo_public decorators
+
+find "$srcdir" -name '*.h' -not -name '*-private.h' -not -name '*-test.h' -not -name 'cairoint.h' |
+xargs grep -B 1 '^cairo_.*[ ]\+(' |
+awk '
+/^--$/ { context=""; public=0; next; }
+/:cairo_.*[ ]+\(/ { if (!public) {print context; print; print "--";} next; }
+/-cairo_public\>/ {public=1;}
+{ context=$0; }
+' |
+sed 's/[.]h-/.h:/' |
+grep . && status=1
+
+exit $status
diff-tree cb46125b5f6676f15fef9091c7912d6ec369b626 (from 87569840412698599e324482f6117522f9ae58f4)
Author: Carl Worth <cworth at cworth.org>
Date: Wed Sep 13 15:25:07 2006 -0700
Fix typo in error message (enhacement -> enhancement)
(cherry picked from edfceea853dd6ae189843f138478c7d43fb98367 commit)
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 49a4638..7f869dc 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -148,7 +148,7 @@ _cairo_format_from_pixman_format (pixman
"\tRed mask: 0x%08x\n"
"\tGreen mask: 0x%08x\n"
"\tBlue mask: 0x%08x\n"
- "Please file an enhacement request (quoting the above) at:\n"
+ "Please file an enhancement request (quoting the above) at:\n"
PACKAGE_BUGREPORT "\n",
bpp, am, rm, gm, bm);
diff-tree 87569840412698599e324482f6117522f9ae58f4 (from 48e0509f932dde5c847dfc0e9f5ef92d69abe2fc)
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date: Sat Sep 9 19:52:48 2006 -0700
Correctly acquire/release mutex in _cairo_scaled_font_map_destroy
_cairo_scaled_font_map_destroy needs to both lock/unlock the mutex,
not just unlock it.
(cherry picked from 5ab72579ef2a9fce1aedf3068825ccba683b6e79 commit)
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
old mode 100644
new mode 100755
index 3f028db..700f209
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -226,13 +226,15 @@ void
_cairo_scaled_font_map_destroy (void)
{
int i;
- cairo_scaled_font_map_t *font_map = cairo_scaled_font_map;
+ cairo_scaled_font_map_t *font_map;
cairo_scaled_font_t *scaled_font;
- if (font_map == NULL)
- return;
+ CAIRO_MUTEX_LOCK (cairo_scaled_font_map_mutex);
- CAIRO_MUTEX_UNLOCK (cairo_scaled_font_map_mutex);
+ font_map = cairo_scaled_font_map;
+ if (font_map == NULL) {
+ goto CLEANUP_MUTEX_LOCK;
+ }
for (i = 0; i < font_map->num_holdovers; i++) {
scaled_font = font_map->holdovers[i];
@@ -250,6 +252,9 @@ _cairo_scaled_font_map_destroy (void)
free (cairo_scaled_font_map);
cairo_scaled_font_map = NULL;
+
+ CLEANUP_MUTEX_LOCK:
+ CAIRO_MUTEX_UNLOCK (cairo_scaled_font_map_mutex);
}
/* Fowler / Noll / Vo (FNV) Hash (http://www.isthe.com/chongo/tech/comp/fnv/)
diff-tree 48e0509f932dde5c847dfc0e9f5ef92d69abe2fc (from baca4a50ac3485c190baf909c31465cdcfc20c03)
Author: Carl Worth <cworth at cworth.org>
Date: Sat Sep 9 16:04:19 2006 -0700
test/bitmap-font: Fix arguments to FcFreeTypeQuery to avoid warnings.
(cherry picked from 416e94532b1584b2ff23dd270c70ab900d55c326 commit)
diff --git a/test/bitmap-font.c b/test/bitmap-font.c
index 7e3c79e..d38243a 100644
--- a/test/bitmap-font.c
+++ b/test/bitmap-font.c
@@ -53,7 +53,7 @@ draw (cairo_t *cr, int width, int height
cairo_status_t status;
const char *srcdir = getenv ("srcdir");
char *filename;
- int *face_count;
+ int face_count;
struct stat stat_buf;
if (! srcdir)
@@ -66,7 +66,7 @@ draw (cairo_t *cr, int width, int height
return CAIRO_TEST_FAILURE;
}
- pattern = FcFreeTypeQuery (filename, 0, NULL, &face_count);
+ pattern = FcFreeTypeQuery ((unsigned char *)filename, 0, NULL, &face_count);
free (filename);
if (! pattern) {
cairo_test_log ("FcFreeTypeQuery failed.\n");
diff-tree baca4a50ac3485c190baf909c31465cdcfc20c03 (from 387499c650430b389d0af81e4c0e14a347f8266d)
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date: Sat Sep 9 17:06:21 2006 -0700
[win32] Misc win32 compilation fixes
Fix win32/MSVC defines for snprintf, inline, and M_PI
(cherry picked from 3c5a02c3edf300494cebfe746292b1eeeea08595 commit)
diff --git a/src/cairoint.h b/src/cairoint.h
index f17be94..690809d 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -65,6 +65,11 @@
#include "cairo.h"
#include <pixman.h>
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#define inline __inline
+#endif
+
CAIRO_BEGIN_DECLS
#if __GNUC__ >= 3 && defined(__ELF__)
diff --git a/test/cairo-test.h b/test/cairo-test.h
index 8402d13..4f430ac 100644
--- a/test/cairo-test.h
+++ b/test/cairo-test.h
@@ -31,7 +31,6 @@
#endif
#include <stdio.h>
-#include <math.h>
#include <cairo.h>
CAIRO_BEGIN_DECLS
@@ -65,6 +64,12 @@ typedef unsigned __int64 uint64_t;
#define CAIRO_PRINTF_FORMAT(fmt_index, va_index)
#endif
+#ifdef _MSC_VER
+#define _USE_MATH_DEFINES
+#endif
+
+#include <math.h>
+
typedef enum cairo_test_status {
CAIRO_TEST_SUCCESS = 0,
CAIRO_TEST_FAILURE,
diff-tree 387499c650430b389d0af81e4c0e14a347f8266d (from 2be2b112310ec1dff8e0adae25ec84812e807d9b)
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date: Sat Sep 9 17:05:00 2006 -0700
[win32] Make cairo as a win32 static library possible
This adds a win32 initialization function that is called from all
surface creation and font creation functions to ensure that the win32
mutexes are initialized.
(cherry picked from dbd0fa193c77a6cb112b4862c72c3a18209a755e commit)
diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c
old mode 100644
new mode 100755
index 62c0f46..d92987c
--- a/src/cairo-win32-font.c
+++ b/src/cairo-win32-font.c
@@ -237,6 +237,8 @@ _win32_scaled_font_create (LOGFONTW
cairo_matrix_t scale;
cairo_status_t status;
+ _cairo_win32_initialize ();
+
f = malloc (sizeof(cairo_win32_scaled_font_t));
if (f == NULL)
return NULL;
@@ -468,6 +470,8 @@ _cairo_win32_scaled_font_create_toy (cai
int face_name_len;
cairo_status_t status;
+ _cairo_win32_initialize ();
+
status = _cairo_utf8_to_utf16 (toy_face->family, -1,
&face_name, &face_name_len);
if (status)
@@ -1489,6 +1493,8 @@ _cairo_win32_font_face_scaled_font_creat
{
cairo_win32_font_face_t *font_face = abstract_face;
+ _cairo_win32_initialize ();
+
*font = _win32_scaled_font_create (&font_face->logfont,
font_face->hfont,
&font_face->base,
@@ -1526,6 +1532,8 @@ cairo_win32_font_face_create_for_logfont
{
cairo_win32_font_face_t *font_face;
+ _cairo_win32_initialize ();
+
font_face = malloc (sizeof (cairo_win32_font_face_t));
if (!font_face) {
_cairo_error (CAIRO_STATUS_NO_MEMORY);
@@ -1559,6 +1567,8 @@ cairo_win32_font_face_create_for_hfont (
{
cairo_win32_font_face_t *font_face;
+ _cairo_win32_initialize ();
+
font_face = malloc (sizeof (cairo_win32_font_face_t));
if (!font_face) {
_cairo_error (CAIRO_STATUS_NO_MEMORY);
diff --git a/src/cairo-win32-private.h b/src/cairo-win32-private.h
old mode 100644
new mode 100755
index 8a8ccea..c16c7e9
--- a/src/cairo-win32-private.h
+++ b/src/cairo-win32-private.h
@@ -82,4 +82,7 @@ _cairo_win32_print_gdi_error (const char
cairo_bool_t
_cairo_surface_is_win32 (cairo_surface_t *surface);
+void
+_cairo_win32_initialize ();
+
#endif /* CAIRO_WIN32_PRIVATE_H */
diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
old mode 100644
new mode 100755
index 0554e43..27bdcfa
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -266,6 +266,8 @@ _cairo_win32_surface_create_for_dc (HDC
char *bits;
int rowstride;
+ _cairo_win32_initialize ();
+
surface = malloc (sizeof (cairo_win32_surface_t));
if (surface == NULL) {
_cairo_error (CAIRO_STATUS_NO_MEMORY);
@@ -1104,6 +1106,8 @@ cairo_win32_surface_create (HDC hdc)
int depth;
cairo_format_t format;
+ _cairo_win32_initialize ();
+
/* Try to figure out the drawing bounds for the Device context
*/
if (GetClipBox (hdc, &rect) == ERROR) {
@@ -1274,11 +1278,28 @@ static const cairo_surface_backend_t cai
* threaded before any other function.
* Initializing more than finally needed should not matter much.
*/
-#ifndef HAVE_PTHREAD_H
+#if !defined(HAVE_PTHREAD_H)
+
CRITICAL_SECTION cairo_toy_font_face_hash_table_mutex;
CRITICAL_SECTION cairo_scaled_font_map_mutex;
CRITICAL_SECTION cairo_ft_unscaled_font_map_mutex;
+static int _cairo_win32_initialized = 0;
+
+void
+_cairo_win32_initialize () {
+ if (_cairo_win32_initialized)
+ return;
+
+ /* every 'mutex' from CAIRO_MUTEX_DECALRE needs to be initialized here */
+ InitializeCriticalSection (&cairo_toy_font_face_hash_table_mutex);
+ InitializeCriticalSection (&cairo_scaled_font_map_mutex);
+ InitializeCriticalSection (&cairo_ft_unscaled_font_map_mutex);
+
+ _cairo_win32_initialized = 1;
+}
+
+#if !defined(CAIRO_WIN32_STATIC_BUILD)
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
@@ -1287,10 +1308,7 @@ DllMain (HINSTANCE hinstDLL,
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
- /* every 'mutex' from CAIRO_MUTEX_DECALRE needs to be initialized here */
- InitializeCriticalSection (&cairo_toy_font_face_hash_table_mutex);
- InitializeCriticalSection (&cairo_scaled_font_map_mutex);
- InitializeCriticalSection (&cairo_ft_unscaled_font_map_mutex);
+ _cairo_win32_initialize();
break;
case DLL_PROCESS_DETACH:
DeleteCriticalSection (&cairo_toy_font_face_hash_table_mutex);
@@ -1301,3 +1319,4 @@ DllMain (HINSTANCE hinstDLL,
return TRUE;
}
#endif
+#endif
diff-tree 2be2b112310ec1dff8e0adae25ec84812e807d9b (from d0657f65dd03415a83d0b56585d6f4116e806b9c)
Author: Carl Worth <cworth at cworth.org>
Date: Thu Sep 7 16:10:40 2006 -0700
Use new return value from _cairo_output_stream_destroy
This is a little simpler than the old idiom of calling
_cairo_output_stream_get_status just before calling
_cairo_output_stream_destroy.
I had hoped this technique would apply in more cases, but
many cases want to separate the two actions anyway to do
conditional assignment of the status value, (in order to
not overwrite an earlier error value).
(cherry picked from 179f7defdffb254936592a02208c338c13466253 commit)
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 68d0e7c..e066fbe 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -546,8 +546,7 @@ _cairo_pdf_surface_finish (void *abstrac
"%%%%EOF\r\n",
offset);
- status = _cairo_output_stream_get_status (surface->output);
- _cairo_output_stream_destroy (surface->output);
+ status = _cairo_output_stream_destroy (surface->output);
_cairo_array_fini (&surface->objects);
_cairo_array_fini (&surface->pages);
diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index 2b24bf2..d4c60b6 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -1803,8 +1803,7 @@ _cairo_svg_document_finish (cairo_svg_do
_cairo_output_stream_destroy (document->xml_node_glyphs);
_cairo_output_stream_destroy (document->xml_node_defs);
- status = _cairo_output_stream_get_status (output);
- _cairo_output_stream_destroy (output);
+ status = _cairo_output_stream_destroy (output);
for (i = 0; i < document->meta_snapshots.num_elements; i++) {
snapshot = _cairo_array_index (&document->meta_snapshots, i);
diff-tree d0657f65dd03415a83d0b56585d6f4116e806b9c (from 13612ac7a876e4969304713a346a0ef3bf7eaece)
Author: Carl Worth <cworth at cworth.org>
Date: Thu Sep 7 16:01:07 2006 -0700
Make _cairo_output_stream_destroy return the stream's status as a last gasp.
(cherry picked from 89e7d5d4208bd943c884d4261dc7484ac654132c commit)
diff --git a/src/cairo-output-stream-private.h b/src/cairo-output-stream-private.h
index d1eeeeb..913fb60 100644
--- a/src/cairo-output-stream-private.h
+++ b/src/cairo-output-stream-private.h
@@ -60,7 +60,7 @@ _cairo_output_stream_init (cairo_output_
cairo_output_stream_write_func_t write_func,
cairo_output_stream_close_func_t close_func);
-cairo_private void
+cairo_private cairo_status_t
_cairo_output_stream_fini (cairo_output_stream_t *stream);
@@ -86,10 +86,16 @@ _cairo_output_stream_create (cairo_write
cairo_close_func_t close_func,
void *closure);
-cairo_private void
+/* Returns the final status value associated with this object, just
+ * before its last gasp. This final status value will capture any
+ * status failure returned by the stream's close_func as well. */
+cairo_private cairo_status_t
_cairo_output_stream_close (cairo_output_stream_t *stream);
-cairo_private void
+/* Returns the final status value associated with this object, just
+ * before its last gasp. This final status value will capture any
+ * status failure returned by the stream's close_func as well. */
+cairo_private cairo_status_t
_cairo_output_stream_destroy (cairo_output_stream_t *stream);
cairo_private void
diff --git a/src/cairo-output-stream.c b/src/cairo-output-stream.c
index ad52d3d..f9e527f 100644
--- a/src/cairo-output-stream.c
+++ b/src/cairo-output-stream.c
@@ -57,13 +57,12 @@ _cairo_output_stream_init (cairo_output_
stream->closed = FALSE;
}
-cairo_private void
+cairo_private cairo_status_t
_cairo_output_stream_fini (cairo_output_stream_t *stream)
{
- _cairo_output_stream_close (stream);
+ return _cairo_output_stream_close (stream);
}
-
const cairo_output_stream_t cairo_output_stream_nil = {
NULL, /* write_func */
NULL, /* close_func */
@@ -130,37 +129,44 @@ _cairo_output_stream_create (cairo_write
return &stream->base;
}
-void
+cairo_status_t
_cairo_output_stream_close (cairo_output_stream_t *stream)
{
cairo_status_t status;
if (stream->closed)
- return;
+ return stream->status;
if (stream == &cairo_output_stream_nil ||
stream == &cairo_output_stream_nil_write_error)
{
- return;
+ return stream->status;
}
if (stream->close_func) {
status = stream->close_func (stream);
- if (status)
+ /* Don't overwrite a pre-existing status failure. */
+ if (stream->status == CAIRO_STATUS_SUCCESS)
stream->status = status;
}
stream->closed = TRUE;
+
+ return stream->status;
}
-void
+cairo_status_t
_cairo_output_stream_destroy (cairo_output_stream_t *stream)
{
+ cairo_status_t status;
+
if (stream == NULL)
- return;
+ return CAIRO_STATUS_NULL_POINTER;
- _cairo_output_stream_fini (stream);
+ status = _cairo_output_stream_fini (stream);
free (stream);
+
+ return status;
}
void
diff-tree 13612ac7a876e4969304713a346a0ef3bf7eaece (from d4793cb997865789f90692a53e2bf3a77e8d5aee)
Author: Nicholas Miell <nmiell at gmail.com>
Date: Wed Sep 6 14:43:44 2006 -0700
Make the SLIM macros robust in the face of macro-renamed symbols
This doesn't actually fix the AMD64 link failure, but it does make the
foo/EXT_foo/INT_foo symbol names generated by the slim_hidden_proto()
and slim_hidden_def() macros consistent in the face of the meddling of
pixman-remap.h.
Signed-off-by: Nicholas Miell <nmiell at gmail.com>
(cherry picked from 203d70a562ce3ffca51069aecda01a9f2bb61ff5 commit)
diff --git a/pixman/src/slim_internal.h b/pixman/src/slim_internal.h
index 742059c..3d1e9a6 100644
--- a/pixman/src/slim_internal.h
+++ b/pixman/src/slim_internal.h
@@ -78,8 +78,9 @@
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_proto(name) slim_hidden_proto1(name, slim_hidden_int_name(name))
+# define slim_hidden_def(name) slim_hidden_def1(name, slim_hidden_int_name(name))
+# define slim_hidden_int_name(name) INT_##name
# define slim_hidden_proto1(name, internal) \
extern __typeof (name) name \
__asm__ (slim_hidden_asmname (internal)) \
diff --git a/src/cairoint.h b/src/cairoint.h
index bf7d288..f17be94 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -68,8 +68,9 @@
CAIRO_BEGIN_DECLS
#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_proto(name) slim_hidden_proto1(name, slim_hidden_int_name(name))
+# define slim_hidden_def(name) slim_hidden_def1(name, slim_hidden_int_name(name))
+# define slim_hidden_int_name(name) INT_##name
# define slim_hidden_proto1(name, internal) \
extern __typeof (name) name \
__asm__ (slim_hidden_asmname (internal)) \
diff-tree d4793cb997865789f90692a53e2bf3a77e8d5aee (from bd8790bbc502df2d446d68ca1cad523220b1c0d3)
Author: Nicholas Miell <nmiell at gmail.com>
Date: Wed Sep 6 15:45:00 2006 -0700
Fix the AMD64 final link by removing SLIM from pixman
In order for SLIM's PLT indirection avoidance to work, everything in
the library that makes internal function calls needs to see the
relevant slim_hidden_proto() macro in addition to the function's
prototype. However, external headers used by clients of the shared
library should not use the SLIM macros at all.
Pixman is a rather odd case -- it's mostly independent from cairo, so
it has it's own public interface, but it's built as a part of cairo
instead of its own shared library. This means that cairo would need to
see all of pixman's slim_hidden_proto() macros in order to function
and it doesn't currently, which results in a link failure on AMD64
systems and on i386 systems (I think, I haven't actually verified
this) it produces a shared object that isn't actally sharable.
I have no idea why exactly the link failure only showed up as a result
of commit e06246b9b1015eb89112f628d5820fcb350a7335. I think it has
something to do with the pixman functions no longer having PLT entries
at all, but the exact interaction isn't clear to me.
However, all of these pixman functions aren't part of the cairo ABI
(which is why they were marked pixman_private in the first place),
which means that the SLIMification of pixman is largely pointless --
they aren't externally visible, so they don't need PLT entries at
all. Furthermore, while pixman may eventually be shared among cairo
and X, I'm told that this sharing will be source-level only, which
means it won't ever be an actual shared library and thus won't ever
need SLIM at all.
So, I just removed all use of SLIM in pixman (leaving behind
slim_internal.h for the future edification of anyone who cares).This
fixes the AMD64 link failure and passes the check-plt & check-def
parts of make check.
Signed-off-by: Nicholas Miell <nmiell at gmail.com>
(cherry picked from d598cd8d61863ff91f505241a773595aec7e8445 commit)
diff --git a/pixman/src/fbpict.c b/pixman/src/fbpict.c
index 07c293a..675d1fb 100644
--- a/pixman/src/fbpict.c
+++ b/pixman/src/fbpict.c
@@ -1902,7 +1902,6 @@ pixman_composite (pixman_operator_t op,
}
pixman_region_destroy (region);
}
-slim_hidden_def(pixman_composite);
/* The CPU detection code needs to be in a file not compiled with
* "-mmmx -msse", as gcc would generate CMOV instructions otherwise
diff --git a/pixman/src/iccolor.c b/pixman/src/iccolor.c
index 716382f..26b4aaf 100644
--- a/pixman/src/iccolor.c
+++ b/pixman/src/iccolor.c
@@ -53,7 +53,6 @@ pixman_color_to_pixel (const pixman_form
a = a << format->alpha;
*pixel = r|g|b|a;
}
-slim_hidden_def(pixman_color_to_pixel);
static uint16_t
FbFillColor (uint32_t pixel, int bits)
diff --git a/pixman/src/icformat.c b/pixman/src/icformat.c
index f55d443..bf93a6c 100644
--- a/pixman/src/icformat.c
+++ b/pixman/src/icformat.c
@@ -171,7 +171,6 @@ pixman_format_init (pixman_format_t *for
(format->blueMask << format->blue) |
(format->greenMask << format->green));
}
-slim_hidden_def(pixman_format_init);
void
pixman_format_destroy (pixman_format_t *format)
diff --git a/pixman/src/icimage.c b/pixman/src/icimage.c
index 11e8396..44c4c8b 100644
--- a/pixman/src/icimage.c
+++ b/pixman/src/icimage.c
@@ -45,7 +45,6 @@ pixman_image_create (pixman_format_t *fo
return image;
}
-slim_hidden_def(pixman_image_create);
pixman_image_t *
pixman_image_create_for_data (FbBits *data, pixman_format_t *format, int width, int height, int bpp, int stride)
@@ -369,7 +368,6 @@ pixman_image_set_component_alpha (pixman
if (image)
image->componentAlpha = component_alpha;
}
-slim_hidden_def(pixman_image_set_component_alpha);
int
pixman_image_set_transform (pixman_image_t *image,
@@ -412,7 +410,6 @@ pixman_image_set_repeat (pixman_image_t
if (image)
image->repeat = repeat;
}
-slim_hidden_def(pixman_image_set_repeat);
void
pixman_image_set_filter (pixman_image_t *image,
@@ -505,7 +502,6 @@ pixman_image_destroy (pixman_image_t *im
free (image);
}
-slim_hidden_def(pixman_image_destroy);
void
pixman_image_destroyClip (pixman_image_t *image)
diff --git a/pixman/src/icint.h b/pixman/src/icint.h
index e1265eb..c846a51 100644
--- a/pixman/src/icint.h
+++ b/pixman/src/icint.h
@@ -33,8 +33,6 @@
#include <string.h>
#include <limits.h>
-#include "slim_internal.h"
-
#ifndef __GNUC__
#define __inline
#endif
@@ -852,17 +850,6 @@ 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: */
diff --git a/pixman/src/icrect.c b/pixman/src/icrect.c
index 7253bfa..e4d0c12 100644
--- a/pixman/src/icrect.c
+++ b/pixman/src/icrect.c
@@ -363,4 +363,3 @@ bail1:
;
}
}
-slim_hidden_def(pixman_fill_rectangles);
diff --git a/pixman/src/pixregion.c b/pixman/src/pixregion.c
index c9bc219..5112157 100644
--- a/pixman/src/pixregion.c
+++ b/pixman/src/pixregion.c
@@ -50,7 +50,6 @@ SOFTWARE.
#include <string.h>
#include "pixregionint.h"
-#include "slim_internal.h"
#if defined (__GNUC__) && !defined (NO_INLINES)
#define INLINE __inline
@@ -89,10 +88,6 @@ pixman_init (pixman_region16_t *region,
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
@@ -327,7 +322,6 @@ pixman_region_create_simple (pixman_box1
return region;
}
-slim_hidden_def(pixman_region_create_simple);
/*****************************************************************
* RegionInit(pReg, rect, size)
@@ -452,7 +446,6 @@ pixman_region_copy(pixman_region16_t *ds
dst->data->numRects * sizeof(pixman_box16_t));
return PIXMAN_REGION_STATUS_SUCCESS;
}
-slim_hidden_def(pixman_region_copy);
/*======================================================================
* Generic Region Operator
@@ -1232,7 +1225,6 @@ pixman_region_union(pixman_region16_t *n
good(newReg);
return PIXMAN_REGION_STATUS_SUCCESS;
}
-slim_hidden_def(pixman_region_union);
/*======================================================================
* Batch Rectangle Union
diff-tree bd8790bbc502df2d446d68ca1cad523220b1c0d3 (from e46d73951d81fbc18baaf6649c0442637724b19a)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Sep 6 16:39:18 2006 -0400
[x86-64] check-plt.sh: match on JU?MP_SLO as on x86-64 "SLOT" is truncated
(cherry picked from b5a64138bb9be97b96e6bf248c559e8d3c6d4ac1 commit)
diff --git a/src/check-plt.sh b/src/check-plt.sh
index 1dd9005..a441b7b 100755
--- a/src/check-plt.sh
+++ b/src/check-plt.sh
@@ -11,7 +11,7 @@ fi
for so in .libs/lib*.so; do
echo Checking $so for local PLT entries
- readelf -r $so | grep 'JU\?MP_SLOT' | grep 'cairo\|pixman' && status=1
+ readelf -r $so | grep 'JU\?MP_SLO' | grep 'cairo\|pixman' && status=1
done
exit $status
diff-tree e46d73951d81fbc18baaf6649c0442637724b19a (from b0c18ef2e8695a22ed3a1d0db8d91198b535bb9e)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Sep 6 13:54:12 2006 -0400
Add scripts to sanity check the shared object for exported and PLT symbols
src/check-def.sh checks that the list of symbols exported is the same as the
list of symbols in cairo.def, ie. symbols in public header files. (except for
symbols starting with _cairo)
src/check-plt.sh checks that no PLT entries exist for local function calls.
This makes sure we keep the 'slim' annotations uptodate.
These two are defined as tests in src/ and will be run during "make distcheck".
However, they are skipped if the commands 'nm' and 'readelf' are not found.
(We don't really rely on any functionality of eu-readelf, so using readelf
proper which should be more commonlly installed.)
(cherry picked from cd1b6650648b5a688b4b6c2d696d9434c824a13f commit)
diff --git a/RELEASING b/RELEASING
index 3190072..3275972 100644
--- a/RELEASING
+++ b/RELEASING
@@ -7,6 +7,9 @@ Here are the steps to follow to create a
2) Verify that the code passes "make distcheck"
+ First, make sure you have 'nm' and 'readelf' commands in PATH.
+ this should be Ok with any Linux distro.
+
Running "make distcheck" should result in no warnings or
errors and end with a message of the form:
@@ -18,35 +21,10 @@ Here are the steps to follow to create a
(But the tar file isn't actually ready yet, as we still have
some more steps to follow).
-2.a) Verify that there are no local symbol PLT entries.
-
- XXX: Currently this is a manual step, but it would be nice to
- get all the support for this integrated automatically into
- make distcheck. (An alternative approach would automate the
- generation of the aliases such as is done for fontconfig
- rather than maintaining these manually with the slim_hidden
- macros).
-
- For now, here's what you need:
-
- 1. The elfutils package for your distribution
- 2. The relinfo.pl scritp available here:
-
- http://people.freedesktop.org/~keithp/relinfo.pl
-
- Then run the following command:
-
- relinfo.pl src/.libs/libcairo.so
-
- And ensure that it reports "0 for local syms". If not, then
- run the following:
-
- eu-readelf -r src/.libs/libcairo.so
-
- And look for the symbols related to cairo in the relocation
- section. For each of these, a call to slim_hidden_def and
- slim_hidden_proto is needed in the cairo implementation in the
- style of other similar calls.
+ If you get errors about local PLT entries, you get the list of
+ cairo and pixman entries with the error. For each of these, a
+ call to slim_hidden_def and slim_hidden_proto is needed in the
+ cairo or pixman implementation in the style of other similar calls.
3) Fill out an entry in the NEWS file
diff --git a/src/Makefile.am b/src/Makefile.am
index 80e7ee3..3141c2e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -263,4 +263,7 @@ install-data-local:
false ; \
fi
+TESTS = check-def.sh check-plt.sh
+EXTRA_DIST += $(TESTS)
+
CLEANFILES = cairo.def cairo-features.h
diff --git a/src/check-def.sh b/src/check-def.sh
new file mode 100755
index 0000000..9417dbe
--- /dev/null
+++ b/src/check-def.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+LANG=C
+
+if ! which nm 2>/dev/null >/dev/null; then
+ echo "'nm' not found; skipping test"
+ exit 0
+fi
+
+test -z "$srcdir" && srcdir=.
+status=0
+
+defs="cairo.def"
+make $defs
+for def in $defs; do
+ lib=${def%.def}
+ lib=${lib##*/}
+ so=.libs/lib${lib}.so
+
+ test -f $so || continue
+ echo Checking $def
+
+ {
+ echo EXPORTS
+ nm $so | grep ' T ' | cut -d' ' -f3 | grep -v '^_cairo\|^_fini\|^_init' | sort -u
+ # cheat: copy the last line from the def file!
+ tail -n1 $def
+ } | diff $def - || status=1
+done
+
+exit $status
diff --git a/src/check-plt.sh b/src/check-plt.sh
new file mode 100755
index 0000000..1dd9005
--- /dev/null
+++ b/src/check-plt.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+LANG=C
+
+status=0
+
+if ! which readelf 2>/dev/null >/dev/null; then
+ echo "'readelf' not found; skipping test"
+ exit 0
+fi
+
+for so in .libs/lib*.so; do
+ echo Checking $so for local PLT entries
+ readelf -r $so | grep 'JU\?MP_SLOT' | grep 'cairo\|pixman' && status=1
+done
+
+exit $status
diff-tree b0c18ef2e8695a22ed3a1d0db8d91198b535bb9e (from e14a7b0786ff778b813899bcc91b4f76c2287d36)
Author: Carl Worth <cworth at cworth.org>
Date: Tue Sep 5 17:12:43 2006 -0700
RELEASING: Add note on checking for local symbol PLT entries.
(cherry picked from 4620b929ae84dfa08c1c9a4072e114f6b38e1bd9 commit)
diff --git a/RELEASING b/RELEASING
index b46a64a..3190072 100644
--- a/RELEASING
+++ b/RELEASING
@@ -18,6 +18,36 @@ Here are the steps to follow to create a
(But the tar file isn't actually ready yet, as we still have
some more steps to follow).
+2.a) Verify that there are no local symbol PLT entries.
+
+ XXX: Currently this is a manual step, but it would be nice to
+ get all the support for this integrated automatically into
+ make distcheck. (An alternative approach would automate the
+ generation of the aliases such as is done for fontconfig
+ rather than maintaining these manually with the slim_hidden
+ macros).
+
+ For now, here's what you need:
+
+ 1. The elfutils package for your distribution
+ 2. The relinfo.pl scritp available here:
+
+ http://people.freedesktop.org/~keithp/relinfo.pl
+
+ Then run the following command:
+
+ relinfo.pl src/.libs/libcairo.so
+
+ And ensure that it reports "0 for local syms". If not, then
+ run the following:
+
+ eu-readelf -r src/.libs/libcairo.so
+
+ And look for the symbols related to cairo in the relocation
+ section. For each of these, a call to slim_hidden_def and
+ slim_hidden_proto is needed in the cairo implementation in the
+ style of other similar calls.
+
3) Fill out an entry in the NEWS file
Sift through the logs since the last release. This is most
diff-tree e14a7b0786ff778b813899bcc91b4f76c2287d36 (from 94ef526d4b1ad2b421971dcb95420b0d21a5a8fe)
Author: Carl Worth <cworth at cworth.org>
Date: Tue Sep 5 16:52:34 2006 -0700
slim_hidden_proto: Move smeicolon from definition to use for consistency and legibility
(cherry picked from 60c4add26abe6b624d7569f35fa846d529ccea18 commit)
diff --git a/src/cairo-ft-private.h b/src/cairo-ft-private.h
index 5457e3b..3e28f5e 100644
--- a/src/cairo-ft-private.h
+++ b/src/cairo-ft-private.h
@@ -67,9 +67,9 @@ _cairo_ft_unscaled_font_unlock_face (cai
cairo_private cairo_bool_t
_cairo_ft_scaled_font_is_vertical (cairo_scaled_font_t *scaled_font);
-slim_hidden_proto(cairo_ft_font_options_substitute)
-slim_hidden_proto(cairo_ft_scaled_font_lock_face)
-slim_hidden_proto(cairo_ft_scaled_font_unlock_face)
+slim_hidden_proto (cairo_ft_font_options_substitute);
+slim_hidden_proto (cairo_ft_scaled_font_lock_face);
+slim_hidden_proto (cairo_ft_scaled_font_unlock_face);
CAIRO_END_DECLS
diff --git a/src/cairo-xlib-private.h b/src/cairo-xlib-private.h
index 053cae7..ddac05a 100644
--- a/src/cairo-xlib-private.h
+++ b/src/cairo-xlib-private.h
@@ -54,7 +54,7 @@ _cairo_xlib_screen_info_get (Display *di
#if CAIRO_HAS_XLIB_XRENDER_SURFACE
#include "cairo-xlib-xrender.h"
-slim_hidden_proto (cairo_xlib_surface_create_with_xrender_format)
+slim_hidden_proto (cairo_xlib_surface_create_with_xrender_format);
#endif
diff --git a/src/cairoint.h b/src/cairoint.h
index 0de43a9..bf7d288 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -73,7 +73,7 @@ CAIRO_BEGIN_DECLS
# define slim_hidden_proto1(name, internal) \
extern __typeof (name) name \
__asm__ (slim_hidden_asmname (internal)) \
- cairo_private;
+ cairo_private
# define slim_hidden_def1(name, internal) \
extern __typeof (name) EXT_##name __asm__(slim_hidden_asmname(name)) \
__attribute__((__alias__(slim_hidden_asmname(internal))))
@@ -2308,88 +2308,88 @@ cairo_private int
_cairo_dtostr (char *buffer, size_t size, double d);
/* Avoid unnecessary PLT entries. */
-slim_hidden_proto(cairo_clip_preserve)
-slim_hidden_proto(cairo_close_path)
-slim_hidden_proto(cairo_create)
-slim_hidden_proto(cairo_curve_to)
-slim_hidden_proto(cairo_destroy)
-slim_hidden_proto(cairo_fill_preserve)
-slim_hidden_proto(cairo_font_face_destroy)
-slim_hidden_proto(cairo_font_face_reference)
-slim_hidden_proto(cairo_font_options_create)
-slim_hidden_proto(cairo_font_options_destroy)
-slim_hidden_proto(cairo_font_options_equal)
-slim_hidden_proto(cairo_font_options_hash)
-slim_hidden_proto(cairo_font_options_merge)
-slim_hidden_proto(cairo_font_options_set_antialias)
-slim_hidden_proto(cairo_font_options_set_hint_metrics)
-slim_hidden_proto(cairo_font_options_set_hint_style)
-slim_hidden_proto(cairo_font_options_set_subpixel_order)
-slim_hidden_proto(cairo_get_current_point)
-slim_hidden_proto(cairo_get_matrix)
-slim_hidden_proto(cairo_get_tolerance)
-slim_hidden_proto(cairo_image_surface_create)
-slim_hidden_proto(cairo_image_surface_create_for_data)
-slim_hidden_proto(cairo_image_surface_get_height)
-slim_hidden_proto(cairo_image_surface_get_width)
-slim_hidden_proto(cairo_line_to)
-slim_hidden_proto(cairo_mask)
-slim_hidden_proto(cairo_matrix_init)
-slim_hidden_proto(cairo_matrix_init_identity)
-slim_hidden_proto(cairo_matrix_init_rotate)
-slim_hidden_proto(cairo_matrix_init_scale)
-slim_hidden_proto(cairo_matrix_init_translate)
-slim_hidden_proto(cairo_matrix_invert)
-slim_hidden_proto(cairo_matrix_multiply)
-slim_hidden_proto(cairo_matrix_scale)
-slim_hidden_proto(cairo_matrix_transform_distance)
-slim_hidden_proto(cairo_matrix_transform_point)
-slim_hidden_proto(cairo_matrix_translate)
-slim_hidden_proto(cairo_move_to)
-slim_hidden_proto(cairo_new_path)
-slim_hidden_proto(cairo_paint)
-slim_hidden_proto(cairo_pattern_create_for_surface)
-slim_hidden_proto(cairo_pattern_create_rgb)
-slim_hidden_proto(cairo_pattern_create_rgba)
-slim_hidden_proto(cairo_pattern_destroy)
-slim_hidden_proto(cairo_pattern_get_extend)
-slim_hidden_proto(cairo_pattern_get_type)
-slim_hidden_proto(cairo_pattern_reference)
-slim_hidden_proto(cairo_pattern_set_matrix)
-slim_hidden_proto(cairo_pop_group)
-slim_hidden_proto(cairo_pop_group_to_source)
-slim_hidden_proto(cairo_push_group)
-slim_hidden_proto(cairo_push_group_with_content)
-slim_hidden_proto(cairo_rel_line_to)
-slim_hidden_proto(cairo_restore)
-slim_hidden_proto(cairo_save)
-slim_hidden_proto(cairo_scaled_font_create)
-slim_hidden_proto(cairo_scaled_font_destroy)
-slim_hidden_proto(cairo_scaled_font_extents)
-slim_hidden_proto(cairo_scaled_font_get_ctm)
-slim_hidden_proto(cairo_scaled_font_get_font_face)
-slim_hidden_proto(cairo_scaled_font_get_font_matrix)
-slim_hidden_proto(cairo_scaled_font_get_font_options)
-slim_hidden_proto(cairo_scaled_font_glyph_extents)
-slim_hidden_proto(cairo_scaled_font_reference)
-slim_hidden_proto(cairo_set_operator)
-slim_hidden_proto(cairo_set_source)
-slim_hidden_proto(cairo_set_source_surface)
-slim_hidden_proto(cairo_status)
-slim_hidden_proto(cairo_stroke_preserve)
-slim_hidden_proto(cairo_surface_create_similar)
-slim_hidden_proto(cairo_surface_destroy)
-slim_hidden_proto(cairo_surface_finish)
-slim_hidden_proto(cairo_surface_get_content)
-slim_hidden_proto(cairo_surface_get_device_offset)
-slim_hidden_proto(cairo_surface_get_font_options)
-slim_hidden_proto(cairo_surface_get_type)
-slim_hidden_proto(cairo_surface_mark_dirty_rectangle)
-slim_hidden_proto(cairo_surface_reference)
-slim_hidden_proto(cairo_surface_set_device_offset)
-slim_hidden_proto(cairo_surface_set_fallback_resolution)
-slim_hidden_proto(cairo_surface_status)
-slim_hidden_proto(cairo_surface_write_to_png_stream)
+slim_hidden_proto (cairo_clip_preserve);
+slim_hidden_proto (cairo_close_path);
+slim_hidden_proto (cairo_create);
+slim_hidden_proto (cairo_curve_to);
+slim_hidden_proto (cairo_destroy);
+slim_hidden_proto (cairo_fill_preserve);
+slim_hidden_proto (cairo_font_face_destroy);
+slim_hidden_proto (cairo_font_face_reference);
+slim_hidden_proto (cairo_font_options_create);
+slim_hidden_proto (cairo_font_options_destroy);
+slim_hidden_proto (cairo_font_options_equal);
+slim_hidden_proto (cairo_font_options_hash);
+slim_hidden_proto (cairo_font_options_merge);
+slim_hidden_proto (cairo_font_options_set_antialias);
+slim_hidden_proto (cairo_font_options_set_hint_metrics);
+slim_hidden_proto (cairo_font_options_set_hint_style);
+slim_hidden_proto (cairo_font_options_set_subpixel_order);
+slim_hidden_proto (cairo_get_current_point);
+slim_hidden_proto (cairo_get_matrix);
+slim_hidden_proto (cairo_get_tolerance);
+slim_hidden_proto (cairo_image_surface_create);
+slim_hidden_proto (cairo_image_surface_create_for_data);
+slim_hidden_proto (cairo_image_surface_get_height);
+slim_hidden_proto (cairo_image_surface_get_width);
+slim_hidden_proto (cairo_line_to);
+slim_hidden_proto (cairo_mask);
+slim_hidden_proto (cairo_matrix_init);
+slim_hidden_proto (cairo_matrix_init_identity);
+slim_hidden_proto (cairo_matrix_init_rotate);
+slim_hidden_proto (cairo_matrix_init_scale);
+slim_hidden_proto (cairo_matrix_init_translate);
+slim_hidden_proto (cairo_matrix_invert);
+slim_hidden_proto (cairo_matrix_multiply);
+slim_hidden_proto (cairo_matrix_scale);
+slim_hidden_proto (cairo_matrix_transform_distance);
+slim_hidden_proto (cairo_matrix_transform_point);
+slim_hidden_proto (cairo_matrix_translate);
+slim_hidden_proto (cairo_move_to);
+slim_hidden_proto (cairo_new_path);
+slim_hidden_proto (cairo_paint);
+slim_hidden_proto (cairo_pattern_create_for_surface);
+slim_hidden_proto (cairo_pattern_create_rgb);
+slim_hidden_proto (cairo_pattern_create_rgba);
+slim_hidden_proto (cairo_pattern_destroy);
+slim_hidden_proto (cairo_pattern_get_extend);
+slim_hidden_proto (cairo_pattern_get_type);
+slim_hidden_proto (cairo_pattern_reference);
+slim_hidden_proto (cairo_pattern_set_matrix);
+slim_hidden_proto (cairo_pop_group);
+slim_hidden_proto (cairo_pop_group_to_source);
+slim_hidden_proto (cairo_push_group);
+slim_hidden_proto (cairo_push_group_with_content);
+slim_hidden_proto (cairo_rel_line_to);
+slim_hidden_proto (cairo_restore);
+slim_hidden_proto (cairo_save);
+slim_hidden_proto (cairo_scaled_font_create);
+slim_hidden_proto (cairo_scaled_font_destroy);
+slim_hidden_proto (cairo_scaled_font_extents);
+slim_hidden_proto (cairo_scaled_font_get_ctm);
+slim_hidden_proto (cairo_scaled_font_get_font_face);
+slim_hidden_proto (cairo_scaled_font_get_font_matrix);
+slim_hidden_proto (cairo_scaled_font_get_font_options);
+slim_hidden_proto (cairo_scaled_font_glyph_extents);
+slim_hidden_proto (cairo_scaled_font_reference);
+slim_hidden_proto (cairo_set_operator);
+slim_hidden_proto (cairo_set_source);
+slim_hidden_proto (cairo_set_source_surface);
+slim_hidden_proto (cairo_status);
+slim_hidden_proto (cairo_stroke_preserve);
+slim_hidden_proto (cairo_surface_create_similar);
+slim_hidden_proto (cairo_surface_destroy);
+slim_hidden_proto (cairo_surface_finish);
+slim_hidden_proto (cairo_surface_get_content);
+slim_hidden_proto (cairo_surface_get_device_offset);
+slim_hidden_proto (cairo_surface_get_font_options);
+slim_hidden_proto (cairo_surface_get_type);
+slim_hidden_proto (cairo_surface_mark_dirty_rectangle);
+slim_hidden_proto (cairo_surface_reference);
+slim_hidden_proto (cairo_surface_set_device_offset);
+slim_hidden_proto (cairo_surface_set_fallback_resolution);
+slim_hidden_proto (cairo_surface_status);
+slim_hidden_proto (cairo_surface_write_to_png_stream);
CAIRO_END_DECLS
diff --git a/src/test-fallback-surface.c b/src/test-fallback-surface.c
index 8d3ebda..479c8ef 100644
--- a/src/test-fallback-surface.c
+++ b/src/test-fallback-surface.c
@@ -64,7 +64,7 @@ typedef struct _test_fallback_surface {
const cairo_private cairo_surface_backend_t test_fallback_surface_backend;
-slim_hidden_proto (_test_fallback_surface_create)
+slim_hidden_proto (_test_fallback_surface_create);
cairo_surface_t *
_test_fallback_surface_create (cairo_content_t content,
diff-tree 94ef526d4b1ad2b421971dcb95420b0d21a5a8fe (from bbc0f3f87d281e19c6038a7b51c8247f5861658f)
Author: Carl Worth <cworth at cworth.org>
Date: Tue Sep 5 16:48:49 2006 -0700
Add many missing slim_hidden calls to bypass PLT entries for local use of public functions
(cherry picked from d7f08794ef194d0b86a749381472bfeb0a32d993 commit)
diff --git a/src/cairo-font-options.c b/src/cairo-font-options.c
index e3a5f75..2b0cd98 100644
--- a/src/cairo-font-options.c
+++ b/src/cairo-font-options.c
@@ -95,6 +95,7 @@ cairo_font_options_create (void)
return options;
}
+slim_hidden_def (cairo_font_options_create);
/**
* cairo_font_options_copy:
@@ -137,6 +138,7 @@ cairo_font_options_destroy (cairo_font_o
free (options);
}
+slim_hidden_def (cairo_font_options_destroy);
/**
* cairo_font_options_status:
@@ -182,6 +184,7 @@ cairo_font_options_merge (cairo_font_opt
if (other->hint_metrics != CAIRO_HINT_METRICS_DEFAULT)
options->hint_metrics = other->hint_metrics;
}
+slim_hidden_def (cairo_font_options_merge);
/**
* cairo_font_options_equal:
@@ -201,6 +204,7 @@ cairo_font_options_equal (const cairo_fo
options->hint_style == other->hint_style &&
options->hint_metrics == other->hint_metrics);
}
+slim_hidden_def (cairo_font_options_equal);
/**
* cairo_font_options_hash:
@@ -222,6 +226,7 @@ cairo_font_options_hash (const cairo_fon
(options->hint_style << 8) |
(options->hint_metrics << 16));
}
+slim_hidden_def (cairo_font_options_hash);
/**
* cairo_font_options_set_antialias:
@@ -240,6 +245,7 @@ cairo_font_options_set_antialias (cairo_
options->antialias = antialias;
}
+slim_hidden_def (cairo_font_options_set_antialias);
/**
* cairo_font_options_get_antialias:
@@ -275,6 +281,7 @@ cairo_font_options_set_subpixel_order (c
options->subpixel_order = subpixel_order;
}
+slim_hidden_def (cairo_font_options_set_subpixel_order);
/**
* cairo_font_options_get_subpixel_order:
@@ -310,6 +317,7 @@ cairo_font_options_set_hint_style (cairo
options->hint_style = hint_style;
}
+slim_hidden_def (cairo_font_options_set_hint_style);
/**
* cairo_font_options_get_hint_style:
@@ -345,6 +353,7 @@ cairo_font_options_set_hint_metrics (cai
options->hint_metrics = hint_metrics;
}
+slim_hidden_def (cairo_font_options_set_hint_metrics);
/**
* cairo_font_options_get_hint_metrics:
diff --git a/src/cairo-font.c b/src/cairo-font.c
index fc68aff..3730686 100644
--- a/src/cairo-font.c
+++ b/src/cairo-font.c
@@ -93,6 +93,7 @@ cairo_font_face_reference (cairo_font_fa
return font_face;
}
+slim_hidden_def (cairo_font_face_reference);
/**
* cairo_font_face_destroy:
@@ -129,6 +130,7 @@ cairo_font_face_destroy (cairo_font_face
free (font_face);
}
+slim_hidden_def (cairo_font_face_destroy);
/**
* cairo_font_face_get_type:
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 38897a8..25fabc9 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -552,6 +552,7 @@ _cairo_ft_unscaled_font_lock_face (cairo
return face;
}
+slim_hidden_def (cairo_ft_scaled_font_lock_face);
/* Unlock unscaled font locked with _cairo_ft_unscaled_font_lock_face
*/
@@ -562,6 +563,7 @@ _cairo_ft_unscaled_font_unlock_face (cai
unscaled->lock--;
}
+slim_hidden_def (cairo_ft_scaled_font_unlock_face);
static void
_compute_transform (cairo_ft_font_transform_t *sf,
@@ -2268,6 +2270,7 @@ cairo_ft_font_options_substitute (const
#endif
}
}
+slim_hidden_def (cairo_ft_font_options_substitute);
/**
* cairo_ft_font_face_create_for_pattern:
diff --git a/src/cairo-ft-private.h b/src/cairo-ft-private.h
index 34c5d9c..5457e3b 100644
--- a/src/cairo-ft-private.h
+++ b/src/cairo-ft-private.h
@@ -64,11 +64,14 @@ _cairo_ft_unscaled_font_lock_face (cairo
cairo_private void
_cairo_ft_unscaled_font_unlock_face (cairo_ft_unscaled_font_t *unscaled);
-cairo_bool_t
+cairo_private cairo_bool_t
_cairo_ft_scaled_font_is_vertical (cairo_scaled_font_t *scaled_font);
+slim_hidden_proto(cairo_ft_font_options_substitute)
+slim_hidden_proto(cairo_ft_scaled_font_lock_face)
+slim_hidden_proto(cairo_ft_scaled_font_unlock_face)
+
CAIRO_END_DECLS
#endif /* CAIRO_HAS_FT_FONT */
-
#endif /* CAIRO_FT_PRIVATE_H */
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 86562b9..49a4638 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -275,6 +275,7 @@ cairo_image_surface_create (cairo_format
return surface;
}
+slim_hidden_def (cairo_image_surface_create);
cairo_surface_t *
_cairo_image_surface_create_with_content (cairo_content_t content,
@@ -354,6 +355,7 @@ cairo_image_surface_create_for_data (uns
return surface;
}
+slim_hidden_def (cairo_image_surface_create_for_data);
cairo_surface_t *
_cairo_image_surface_create_for_data_with_content (unsigned char *data,
@@ -440,6 +442,7 @@ cairo_image_surface_get_width (cairo_sur
return image_surface->width;
}
+slim_hidden_def (cairo_image_surface_get_width);
/**
* cairo_image_surface_get_height:
@@ -461,6 +464,7 @@ cairo_image_surface_get_height (cairo_su
return image_surface->height;
}
+slim_hidden_def (cairo_image_surface_get_height);
/**
* cairo_image_surface_get_stride:
diff --git a/src/cairo-matrix.c b/src/cairo-matrix.c
index e418ef3..60cdca3 100644
--- a/src/cairo-matrix.c
+++ b/src/cairo-matrix.c
@@ -170,6 +170,7 @@ cairo_matrix_translate (cairo_matrix_t *
cairo_matrix_multiply (matrix, &tmp, matrix);
}
+slim_hidden_def (cairo_matrix_translate);
/**
* cairo_matrix_init_scale:
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index ebdb136..a859e52 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -331,6 +331,7 @@ cairo_pattern_create_rgb (double red, do
return pattern;
}
+slim_hidden_def (cairo_pattern_create_rgb);
/**
* cairo_pattern_create_rgba:
@@ -373,6 +374,7 @@ cairo_pattern_create_rgba (double red, d
return pattern;
}
+slim_hidden_def (cairo_pattern_create_rgba);
/**
* cairo_pattern_create_for_surface:
@@ -410,6 +412,7 @@ cairo_pattern_create_for_surface (cairo_
return &pattern->base;
}
+slim_hidden_def (cairo_pattern_create_for_surface);
/**
* cairo_pattern_create_linear:
@@ -523,6 +526,7 @@ cairo_pattern_reference (cairo_pattern_t
return pattern;
}
+slim_hidden_def (cairo_pattern_reference);
/**
* cairo_pattern_get_type:
@@ -540,6 +544,7 @@ cairo_pattern_get_type (cairo_pattern_t
{
return pattern->type;
}
+slim_hidden_def (cairo_pattern_get_type);
/**
* cairo_pattern_status:
@@ -583,6 +588,7 @@ cairo_pattern_destroy (cairo_pattern_t *
_cairo_pattern_fini (pattern);
free (pattern);
}
+slim_hidden_def (cairo_pattern_destroy);
static void
_cairo_pattern_add_color_stop (cairo_gradient_pattern_t *pattern,
@@ -764,6 +770,7 @@ cairo_pattern_set_matrix (cairo_pattern_
pattern->matrix = *matrix;
}
+slim_hidden_def (cairo_pattern_set_matrix);
/**
* cairo_pattern_get_matrix:
@@ -827,6 +834,7 @@ cairo_pattern_get_extend (cairo_pattern_
{
return pattern->extend;
}
+slim_hidden_def (cairo_pattern_get_extend);
void
_cairo_pattern_transform (cairo_pattern_t *pattern,
diff --git a/src/cairo-png.c b/src/cairo-png.c
index 3155cad..3b33b54 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -287,6 +287,7 @@ cairo_surface_write_to_png_stream (cairo
return write_png (surface, stream_write_func, &png_closure);
}
+slim_hidden_def (cairo_surface_write_to_png_stream);
static INLINE int
multiply_alpha (int alpha, int color)
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 9a13fb7..3f028db 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -493,6 +493,7 @@ UNWIND_FONT_MAP_LOCK:
UNWIND:
return NULL;
}
+slim_hidden_def (cairo_scaled_font_create);
/**
* cairo_scaled_font_reference:
@@ -551,6 +552,7 @@ cairo_scaled_font_reference (cairo_scale
return scaled_font;
}
+slim_hidden_def (cairo_scaled_font_reference);
/**
* cairo_scaled_font_destroy:
@@ -611,6 +613,7 @@ cairo_scaled_font_destroy (cairo_scaled_
}
_cairo_scaled_font_map_unlock ();
}
+slim_hidden_def (cairo_scaled_font_destroy);
/* Public font API follows. */
@@ -627,6 +630,7 @@ cairo_scaled_font_extents (cairo_scaled_
{
*extents = scaled_font->extents;
}
+slim_hidden_def (cairo_scaled_font_extents);
/**
* cairo_scaled_font_text_extents:
@@ -752,6 +756,7 @@ cairo_scaled_font_glyph_extents (cairo_s
extents->x_advance = x_pos - glyphs[0].x;
extents->y_advance = y_pos - glyphs[0].y;
}
+slim_hidden_def (cairo_scaled_font_glyph_extents);
cairo_status_t
_cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
@@ -1408,6 +1413,7 @@ cairo_scaled_font_get_font_face (cairo_s
return scaled_font->font_face;
}
+slim_hidden_def (cairo_scaled_font_get_font_face);
/**
* cairo_scaled_font_get_font_matrix:
@@ -1430,6 +1436,7 @@ cairo_scaled_font_get_font_matrix (cairo
*font_matrix = scaled_font->font_matrix;
}
+slim_hidden_def (cairo_scaled_font_get_font_matrix);
/**
* cairo_scaled_font_get_ctm:
@@ -1451,6 +1458,7 @@ cairo_scaled_font_get_ctm (cairo_scaled_
*ctm = scaled_font->ctm;
}
+slim_hidden_def (cairo_scaled_font_get_ctm);
/**
* cairo_scaled_font_get_font_options:
@@ -1473,3 +1481,4 @@ cairo_scaled_font_get_font_options (cair
_cairo_font_options_init_copy (options, &scaled_font->options);
}
+slim_hidden_def (cairo_scaled_font_get_font_options);
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 0468ca2..cbbe89a 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -197,6 +197,7 @@ cairo_surface_get_type (cairo_surface_t
* surface. */
return surface->type;
}
+slim_hidden_def (cairo_surface_get_type);
/**
* cairo_surface_get_content:
@@ -232,6 +233,7 @@ cairo_surface_status (cairo_surface_t *s
{
return surface->status;
}
+slim_hidden_def (cairo_surface_status);
void
_cairo_surface_init (cairo_surface_t *surface,
@@ -338,6 +340,7 @@ cairo_surface_create_similar (cairo_surf
width, height,
CAIRO_COLOR_TRANSPARENT);
}
+slim_hidden_def (cairo_surface_create_similar);
cairo_surface_t *
_cairo_surface_create_similar_solid (cairo_surface_t *other,
@@ -416,6 +419,7 @@ cairo_surface_reference (cairo_surface_t
return surface;
}
+slim_hidden_def (cairo_surface_reference);
/**
* cairo_surface_destroy:
@@ -497,6 +501,7 @@ cairo_surface_finish (cairo_surface_t *s
surface->finished = TRUE;
}
+slim_hidden_def (cairo_surface_finish);
/**
* cairo_surface_get_user_data:
@@ -602,6 +607,7 @@ cairo_surface_get_font_options (cairo_su
_cairo_font_options_init_copy (options, &surface->font_options);
}
+slim_hidden_def (cairo_surface_get_font_options);
/**
* cairo_surface_flush:
@@ -708,6 +714,7 @@ cairo_surface_mark_dirty_rectangle (cair
_cairo_surface_set_error (surface, status);
}
}
+slim_hidden_def (cairo_surface_mark_dirty_rectangle);
/**
* _cairo_surface_set_device_scale:
@@ -790,6 +797,7 @@ cairo_surface_set_device_offset (cairo_s
surface->device_transform_inverse.x0 = - x_offset;
surface->device_transform_inverse.y0 = - y_offset;
}
+slim_hidden_def (cairo_surface_set_device_offset);
/**
* cairo_surface_get_device_offset:
@@ -810,6 +818,7 @@ cairo_surface_get_device_offset (cairo_s
*x_offset = surface->device_transform.x0;
*y_offset = surface->device_transform.y0;
}
+slim_hidden_def (cairo_surface_get_device_offset);
/**
* cairo_surface_set_fallback_resolution:
@@ -849,6 +858,7 @@ cairo_surface_set_fallback_resolution (c
surface->x_fallback_resolution = x_pixels_per_inch;
surface->y_fallback_resolution = y_pixels_per_inch;
}
+slim_hidden_def (cairo_surface_set_fallback_resolution);
cairo_bool_t
_cairo_surface_has_device_transform (cairo_surface_t *surface)
diff --git a/src/cairo-xlib-private.h b/src/cairo-xlib-private.h
index f319dcc..053cae7 100644
--- a/src/cairo-xlib-private.h
+++ b/src/cairo-xlib-private.h
@@ -51,4 +51,11 @@ struct _cairo_xlib_screen_info {
cairo_private cairo_xlib_screen_info_t *
_cairo_xlib_screen_info_get (Display *display, Screen *screen);
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
+
+#include "cairo-xlib-xrender.h"
+slim_hidden_proto (cairo_xlib_surface_create_with_xrender_format)
+
+#endif
+
#endif /* CAIRO_XLIB_PRIVATE_H */
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 55f95e8..365e40d 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -2010,6 +2010,7 @@ cairo_xlib_surface_create_with_xrender_f
return _cairo_xlib_surface_create_internal (dpy, drawable, screen,
NULL, format, width, height, 0);
}
+slim_hidden_def (cairo_xlib_surface_create_with_xrender_format);
/**
* cairo_xlib_surface_set_size:
diff --git a/src/cairo.c b/src/cairo.c
index 928ebca..425a717 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -206,6 +206,7 @@ cairo_create (cairo_surface_t *target)
return cr;
}
+slim_hidden_def (cairo_create);
/**
* cairo_reference:
@@ -267,6 +268,7 @@ cairo_destroy (cairo_t *cr)
free (cr);
}
+slim_hidden_def (cairo_destroy);
/**
* cairo_save:
@@ -571,6 +573,7 @@ cairo_set_operator (cairo_t *cr, cairo_o
if (cr->status)
_cairo_set_error (cr, cr->status);
}
+slim_hidden_def (cairo_set_operator);
/**
* cairo_set_source_rgb
@@ -674,6 +677,7 @@ cairo_set_source_surface (cairo_t *cr,
cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);
}
+slim_hidden_def (cairo_set_source_surface);
/**
* cairo_set_source
@@ -714,6 +718,7 @@ cairo_set_source (cairo_t *cr, cairo_pat
if (cr->status)
_cairo_set_error (cr, cr->status);
}
+slim_hidden_def (cairo_set_source);
/**
* cairo_get_source:
@@ -1268,6 +1273,7 @@ cairo_line_to (cairo_t *cr, double x, do
if (cr->status)
_cairo_set_error (cr, cr->status);
}
+slim_hidden_def (cairo_line_to);
/**
* cairo_curve_to:
@@ -1321,6 +1327,7 @@ cairo_curve_to (cairo_t *cr,
if (cr->status)
_cairo_set_error (cr, cr->status);
}
+slim_hidden_def (cairo_curve_to);
/**
* cairo_arc:
@@ -1683,6 +1690,7 @@ cairo_paint (cairo_t *cr)
if (cr->status)
_cairo_set_error (cr, cr->status);
}
+slim_hidden_def (cairo_paint);
/**
* cairo_paint_with_alpha:
@@ -1754,6 +1762,7 @@ cairo_mask (cairo_t *cr,
if (cr->status)
_cairo_set_error (cr, cr->status);
}
+slim_hidden_def (cairo_mask);
/**
* cairo_mask_surface:
@@ -2614,6 +2623,7 @@ cairo_get_tolerance (cairo_t *cr)
{
return _cairo_gstate_get_tolerance (cr->gstate);
}
+slim_hidden_def (cairo_get_tolerance);
/**
* cairo_get_antialias:
@@ -2757,6 +2767,7 @@ cairo_get_matrix (cairo_t *cr, cairo_mat
{
_cairo_gstate_get_matrix (cr->gstate, matrix);
}
+slim_hidden_def (cairo_get_matrix);
/**
* cairo_get_target:
@@ -2942,6 +2953,7 @@ cairo_status (cairo_t *cr)
{
return cr->status;
}
+slim_hidden_def (cairo_status);
/**
* cairo_status_to_string:
diff --git a/src/cairoint.h b/src/cairoint.h
index 119ee26..0de43a9 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1720,7 +1720,7 @@ _cairo_surface_init (cairo_surface_t *
const cairo_surface_backend_t *backend,
cairo_content_t content);
-void
+cairo_private void
_cairo_surface_set_font_options (cairo_surface_t *surface,
cairo_font_options_t *options);
@@ -2025,7 +2025,7 @@ cairo_private cairo_int_status_t
_cairo_image_surface_set_clip_region (void *abstract_surface,
pixman_region16_t *region);
-cairo_image_surface_t *
+cairo_private cairo_image_surface_t *
_cairo_image_surface_clone (cairo_image_surface_t *surface,
cairo_format_t format);
@@ -2234,7 +2234,7 @@ _cairo_pattern_transform (cairo_pattern_
cairo_private cairo_bool_t
_cairo_pattern_is_opaque_solid (const cairo_pattern_t *pattern);
-cairo_bool_t
+cairo_private cairo_bool_t
_cairo_pattern_is_opaque (const cairo_pattern_t *abstract_pattern);
cairo_private cairo_int_status_t
@@ -2308,32 +2308,88 @@ cairo_private int
_cairo_dtostr (char *buffer, size_t size, double d);
/* Avoid unnecessary PLT entries. */
-slim_hidden_proto(cairo_get_current_point)
-slim_hidden_proto(cairo_fill_preserve)
slim_hidden_proto(cairo_clip_preserve)
slim_hidden_proto(cairo_close_path)
-slim_hidden_proto(cairo_matrix_invert)
-slim_hidden_proto(cairo_matrix_multiply)
-slim_hidden_proto(cairo_matrix_scale)
+slim_hidden_proto(cairo_create)
+slim_hidden_proto(cairo_curve_to)
+slim_hidden_proto(cairo_destroy)
+slim_hidden_proto(cairo_fill_preserve)
+slim_hidden_proto(cairo_font_face_destroy)
+slim_hidden_proto(cairo_font_face_reference)
+slim_hidden_proto(cairo_font_options_create)
+slim_hidden_proto(cairo_font_options_destroy)
+slim_hidden_proto(cairo_font_options_equal)
+slim_hidden_proto(cairo_font_options_hash)
+slim_hidden_proto(cairo_font_options_merge)
+slim_hidden_proto(cairo_font_options_set_antialias)
+slim_hidden_proto(cairo_font_options_set_hint_metrics)
+slim_hidden_proto(cairo_font_options_set_hint_style)
+slim_hidden_proto(cairo_font_options_set_subpixel_order)
+slim_hidden_proto(cairo_get_current_point)
+slim_hidden_proto(cairo_get_matrix)
+slim_hidden_proto(cairo_get_tolerance)
+slim_hidden_proto(cairo_image_surface_create)
+slim_hidden_proto(cairo_image_surface_create_for_data)
+slim_hidden_proto(cairo_image_surface_get_height)
+slim_hidden_proto(cairo_image_surface_get_width)
+slim_hidden_proto(cairo_line_to)
+slim_hidden_proto(cairo_mask)
slim_hidden_proto(cairo_matrix_init)
slim_hidden_proto(cairo_matrix_init_identity)
-slim_hidden_proto(cairo_matrix_init_translate)
-slim_hidden_proto(cairo_matrix_init_scale)
slim_hidden_proto(cairo_matrix_init_rotate)
+slim_hidden_proto(cairo_matrix_init_scale)
+slim_hidden_proto(cairo_matrix_init_translate)
+slim_hidden_proto(cairo_matrix_invert)
+slim_hidden_proto(cairo_matrix_multiply)
+slim_hidden_proto(cairo_matrix_scale)
slim_hidden_proto(cairo_matrix_transform_distance)
slim_hidden_proto(cairo_matrix_transform_point)
+slim_hidden_proto(cairo_matrix_translate)
slim_hidden_proto(cairo_move_to)
slim_hidden_proto(cairo_new_path)
+slim_hidden_proto(cairo_paint)
+slim_hidden_proto(cairo_pattern_create_for_surface)
+slim_hidden_proto(cairo_pattern_create_rgb)
+slim_hidden_proto(cairo_pattern_create_rgba)
+slim_hidden_proto(cairo_pattern_destroy)
+slim_hidden_proto(cairo_pattern_get_extend)
+slim_hidden_proto(cairo_pattern_get_type)
+slim_hidden_proto(cairo_pattern_reference)
+slim_hidden_proto(cairo_pattern_set_matrix)
+slim_hidden_proto(cairo_pop_group)
+slim_hidden_proto(cairo_pop_group_to_source)
+slim_hidden_proto(cairo_push_group)
+slim_hidden_proto(cairo_push_group_with_content)
slim_hidden_proto(cairo_rel_line_to)
slim_hidden_proto(cairo_restore)
slim_hidden_proto(cairo_save)
+slim_hidden_proto(cairo_scaled_font_create)
+slim_hidden_proto(cairo_scaled_font_destroy)
+slim_hidden_proto(cairo_scaled_font_extents)
+slim_hidden_proto(cairo_scaled_font_get_ctm)
+slim_hidden_proto(cairo_scaled_font_get_font_face)
+slim_hidden_proto(cairo_scaled_font_get_font_matrix)
+slim_hidden_proto(cairo_scaled_font_get_font_options)
+slim_hidden_proto(cairo_scaled_font_glyph_extents)
+slim_hidden_proto(cairo_scaled_font_reference)
+slim_hidden_proto(cairo_set_operator)
+slim_hidden_proto(cairo_set_source)
+slim_hidden_proto(cairo_set_source_surface)
+slim_hidden_proto(cairo_status)
slim_hidden_proto(cairo_stroke_preserve)
+slim_hidden_proto(cairo_surface_create_similar)
slim_hidden_proto(cairo_surface_destroy)
+slim_hidden_proto(cairo_surface_finish)
slim_hidden_proto(cairo_surface_get_content)
-slim_hidden_proto(cairo_push_group)
-slim_hidden_proto(cairo_push_group_with_content)
-slim_hidden_proto(cairo_pop_group)
-slim_hidden_proto(cairo_pop_group_to_source)
+slim_hidden_proto(cairo_surface_get_device_offset)
+slim_hidden_proto(cairo_surface_get_font_options)
+slim_hidden_proto(cairo_surface_get_type)
+slim_hidden_proto(cairo_surface_mark_dirty_rectangle)
+slim_hidden_proto(cairo_surface_reference)
+slim_hidden_proto(cairo_surface_set_device_offset)
+slim_hidden_proto(cairo_surface_set_fallback_resolution)
+slim_hidden_proto(cairo_surface_status)
+slim_hidden_proto(cairo_surface_write_to_png_stream)
CAIRO_END_DECLS
diff --git a/src/test-fallback-surface.c b/src/test-fallback-surface.c
index 5c3c08c..8d3ebda 100644
--- a/src/test-fallback-surface.c
+++ b/src/test-fallback-surface.c
@@ -64,6 +64,8 @@ typedef struct _test_fallback_surface {
const cairo_private cairo_surface_backend_t test_fallback_surface_backend;
+slim_hidden_proto (_test_fallback_surface_create)
+
cairo_surface_t *
_test_fallback_surface_create (cairo_content_t content,
int width,
@@ -89,6 +91,7 @@ _test_fallback_surface_create (cairo_con
return &surface->base;
}
+slim_hidden_def (_test_fallback_surface_create);
static cairo_surface_t *
_test_fallback_surface_create_similar (void *abstract_surface,
diff-tree bbc0f3f87d281e19c6038a7b51c8247f5861658f (from 63b28849c622fe36b65100a5bc61832d3dd66481)
Author: Carl Worth <cworth at cworth.org>
Date: Tue Sep 5 16:45:01 2006 -0700
pixman: Add pixman_private decorations to hide pixman symbols from public interface
(cherry picked from e06246b9b1015eb89112f628d5820fcb350a7335 commit)
diff --git a/pixman/src/fbmmx.h b/pixman/src/fbmmx.h
index 1a6a27d..531bcba 100644
--- a/pixman/src/fbmmx.h
+++ b/pixman/src/fbmmx.h
@@ -29,6 +29,7 @@
#ifdef USE_MMX
#if !defined(__amd64__) && !defined(__x86_64__)
+pixman_private
Bool fbHaveMMX(void);
#else
#define fbHaveMMX() TRUE
@@ -40,8 +41,10 @@ Bool fbHaveMMX(void);
#ifdef USE_MMX
+pixman_private
void fbComposeSetupMMX(void);
+pixman_private
void fbCompositeSolidMask_nx8888x0565Cmmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -54,6 +57,7 @@ void fbCompositeSolidMask_nx8888x0565Cmm
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSrcAdd_8888x8888mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -66,6 +70,7 @@ void fbCompositeSrcAdd_8888x8888mmx (pix
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSolidMask_nx8888x8888Cmmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -78,6 +83,7 @@ void fbCompositeSolidMask_nx8888x8888Cmm
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSolidMask_nx8x8888mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -90,6 +96,7 @@ void fbCompositeSolidMask_nx8x8888mmx (p
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSolidMaskSrc_nx8x8888mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -102,6 +109,7 @@ void fbCompositeSolidMaskSrc_nx8x8888mmx
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSrcAdd_8000x8000mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -114,6 +122,7 @@ void fbCompositeSrcAdd_8000x8000mmx (pix
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSrc_8888RevNPx8888mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -126,6 +135,7 @@ void fbCompositeSrc_8888RevNPx8888mmx (p
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSrc_8888RevNPx0565mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -138,6 +148,7 @@ void fbCompositeSrc_8888RevNPx0565mmx (p
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSolid_nx8888mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -150,6 +161,7 @@ void fbCompositeSolid_nx8888mmx (pixman_
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSolid_nx0565mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -162,6 +174,7 @@ void fbCompositeSolid_nx0565mmx (pixman_
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSolidMask_nx8x0565mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -174,6 +187,7 @@ void fbCompositeSolidMask_nx8x0565mmx (p
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSrc_x888x8x8888mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -186,6 +200,7 @@ void fbCompositeSrc_x888x8x8888mmx (pixm
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSrc_8888x8x8888mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -198,6 +213,7 @@ void fbCompositeSrc_8888x8x8888mmx (pixm
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
void fbCompositeSrc_8888x8888mmx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -210,6 +226,7 @@ void fbCompositeSrc_8888x8888mmx (pixman
INT16 yDst,
CARD16 width,
CARD16 height);
+pixman_private
Bool fbCopyAreammx (FbPixels *pSrc,
FbPixels *pDst,
int src_x,
@@ -218,6 +235,8 @@ Bool fbCopyAreammx (FbPixels *pSrc,
int dst_y,
int width,
int height);
+
+pixman_private
void fbCompositeCopyAreammx (pixman_operator_t op,
PicturePtr pSrc,
PicturePtr pMask,
@@ -230,6 +249,8 @@ void fbCompositeCopyAreammx (pixman_oper
INT16 yDst,
CARD16 width,
CARD16 height);
+
+pixman_private
Bool fbSolidFillmmx (FbPixels *pDraw,
int x,
int y,
diff --git a/pixman/src/icimage.h b/pixman/src/icimage.h
index eff1be2..82202a7 100644
--- a/pixman/src/icimage.h
+++ b/pixman/src/icimage.h
@@ -243,7 +243,7 @@ FbComputeCompositeRegion (pixman_region1
uint16_t width,
uint16_t height);
-int
+pixman_private int
miIsSolidAlpha (pixman_image_t *src);
/*
diff --git a/pixman/src/pixman.h b/pixman/src/pixman.h
index 57b317a..309e5e6 100644
--- a/pixman/src/pixman.h
+++ b/pixman/src/pixman.h
@@ -99,6 +99,14 @@ SOFTWARE.
#include "pixman-remap.h"
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
+#define pixman_private __attribute__((__visibility__("hidden")))
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define pixman_private __hidden
+#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
+#define pixman_private
+#endif
+
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
@@ -118,37 +126,37 @@ typedef enum {
/* creation/destruction */
-pixman_region16_t *
+pixman_private pixman_region16_t *
pixman_region_create (void);
-pixman_region16_t *
+pixman_private pixman_region16_t *
pixman_region_create_simple (pixman_box16_t *extents);
-void
+pixman_private void
pixman_region_destroy (pixman_region16_t *region);
/* manipulation */
-void
+pixman_private void
pixman_region_translate (pixman_region16_t *region, int x, int y);
-pixman_region_status_t
+pixman_private pixman_region_status_t
pixman_region_copy (pixman_region16_t *dest, pixman_region16_t *source);
-pixman_region_status_t
+pixman_private pixman_region_status_t
pixman_region_intersect (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_region16_t *reg2);
-pixman_region_status_t
+pixman_private pixman_region_status_t
pixman_region_union (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_region16_t *reg2);
-pixman_region_status_t
+pixman_private 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_private pixman_region_status_t
pixman_region_subtract (pixman_region16_t *regD, pixman_region16_t *regM, pixman_region16_t *regS);
-pixman_region_status_t
+pixman_private 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
@@ -159,10 +167,10 @@ RectsTopixman_region16_t (int nrects, xR
/* querying */
/* XXX: These should proably be combined: pixman_region_get_rects? */
-int
+pixman_private int
pixman_region_num_rects (pixman_region16_t *region);
-pixman_box16_t *
+pixman_private pixman_box16_t *
pixman_region_rects (pixman_region16_t *region);
/* XXX: Change to an enum */
@@ -170,36 +178,36 @@ pixman_region_rects (pixman_region16_t *
#define rgnIN 1
#define rgnPART 2
-int
+pixman_private int
pixman_region_contains_point (pixman_region16_t *region, int x, int y, pixman_box16_t *box);
-int
+pixman_private int
pixman_region_contains_rectangle (pixman_region16_t *pixman_region16_t, pixman_box16_t *prect);
-int
+pixman_private int
pixman_region_not_empty (pixman_region16_t *region);
-pixman_box16_t *
+pixman_private 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_private pixman_region_status_t
pixman_region_append (pixman_region16_t *dest, pixman_region16_t *region);
-pixman_region_status_t
+pixman_private 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_private void
pixman_region_reset (pixman_region16_t *region, pixman_box16_t *pBox);
-void
+pixman_private void
pixman_region_empty (pixman_region16_t *region);
/* ic.h */
@@ -234,20 +242,20 @@ typedef enum pixman_format_name {
typedef struct pixman_format pixman_format_t;
-pixman_format_t *
+pixman_private pixman_format_t *
pixman_format_create (pixman_format_name_t name);
-pixman_format_t *
+pixman_private pixman_format_t *
pixman_format_create_masks (int bpp,
int alpha_mask,
int red_mask,
int green_mask,
int blue_mask);
-void
+pixman_private void
pixman_format_destroy (pixman_format_t *format);
-void
+pixman_private void
pixman_format_get_masks (pixman_format_t *format,
unsigned int *bpp,
unsigned int *alpha_mask,
@@ -259,7 +267,7 @@ pixman_format_get_masks (pixman_format_t
typedef struct pixman_image pixman_image_t;
-pixman_image_t *
+pixman_private pixman_image_t *
pixman_image_create (pixman_format_t *format,
int width,
int height);
@@ -284,16 +292,16 @@ pixman_image_create (pixman_format_t *fo
typedef uint32_t pixman_bits_t;
#endif
-pixman_image_t *
+pixman_private 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_private void
pixman_image_destroy (pixman_image_t *image);
-int
+pixman_private int
pixman_image_set_clip_region (pixman_image_t *image,
pixman_region16_t *region);
@@ -368,11 +376,11 @@ typedef enum {
PIXMAN_FILTER_BILINEAR
} pixman_filter_t;
-void
+pixman_private void
pixman_image_set_component_alpha (pixman_image_t *image,
int component_alpha);
-int
+pixman_private int
pixman_image_set_transform (pixman_image_t *image,
pixman_transform_t *transform);
@@ -384,57 +392,57 @@ typedef enum {
PIXMAN_REPEAT_REFLECT
} pixman_repeat_t;
-void
+pixman_private void
pixman_image_set_repeat (pixman_image_t *image,
pixman_repeat_t repeat);
-void
+pixman_private void
pixman_image_set_filter (pixman_image_t *image,
pixman_filter_t filter);
-int
+pixman_private int
pixman_image_get_width (pixman_image_t *image);
-int
+pixman_private int
pixman_image_get_height (pixman_image_t *image);
-int
+pixman_private int
pixman_image_get_stride (pixman_image_t *image);
-int
+pixman_private int
pixman_image_get_depth (pixman_image_t *image);
-pixman_format_t *
+pixman_private pixman_format_t *
pixman_image_get_format (pixman_image_t *image);
-pixman_bits_t *
+pixman_private pixman_bits_t *
pixman_image_get_data (pixman_image_t *image);
-pixman_image_t *
+pixman_private pixman_image_t *
pixman_image_create_linear_gradient (const pixman_linear_gradient_t *gradient,
const pixman_gradient_stop_t *stops,
int n_stops);
-pixman_image_t *
+pixman_private pixman_image_t *
pixman_image_create_radial_gradient (const pixman_radial_gradient_t *gradient,
const pixman_gradient_stop_t *stops,
int n_stops);
/* iccolor.c */
-void
+pixman_private void
pixman_color_to_pixel (const pixman_format_t *format,
const pixman_color_t *color,
pixman_bits_t *pixel);
-void
+pixman_private void
pixman_pixel_to_color (const pixman_format_t *format,
pixman_bits_t pixel,
pixman_color_t *color);
/* icrect.c */
-void
+pixman_private void
pixman_fill_rectangle (pixman_operator_t op,
pixman_image_t *dst,
const pixman_color_t *color,
@@ -443,7 +451,7 @@ pixman_fill_rectangle (pixman_operator_t
unsigned int width,
unsigned int height);
-void
+pixman_private void
pixman_fill_rectangles (pixman_operator_t op,
pixman_image_t *dst,
const pixman_color_t *color,
@@ -452,7 +460,7 @@ pixman_fill_rectangles (pixman_operator_
/* ictrap.c */
-void
+pixman_private void
pixman_composite_trapezoids (pixman_operator_t op,
pixman_image_t *src,
pixman_image_t *dst,
@@ -461,7 +469,7 @@ pixman_composite_trapezoids (pixman_oper
const pixman_trapezoid_t *traps,
int ntrap);
-void
+pixman_private void
pixman_add_trapezoids (pixman_image_t *dst,
int x_off,
int y_off,
@@ -470,7 +478,7 @@ pixman_add_trapezoids (pixman_image_t *
/* ictri.c */
-void
+pixman_private void
pixman_composite_triangles (pixman_operator_t op,
pixman_image_t *src,
pixman_image_t *dst,
@@ -479,7 +487,7 @@ pixman_composite_triangles (pixman_opera
const pixman_triangle_t *tris,
int ntris);
-void
+pixman_private void
pixman_composite_tri_strip (pixman_operator_t op,
pixman_image_t *src,
pixman_image_t *dst,
@@ -488,7 +496,7 @@ pixman_composite_tri_strip (pixman_opera
const pixman_point_fixed_t *points,
int npoints);
-void
+pixman_private void
pixman_composite_tri_fan (pixman_operator_t op,
pixman_image_t *src,
pixman_image_t *dst,
@@ -499,7 +507,7 @@ pixman_composite_tri_fan (pixman_operato
/* ic.c */
-void
+pixman_private void
pixman_composite (pixman_operator_t op,
pixman_image_t *iSrc,
pixman_image_t *iMask,
diff --git a/pixman/src/renderedge.h b/pixman/src/renderedge.h
index 522e503..55561ea 100644
--- a/pixman/src/renderedge.h
+++ b/pixman/src/renderedge.h
@@ -128,16 +128,16 @@ typedef struct {
} \
}
-xFixed
+pixman_private xFixed
RenderSampleCeilY (xFixed y, int bpp);
-xFixed
+pixman_private xFixed
RenderSampleFloorY (xFixed y, int bpp);
-void
+pixman_private void
RenderEdgeStep (RenderEdge *e, int n);
-void
+pixman_private void
RenderEdgeInit (RenderEdge *e,
int bpp,
xFixed y_start,
@@ -146,7 +146,7 @@ RenderEdgeInit (RenderEdge *e,
xFixed x_bot,
xFixed y_bot);
-void
+pixman_private void
RenderLineFixedEdgeInit (RenderEdge *e,
int bpp,
xFixed y,
diff-tree 63b28849c622fe36b65100a5bc61832d3dd66481 (from e194c9cdbe692f4e0b1b95fcdc41fd6e8dc8f07d)
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Tue Sep 5 14:53:33 2006 -0400
Improve error checking in TrueType subsetting
TrueType subsetting will SEGV when using OpenType fonts with CFF outlines.
(cherry picked from ad78eb7692f6d080430bceb7b358403f6e91a637 commit)
diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index f1b0011..c5e1799 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -400,8 +400,11 @@ cairo_truetype_font_write_generic_table
unsigned long size;
size = 0;
- font->backend->load_truetype_table( font->scaled_font_subset->scaled_font,
- tag, 0, NULL, &size);
+ if (font->backend->load_truetype_table( font->scaled_font_subset->scaled_font,
+ tag, 0, NULL, &size) != CAIRO_STATUS_SUCCESS) {
+ font->status = CAIRO_INT_STATUS_UNSUPPORTED;
+ return font->status;
+ }
status = cairo_truetype_font_allocate_write_buffer (font, size, &buffer);
/* XXX: Need to check status here. */
font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
@@ -473,8 +476,11 @@ cairo_truetype_font_write_glyf_table (ca
font->status = CAIRO_STATUS_NO_MEMORY;
return font->status;
}
- font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
- TT_TAG_loca, 0, u.bytes, &size);
+ if (font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+ TT_TAG_loca, 0, u.bytes, &size) != CAIRO_STATUS_SUCCESS) {
+ font->status = CAIRO_INT_STATUS_UNSUPPORTED;
+ return font->status;
+ }
start_offset = _cairo_array_num_elements (&font->output);
for (i = 0; i < font->base.num_glyphs; i++) {
@@ -566,17 +572,23 @@ cairo_truetype_font_write_hmtx_table (ca
status = cairo_truetype_font_allocate_write_buffer (font, long_entry_size,
(unsigned char **) &p);
if (font->glyphs[i].parent_index < num_hmetrics) {
- font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
- TT_TAG_hmtx,
- font->glyphs[i].parent_index * long_entry_size,
- (unsigned char *) p, &long_entry_size);
+ if (font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+ TT_TAG_hmtx,
+ font->glyphs[i].parent_index * long_entry_size,
+ (unsigned char *) p, &long_entry_size) != CAIRO_STATUS_SUCCESS) {
+ font->status = CAIRO_INT_STATUS_UNSUPPORTED;
+ return font->status;
+ }
}
else
{
- font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
- TT_TAG_hmtx,
- (num_hmetrics - 1) * long_entry_size,
- (unsigned char *) p, &short_entry_size);
+ if (font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+ TT_TAG_hmtx,
+ (num_hmetrics - 1) * long_entry_size,
+ (unsigned char *) p, &short_entry_size) != CAIRO_STATUS_SUCCESS) {
+ font->status = CAIRO_INT_STATUS_UNSUPPORTED;
+ return font->status;
+ }
font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
TT_TAG_hmtx,
(num_hmetrics - 1) * long_entry_size +
diff-tree e194c9cdbe692f4e0b1b95fcdc41fd6e8dc8f07d (from 25e46ac93539fac9916bb537b5bb1a0f9fea9950)
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Tue Sep 5 14:19:48 2006 -0400
Correct the value of /LastChar in the PDF Type 1 font dictionary.
(cherry picked from 49fa8d353b2926760fa92684546b2fc79985c782 commit)
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 04f5e73..68d0e7c 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -1665,7 +1665,7 @@ _cairo_pdf_surface_emit_type1_font_subse
" /Widths [",
subset_resource.id,
subset.base_font,
- font_subset->num_glyphs,
+ font_subset->num_glyphs - 1,
descriptor.id);
for (i = 0; i < font_subset->num_glyphs; i++)
diff-tree 25e46ac93539fac9916bb537b5bb1a0f9fea9950 (from ab1c334c7ea6c93cb9f998c499c2e160346c042f)
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Tue Sep 5 14:19:26 2006 -0400
Fix Type 1 embedding in PDF
PDF Files with Type 1 fonts fail to open in any version of
ghostscript prior to 8.54. The problem is the hex encoding of the
encrypted portion of the font. The PDF reference says this should
only be in binary.
(cherry picked from d81de15804f210afe9905a4163a5e34ff2be5b5b commit)
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 91a1968..04f5e73 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -1594,7 +1594,7 @@ _cairo_pdf_surface_emit_type1_font_subse
snprintf (name, sizeof name, "CairoFont-%d-%d",
font_subset->font_id, font_subset->subset_id);
- status = _cairo_type1_subset_init (&subset, name, font_subset);
+ status = _cairo_type1_subset_init (&subset, name, font_subset, FALSE);
if (status)
return status;
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 6ae3a38..019a53d 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -399,7 +399,7 @@ _cairo_ps_surface_emit_type1_font_subset
snprintf (name, sizeof name, "CairoFont-%d-%d",
font_subset->font_id, font_subset->subset_id);
- status = _cairo_type1_subset_init (&subset, name, font_subset);
+ status = _cairo_type1_subset_init (&subset, name, font_subset, TRUE);
if (status)
return status;
diff --git a/src/cairo-scaled-font-subsets-private.h b/src/cairo-scaled-font-subsets-private.h
index c41e477..8122c5c 100644
--- a/src/cairo-scaled-font-subsets-private.h
+++ b/src/cairo-scaled-font-subsets-private.h
@@ -239,6 +239,7 @@ typedef struct _cairo_type1_subset {
* _cairo_type1_subset_init:
* @type1_subset: a #cairo_type1_subset_t to initialize
* @font_subset: the #cairo_scaled_font_subset_t to initialize from
+ * @hex_encode: if true the encrypted portion of the font is hex encoded
*
* If possible (depending on the format of the underlying
* cairo_scaled_font_t and the font backend in use) generate a type1
@@ -253,7 +254,8 @@ typedef struct _cairo_type1_subset {
cairo_private cairo_status_t
_cairo_type1_subset_init (cairo_type1_subset_t *type_subset,
const char *name,
- cairo_scaled_font_subset_t *font_subset);
+ cairo_scaled_font_subset_t *font_subset,
+ cairo_bool_t hex_encode);
/**
* _cairo_type1_subset_fini:
diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index 8ee1f40..6f1be2c 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -103,7 +103,8 @@ typedef struct _cairo_type1_font_subset
static cairo_status_t
_cairo_type1_font_subset_create (cairo_unscaled_font_t *unscaled_font,
- cairo_type1_font_subset_t **subset_return)
+ cairo_type1_font_subset_t **subset_return,
+ cairo_bool_t hex_encode)
{
cairo_ft_unscaled_font_t *ft_unscaled_font;
FT_Face face;
@@ -145,6 +146,7 @@ _cairo_type1_font_subset_create (cairo_u
if (font->glyphs == NULL)
goto fail2;
+ font->hex_encode = hex_encode;
font->num_glyphs = 0;
for (i = 0; i < face->num_glyphs; i++)
font->glyphs[i].subset_index = -1;
@@ -900,7 +902,6 @@ cairo_type1_font_subset_write (cairo_typ
}
font->eexec_key = private_dict_key;
- font->hex_encode = TRUE;
font->hex_column = 0;
cairo_type1_font_subset_write_private_dict (font, name);
@@ -994,7 +995,8 @@ cairo_type1_font_subset_destroy (void *a
cairo_status_t
_cairo_type1_subset_init (cairo_type1_subset_t *type1_subset,
const char *name,
- cairo_scaled_font_subset_t *scaled_font_subset)
+ cairo_scaled_font_subset_t *scaled_font_subset,
+ cairo_bool_t hex_encode)
{
cairo_type1_font_subset_t *font;
cairo_status_t status;
@@ -1008,7 +1010,7 @@ _cairo_type1_subset_init (cairo_type1_su
unscaled_font = _cairo_ft_scaled_font_get_unscaled_font (scaled_font_subset->scaled_font);
- status = _cairo_type1_font_subset_create (unscaled_font, &font);
+ status = _cairo_type1_font_subset_create (unscaled_font, &font, hex_encode);
if (status)
return status;
@@ -1079,4 +1081,3 @@ _cairo_type1_subset_fini (cairo_type1_su
free (subset->widths);
free (subset->data);
}
-
diff-tree ab1c334c7ea6c93cb9f998c499c2e160346c042f (from 80d8e695ff6f6ae0a282d720009d1ec6a982865b)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Sep 2 19:51:54 2006 -0400
[configure] Invalidate cached warning flags if list of flags changes
such that one doesn't need to remove config.cache when when we add
new warning flags to be checked.
(cherry picked from e5a9c2330867ae11befa8a966aa0a50c31c82a32 commit)
diff --git a/configure.in b/configure.in
index a5ec54b..6d231a0 100644
--- a/configure.in
+++ b/configure.in
@@ -92,7 +92,8 @@ dnl ====================================
dnl
dnl cairo_cache_version should be increased every time that the backend
dnl detection stuff changes in a way that removing the config.cache file may be
-dnl needed for correct operation.
+dnl needed for correct operation. (this is only for the backend detection
+dnl changes; it doesn't have any effect on any other cached thing.)
dnl
m4_define(cairo_cache_version, 4)
@@ -560,7 +561,28 @@ AC_DEFUN([CAIRO_CC_TRY_FLAG], [
AC_MSG_RESULT([$cairo_cc_flag])
])
+
dnl Use lots of warning flags with with gcc and compatible compilers
+
+dnl Note: if you change the following variable, the cache is automatically
+dnl skipped and all flags rechecked. So there's no need to do anything
+dnl else. If for any reason you need to force a recheck, just change
+dnl MAYBE_WARN in an ignorable way (like adding whitespace
+
+MAYBE_WARN="-Wall -Wextra \
+-Wsign-compare -Werror-implicit-function-declaration \
+-Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
+-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
+-Wpacked -Wswitch-enum -Wmissing-format-attribute \
+-Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
+-Wdeclaration-after-statement -Wold-style-definition \
+-Wno-missing-field-initializers -Wno-unused-parameter"
+
+
+# invalidate cached value if MAYBE_WARN has changed
+if test "x$cairo_cv_warn_maybe" != "x$MAYBE_WARN"; then
+ unset cairo_cv_warn_cflags
+fi
AC_CACHE_CHECK([for supported warning flags], cairo_cv_warn_cflags, [
echo
WARN_CFLAGS=""
@@ -576,20 +598,12 @@ AC_CACHE_CHECK([for supported warning fl
# options (-Wall and -Wextra) up front and the -Wno options
# last.
- MAYBE_WARN="-Wall -Wextra \
- -Wsign-compare -Werror-implicit-function-declaration \
- -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
- -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
- -Wpacked -Wswitch-enum -Wmissing-format-attribute \
- -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
- -Wdeclaration-after-statement -Wold-style-definition \
- -Wno-missing-field-initializers -Wno-unused-parameter"
-
for W in $MAYBE_WARN; do
CAIRO_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
done
cairo_cv_warn_cflags=$WARN_CFLAGS
+ cairo_cv_warn_maybe=$MAYBE_WARN
AC_MSG_CHECKING([which warning flags were supported])])
WARN_CFLAGS=$cairo_cv_warn_cflags
diff-tree 80d8e695ff6f6ae0a282d720009d1ec6a982865b (from 4d7b341a7eb9d0f8ddd9f025867dcea7178c1a56)
Author: Carl Worth <cworth at cworth.org>
Date: Fri Sep 1 16:10:25 2006 -0700
bug 8104: Eliminate unused variables. Replicate assert statement to identify branch of interest.
(cherry picked from 7c97a787ebce4880d6b9fe47a13ad018ff2ecd31 commit)
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index eddf715..38897a8 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -603,7 +603,6 @@ _cairo_ft_unscaled_font_set_scale (cairo
{
cairo_ft_font_transform_t sf;
FT_Matrix mat;
- FT_UInt pixel_width, pixel_height;
FT_Error error;
assert (unscaled->face != NULL);
@@ -642,19 +641,16 @@ _cairo_ft_unscaled_font_set_scale (cairo
FT_Set_Transform(unscaled->face, &mat, NULL);
if ((unscaled->face->face_flags & FT_FACE_FLAG_SCALABLE) != 0) {
- pixel_width = sf.x_scale;
- pixel_height = sf.y_scale;
error = FT_Set_Char_Size (unscaled->face,
sf.x_scale * 64.0,
sf.y_scale * 64.0,
0, 0);
+ assert (error == 0);
} else {
double min_distance = DBL_MAX;
int i;
int best_i = 0;
- pixel_width = pixel_height = 0;
-
for (i = 0; i < unscaled->face->num_fixed_sizes; i++) {
#if HAVE_FT_BITMAP_SIZE_Y_PPEM
double size = unscaled->face->available_sizes[i].y_ppem / 64.;
@@ -678,9 +674,8 @@ _cairo_ft_unscaled_font_set_scale (cairo
error = FT_Set_Pixel_Sizes (unscaled->face,
unscaled->face->available_sizes[best_i].width,
unscaled->face->available_sizes[best_i].height);
+ assert (error == 0);
}
-
- assert (error == 0);
}
/* Empirically-derived subpixel filtering values thanks to Keith
diff-tree 4d7b341a7eb9d0f8ddd9f025867dcea7178c1a56 (from eb388ca4cbd508cf329b96c5be58d7695832ba9f)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Aug 31 14:21:51 2006 -0400
[test] Use FcFreeTypeQuery
(cherry picked from 7ad6e941017e070bf7d93afba4de5c49cd1ff533 commit)
diff --git a/test/bitmap-font.c b/test/bitmap-font.c
index ef9bbb6..7e3c79e 100644
--- a/test/bitmap-font.c
+++ b/test/bitmap-font.c
@@ -31,6 +31,7 @@
#include <cairo-ft.h>
#include <fontconfig/fontconfig.h>
+#include <fontconfig/fcfreetype.h>
#define FONT "6x13.pcf"
#define TEXT_SIZE 13
@@ -52,6 +53,7 @@ draw (cairo_t *cr, int width, int height
cairo_status_t status;
const char *srcdir = getenv ("srcdir");
char *filename;
+ int *face_count;
struct stat stat_buf;
if (! srcdir)
@@ -64,15 +66,13 @@ draw (cairo_t *cr, int width, int height
return CAIRO_TEST_FAILURE;
}
- pattern = FcPatternCreate ();
+ pattern = FcFreeTypeQuery (filename, 0, NULL, &face_count);
+ free (filename);
if (! pattern) {
- cairo_test_log ("FcPatternCreate failed.\n");
+ cairo_test_log ("FcFreeTypeQuery failed.\n");
return CAIRO_TEST_FAILURE;
}
- FcPatternAddString (pattern, FC_FILE, (unsigned char *) filename);
- free (filename);
- FcPatternAddInteger (pattern, FC_INDEX, 0);
font_face = cairo_ft_font_face_create_for_pattern (pattern);
status = cairo_font_face_status (font_face);
diff-tree eb388ca4cbd508cf329b96c5be58d7695832ba9f (from 1ae5dc7e78bbd926378d9d47714f885b60d7ca63)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Aug 31 13:18:37 2006 -0400
[test] Use $(srcdir) to find valgrind supressions
(cherry picked from 851dd63719d51f9b839784ba2761a1e2b2ecfbe5 commit)
diff --git a/test/Makefile.am b/test/Makefile.am
index 5bbcf9e..651a209 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -446,7 +446,7 @@ TARGETS = $(CAIRO_TEST_TARGET)
TESTS_ENVIRONMENT = CAIRO_XFAIL_TESTS="$(XFAIL_TESTS)" CAIRO_TEST_TARGET="$(TARGETS)"
VALGRIND_FLAGS = \
- --tool=memcheck --suppressions=./.valgrind-suppressions \
+ --tool=memcheck --suppressions=$(srcdir)/.valgrind-suppressions \
--leak-check=yes --show-reachable=yes
CLEANFILES = \
diff-tree 1ae5dc7e78bbd926378d9d47714f885b60d7ca63 (from c55f71bdab977010cab1366f2ee2258999d8b7d5)
Author: Carl Worth <cworth at cworth.org>
Date: Thu Aug 31 08:35:39 2006 -0700
Require librsvg >= 2.14.0 to test SVG backend
(cherry picked from 8d834c3a34a17de0e03841501ea107dee7b373d0 commit)
diff --git a/configure.in b/configure.in
index 94328ae..a5ec54b 100644
--- a/configure.in
+++ b/configure.in
@@ -485,13 +485,14 @@ CAIRO_BACKEND_ENABLE(pdf, PDF, pdf, PDF_
pdf_NONPKGCONFIG_LIBS=-lz
])
+POPPLER_VERSION_REQUIRED=0.4.1
test_pdf=no
if test "x$use_pdf" = "xyes"; then
- PKG_CHECK_MODULES(POPPLER, poppler-glib >= 0.4.1 pango gtk+-2.0, [test_pdf=yes], [test_pdf=no])
+ PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_VERSION_REQUIRED pango gtk+-2.0, [test_pdf=yes], [test_pdf=no])
if test "x$test_pdf" = "xyes"; then
AC_DEFINE([CAIRO_CAN_TEST_PDF_SURFACE], 1, [Define to 1 if the PDF backend can be tested (need poppler and other dependencies for pdf2png)])
else
- AC_MSG_WARN([PDF backend will not be tested since poppler is not available])
+ AC_MSG_WARN([PDF backend will not be tested since poppler >= $POPPLER_VERSION_REQUIRED is not available])
fi
fi
@@ -509,12 +510,13 @@ CAIRO_BACKEND_ENABLE(svg, SVG, svg, SVG_
fi
])
+LIBRSVG_VERSION_REQUIRED=2.14.0
if test "x$use_svg" = "xyes"; then
- PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 gdk-2.0, [test_svg=yes], [test_svg=no])
+ PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= $LIBRSVG_VERSION_REQUIRED gdk-2.0, [test_svg=yes], [test_svg=no])
if test "x$test_svg" = "xyes"; then
- AC_DEFINE([CAIRO_CAN_TEST_SVG_SURFACE], 1, [Define to 1 if the SVG backend can be tested (need librsvg)])
+ AC_DEFINE([CAIRO_CAN_TEST_SVG_SURFACE], 1, [Define to 1 if the SVG backend can be tested])
else
- AC_MSG_WARN([SVG backend will not be tested since a librsvg is not available])
+ AC_MSG_WARN([SVG backend will not be tested since librsvg >= $LIBRSVG_VERSION_REQUIRED is not available])
fi
fi
diff-tree c55f71bdab977010cab1366f2ee2258999d8b7d5 (from a08c0b43e2c2fd1a5070911edef448940fcab35a)
Author: Carl Worth <cworth at cworth.org>
Date: Wed Aug 30 15:38:15 2006 -0700
test: Add link to test log file in HTML output
(cherry picked from 5ef4c991f6ad00a37fc0645a38ba2cb9f832d9f1 commit)
diff --git a/test/make-html.pl b/test/make-html.pl
index ce3db54..82d2edf 100755
--- a/test/make-html.pl
+++ b/test/make-html.pl
@@ -210,7 +210,8 @@ foreach my $test (sort(keys %$tests)) {
}
my $testref = testref($test, $format);
- print '<tr><td>', "<a href=\"$testref\">", $test, ' (', $format, '/', $offset, ')</a></td>';
+ print '<tr><td>', "<a href=\"$testref\">", $test, ' (', $format, '/', $offset, ')</a>',
+ "(<a href=\"$test.log\">log</a>)", '</td>';
if ($config_show_ref) {
print "<td><a href=\"$testref\"><img src=\"$testref\"></img></a></td>";
More information about the cairo-commit
mailing list