Commit graph

19 commits

Author SHA1 Message Date
Adrian Johnson
f35f757e8f Update user font tests to test foreground colors 2023-01-26 19:49:06 +10:30
Adrian Johnson
4815949d2f Fix the scaled_glyph_init color glyph logic
and split _cairo_user_scaled_glyph_init() into multiple functions.

Update user-font test to test changing foreground text color.
2022-04-25 17:08:07 +09:30
Michael Haubenwallner
0916d580db test: fix include order for AIX, bug#89354 2015-03-05 17:02:14 -08:00
Jeff Muizelaar
41e46c7754 [test] Don't embed preprocessor directives inside macros
MSVC can't handle this. GCC will warn with -pedantic, but I'm not
sure we want to enable that.
2009-02-10 11:44:20 -05:00
Chris Wilson
e90073f7dd [test] Build test suite into single binary.
Avoid calling libtool to link every single test case, by building just one
binary from all the sources.

This binary is then given the task of choosing tests to run (based on user
selection and individual test requirement), forking each test into its own
process and accumulating the results.
2008-10-31 12:30:11 +00:00
Behdad Esfahbod
d692284ab8 [test/user-font] Exercise glyph 0
Previously there was a bug in cairo and/or poppler causing glyph 0 of
user fonts to not show up.  This is fixed now, so we exercise glyph 0.
2008-10-23 01:45:35 -04:00
Chris Wilson
683de2fea2 [test/user-font[-proxy]] Check for error from set_user_data().
Check in case we fail to attach our user_data.
2008-10-18 09:55:15 +01:00
Chris Wilson
212cbd3f1b [test/user-font] Correct the lifetime of the user font face.
By keeping a static reference to the user font face, it is erroneously kept
alive during a call to cairo_debug_reset_static_data(). (A violation of
the caller's contract to ensure that no active reference to a cairo object
is held by the caller.)
2008-08-18 08:26:43 +01:00
Chris Wilson
436c0c8be2 [test] Preparatory work for running under memfault.
In order to run under memfault, the framework is first extended to handle
running concurrent tests - i.e. multi-threading. (Not that this is a
requirement for memfault, instead it shares a common goal of storing
per-test data).  To that end all the global data is moved into a per-test
context and the targets are adjusted to avoid overlap on shared, global
resources (such as output files and frame buffers). In order to preserve
the simplicity of the standard draw routines, the context is not passed
explicitly as a parameter to the routines, but is instead attached to the
cairo_t via the user_data.

For the masochist, to enable the tests to be run across multiple threads
simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired
number.

In the long run, we can hope the need for memfault (runtime testing of
error paths) will be mitigated by static analysis. A promising candidate
for this task would appear to be http://hal.cs.berkeley.edu/cil/.
2008-08-13 21:54:59 +01:00
Behdad Esfahbod
08e8a42ea1 [test/user-font] Fix comments 2008-08-08 03:01:18 -04:00
Behdad Esfahbod
597bfa922a [test/user-font] Document glyph-not-found situation 2008-08-08 03:01:17 -04:00
Behdad Esfahbod
b01ad0835d [user-font] Add a cairo_t argument to cairo_user_scaled_font_init_func_t
The init func does not actually need to draw anything, but having a cairo_t
similar to that passed to render_glyph is handy for computing font extents.
This is because cairo makes doing some things really hard (if not impossible)
without a cairo_t.

The user-font-proxy test case is a great example of how the added cairo_t
makes life much easier.
2008-08-08 03:01:15 -04:00
Behdad Esfahbod
1dc0f3a1ad [test/user-font] Document that Poppler is buggy with glyph 0 2008-08-06 12:00:28 -04:00
Behdad Esfahbod
51885e9a1e [test/user-font.c] Fix compiler warnings 2008-05-28 16:52:19 -04:00
Behdad Esfahbod
0f07c45fa3 [test/user-font] Use user_data to access glyphs array
This way the same callback code can be used to render multiple different
glyph arrays.  Change done for education purposes, otherwise doesn't
make any difference in the test.
2008-05-27 17:53:35 -04:00
Behdad Esfahbod
168447cc2b [user-font] Use opaque colors such that PS backend gets tested
Also update ref images.  All backends pass now.
2008-05-15 20:09:17 -04:00
Behdad Esfahbod
62652ecab7 [test/user-font] Another minor tweak to the font 2008-05-15 13:28:03 -04:00
Behdad Esfahbod
f68fb2c747 [test/user-font] Add some more glyphs
The glyph for 'z' now reveals a bug in PDF type1 code.
2008-05-13 14:07:42 -04:00
Behdad Esfahbod
17f21ea307 [cairo-user-font] Implement user fonts 2008-05-10 01:21:45 +02:00