Author: spouliot
Date: 2006-05-15 10:29:16 -0400 (Mon, 15 May 2006)
New Revision: 60707
Modified:
trunk/libgdiplus/cairo/test/caps-joins.c
trunk/libgdiplus/cairo/test/clip-all.c
trunk/libgdiplus/cairo/test/dash-caps-joins.c
trunk/libgdiplus/cairo/test/pthread-show-text.c
trunk/libgdiplus/cairo/test/show-glyphs-many.c
Log:
some test's source code got doubled (probably during last cairo update) and
b0rk3d make check
Modified: trunk/libgdiplus/cairo/test/caps-joins.c
===================================================================
--- trunk/libgdiplus/cairo/test/caps-joins.c 2006-05-15 13:35:37 UTC (rev
60706)
+++ trunk/libgdiplus/cairo/test/caps-joins.c 2006-05-15 14:29:16 UTC (rev
60707)
@@ -83,88 +83,3 @@
{
return cairo_test (&test, draw);
}
-/*
- * 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 <[EMAIL PROTECTED]>
- */
-
-#include "cairo-test.h"
-
-#define LINE_WIDTH 10.
-#define SIZE (5 * LINE_WIDTH)
-#define PAD (2 * LINE_WIDTH)
-
-cairo_test_t test = {
- "caps-joins",
- "Test caps and joins",
- 3 * (PAD + SIZE) + PAD,
- PAD + SIZE + PAD
-};
-
-static void
-make_path (cairo_t *cr)
-{
- cairo_move_to (cr, 0., 0.);
- cairo_rel_line_to (cr, 0., SIZE);
- cairo_rel_line_to (cr, SIZE, 0.);
- cairo_close_path (cr);
-
- cairo_move_to (cr, 2 * LINE_WIDTH, 0.);
- cairo_rel_line_to (cr, 3 * LINE_WIDTH, 0.);
- cairo_rel_line_to (cr, 0., 3 * LINE_WIDTH);
-}
-
-static cairo_test_status_t
-draw (cairo_t *cr, int width, int height)
-{
- cairo_set_line_width (cr, LINE_WIDTH);
-
- cairo_translate (cr, PAD, PAD);
-
- make_path (cr);
- cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_BEVEL);
- cairo_stroke (cr);
-
- cairo_translate (cr, SIZE + PAD, 0.);
-
- make_path (cr);
- cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
- cairo_stroke (cr);
-
- cairo_translate (cr, SIZE + PAD, 0.);
-
- make_path (cr);
- cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
- cairo_stroke (cr);
-
- return CAIRO_TEST_SUCCESS;
-}
-
-int
-main (void)
-{
- return cairo_test (&test, draw);
-}
Modified: trunk/libgdiplus/cairo/test/clip-all.c
===================================================================
--- trunk/libgdiplus/cairo/test/clip-all.c 2006-05-15 13:35:37 UTC (rev
60706)
+++ trunk/libgdiplus/cairo/test/clip-all.c 2006-05-15 14:29:16 UTC (rev
60707)
@@ -67,72 +67,3 @@
{
return cairo_test (&test, draw);
}
-/*
- * Copyright © 2005 Novell, 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
- * Novell, Inc. not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Novell, Inc. makes no representations about the
- * suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL NOVELL, 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: Radek Doulík <[EMAIL PROTECTED]>
- */
-
-#include "cairo-test.h"
-
-#define SIZE 10
-#define CLIP_SIZE 2
-
-cairo_test_t test = {
- "clip-all",
- "Test clipping with everything clipped out",
- SIZE, SIZE
-};
-
-static cairo_test_status_t
-draw (cairo_t *cr, int width, int height)
-{
- cairo_rectangle (cr, 0, 0, SIZE, SIZE);
- cairo_set_source_rgb (cr, 0, 0, 1);
- cairo_fill (cr);
-
- cairo_reset_clip (cr);
- cairo_rectangle (cr, CLIP_SIZE, CLIP_SIZE, CLIP_SIZE, CLIP_SIZE);
- cairo_clip (cr);
- cairo_rectangle (cr, 3*CLIP_SIZE, 3*CLIP_SIZE, CLIP_SIZE, CLIP_SIZE);
- cairo_clip (cr);
-
- cairo_translate (cr, .5, .5);
-
- cairo_reset_clip (cr);
- cairo_rectangle (cr, CLIP_SIZE, CLIP_SIZE, CLIP_SIZE, CLIP_SIZE);
- cairo_clip (cr);
- cairo_rectangle (cr, 3*CLIP_SIZE, 3*CLIP_SIZE, CLIP_SIZE, CLIP_SIZE);
- cairo_clip (cr);
-
- cairo_rectangle (cr, 0, 0, SIZE, SIZE);
- cairo_set_source_rgb (cr, 1, 1, 0);
- cairo_fill (cr);
-
- return CAIRO_TEST_SUCCESS;
-}
-
-int
-main (void)
-{
- return cairo_test (&test, draw);
-}
Modified: trunk/libgdiplus/cairo/test/dash-caps-joins.c
===================================================================
--- trunk/libgdiplus/cairo/test/dash-caps-joins.c 2006-05-15 13:35:37 UTC
(rev 60706)
+++ trunk/libgdiplus/cairo/test/dash-caps-joins.c 2006-05-15 14:29:16 UTC
(rev 60707)
@@ -92,97 +92,3 @@
{
return cairo_test (&test, draw);
}
-/*
- * 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 <[EMAIL PROTECTED]>
- */
-
-/* Test case for bug #4409:
- *
- * Dashes are missing initial caps
- * https://bugs.freedesktop.org/show_bug.cgi?id=4409
- */
-
-#include "cairo-test.h"
-
-#define LINE_WIDTH 10.
-#define SIZE (5 * LINE_WIDTH)
-#define PAD (2 * LINE_WIDTH)
-
-cairo_test_t test = {
- "dash-caps-joins",
- "Test caps and joins when dashing",
- 3 * (PAD + SIZE) + PAD,
- PAD + SIZE + PAD
-};
-
-static void
-make_path (cairo_t *cr)
-{
- cairo_move_to (cr, 0., 0.);
- cairo_rel_line_to (cr, 0., SIZE);
- cairo_rel_line_to (cr, SIZE, 0.);
- cairo_close_path (cr);
-
- cairo_move_to (cr, 2 * LINE_WIDTH, 0.);
- cairo_rel_line_to (cr, 3 * LINE_WIDTH, 0.);
- cairo_rel_line_to (cr, 0., 3 * LINE_WIDTH);
-}
-
-static cairo_test_status_t
-draw (cairo_t *cr, int width, int height)
-{
- double dash[] = {LINE_WIDTH, 1.5 * LINE_WIDTH};
-
- cairo_set_line_width (cr, LINE_WIDTH);
- cairo_set_dash (cr, dash, sizeof(dash)/sizeof(dash[0]), - 2 * LINE_WIDTH);
-
- cairo_translate (cr, PAD, PAD);
-
- make_path (cr);
- cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_BEVEL);
- cairo_stroke (cr);
-
- cairo_translate (cr, SIZE + PAD, 0.);
-
- make_path (cr);
- cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
- cairo_stroke (cr);
-
- cairo_translate (cr, SIZE + PAD, 0.);
-
- make_path (cr);
- cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
- cairo_stroke (cr);
-
- return CAIRO_TEST_SUCCESS;
-}
-
-int
-main (void)
-{
- return cairo_test (&test, draw);
-}
Modified: trunk/libgdiplus/cairo/test/pthread-show-text.c
===================================================================
--- trunk/libgdiplus/cairo/test/pthread-show-text.c 2006-05-15 13:35:37 UTC
(rev 60706)
+++ trunk/libgdiplus/cairo/test/pthread-show-text.c 2006-05-15 14:29:16 UTC
(rev 60707)
@@ -108,113 +108,3 @@
return CAIRO_TEST_SUCCESS;
}
-/*
- * 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 <[EMAIL PROTECTED]>
- */
-
-/* Test case for bug #4299:
-
- Assertion fails in "cairo-font.c" when using multithreads
- https://bugs.freedesktop.org/show_bug.cgi?id=4299
-*/
-
-#include "cairo-test.h"
-#include "xmalloc.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <pthread.h>
-#if HAVE_FCFINI
-#include <fontconfig/fontconfig.h>
-#endif
-
-static void *
-start (void *closure)
-{
- cairo_surface_t *surface;
- cairo_t *cr;
- int i;
-
- surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
- cr = cairo_create (surface);
-
- cairo_save (cr);
- {
- cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
- cairo_paint (cr);
- }
- cairo_restore (cr);
-
- cairo_move_to (cr, 1, 1);
-
- for (i=0; i < 10; i++) {
- cairo_set_font_size (cr, 8 + i);
- cairo_show_text (cr, "Hello world.\n");
- }
-
- cairo_destroy (cr);
- cairo_surface_destroy (surface);
-
- return NULL;
-}
-
-int
-main (int argc, char *argv[0])
-{
- int err;
- int i, num_threads;
- pthread_t *pthread;
-
- if (argc > 1) {
- num_threads = atoi (argv[1]);
- } else {
- num_threads = 20;
- }
-
- cairo_test_init ("pthread-show-text");
-
- cairo_test_log ("Running with %d threads.\n", num_threads);
-
- pthread = xmalloc (num_threads * sizeof (pthread_t));
-
- for (i = 0; i < num_threads; i++) {
- err = pthread_create (&pthread[i], NULL, start, NULL);
- if (err) {
- cairo_test_log ("pthread_create failed: %s\n", strerror(err));
- return CAIRO_TEST_FAILURE;
- }
- }
-
- for (i = 0; i < num_threads; i++)
- pthread_join (pthread[i], NULL);
-
- free (pthread);
-
- cairo_debug_reset_static_data ();
-#if HAVE_FCFINI
- FcFini ();
-#endif
-
- return CAIRO_TEST_SUCCESS;
-}
Modified: trunk/libgdiplus/cairo/test/show-glyphs-many.c
===================================================================
--- trunk/libgdiplus/cairo/test/show-glyphs-many.c 2006-05-15 13:35:37 UTC
(rev 60706)
+++ trunk/libgdiplus/cairo/test/show-glyphs-many.c 2006-05-15 14:29:16 UTC
(rev 60707)
@@ -125,130 +125,3 @@
{
return cairo_test (&test, draw);
}
-/*
- * 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
- * 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 <[EMAIL PROTECTED]>
- */
-
-#include "cairo-test.h"
-
-#include <string.h>
-
-/* Bug history
- *
- * 2006-01-07 Jon Hellan <[EMAIL PROTECTED]>
- *
- * Jon opened the following bug report:
- *
- * _XError from XRenderCompositeText8
- * https://bugs.freedesktop.org/show_bug.cgi?id=5528
- *
- * 2006-03-02 Carl Worth <[EMAIL PROTECTED]>
- *
- * I wrote this test case to demonstrate the bug.
- *
- * Approach:
- *
- * Draw 65535 glyphs white-on-white all on top of each other.
- *
- * Rationale:
- *
- * The number 65535 comes from the original bug report.
- *
- * I would use cairo_show_text with a long string of 'x's say,
- * but then the surface would need to be enormous to contain
- * them. A smaller surface could be used, but I fear that at some
- * point the off-surface glyph drawing would be optimized away
- * and not exercise the bug.
- *
- * So, to keep the surface size under control, I use
- * cairo_show_glyphs which allows me to place the glyphs all on
- * top of each other. But, since cairo doesn't provide any
- * character-to-glyphs mapping, I can't get a reliable glyph
- * index (for character 'x' for example). So I just "guess" a
- * glyph index and use white-on-white drawing to ignore the
- * result. (I don't care what's drawn---I just want to ensure
- * that things don't crash.)
- *
- * Status: I replicated bug. The largest value of NUM_GLYPHS for
- * which I saw success is 21842.
- */
-
-#define TEXT_SIZE 12
-#define NUM_GLYPHS 65535
-
-/* This is the index into the font for what glyph we'll draw. Since we
- * don't guarantee we'll get any particular font, we can't relibably
- * get any particular glyph. But we don't care what we draw anyway,
- * (see discussion of white-on-white drawing above). For what it's
- * worth, this appears to be giving me 'M' with Bitstream Vera
- * Sans Mono. */
-#define GLYPH_INDEX 48
-
-cairo_test_t test = {
- "show-glyphs-many",
- "Test that cairo_show_glyps works when handed 'many' glyphs",
- 9, 11
-};
-
-static cairo_test_status_t
-draw (cairo_t *cr, int width, int height)
-{
- cairo_glyph_t glyphs[NUM_GLYPHS];
- cairo_font_options_t *font_options;
- int i;
-
- /* Initialize our giant array of glyphs. */
- for (i=0; i < NUM_GLYPHS; i++) {
- glyphs[i].index = GLYPH_INDEX;
- glyphs[i].x = 1.0;
- glyphs[i].y = height - 1;
- }
-
- /* Paint white background. */
- cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
- cairo_paint (cr);
-
- cairo_select_font_face (cr, "Bitstream Vera Sans Mono",
- CAIRO_FONT_SLANT_NORMAL,
- CAIRO_FONT_WEIGHT_NORMAL);
- cairo_set_font_size (cr, TEXT_SIZE);
-
- font_options = cairo_font_options_create ();
-
- cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
- cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
- cairo_set_font_options (cr, font_options);
- cairo_font_options_destroy (font_options);
-
- cairo_show_glyphs (cr, glyphs, NUM_GLYPHS);
-
- return CAIRO_TEST_SUCCESS;
-}
-
-int
-main (void)
-{
- return cairo_test (&test, draw);
-}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches