Commit graph

14 commits

Author SHA1 Message Date
Uli Schlachter
9208df1630 test: Add text-antialias-subpixel-{,v}{bgr,rgb}
There were no tests for any subpixel order but rgb, so let's write something for
all four possibilities.

This is mostly copy&paste from test/text-antialias.c (and
text-antialias-subpixel-rgb does the same thing as text-antialias-subpixel).

Test for: https://bugs.freedesktop.org/show_bug.cgi?id=40456

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-13 13:40:20 +02:00
Andrea Canciani
ffdfdf2fa9 test: Merge text-antialias-*
The test-antialias-* tests perform the same operation with just a
different antialias flag. Sharing the code ensures that they are kept
in sync and permits adding new flags combinations easily.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=14268
2011-06-25 10:32:45 +02:00
Andrea Canciani
3cb882d01b test: make test font family a define
In order to make it easier to change the test font family, add it
as a define in the global header and always reference the macro in
the tests.
2010-06-12 16:30:56 +02: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
Carl Worth
1b42bc8033 Make the lcd_filter API private
During the cairo summit it was decided that this API is to freetype-
specific to be in the general cairo interface for now. This will
likely come back again soon as a cairo_ft-specific interface.
2008-09-18 07:56:43 -07: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
Sylvain Pasche
65d017a406 Add tests for the new LCD filter API 2008-08-05 16:30:37 -04:00
Behdad Esfahbod
2fa709d6af Set font options in the test context and make tests not do that
This should help with not requiring many backend-specific reference
images, and some should be removed now.
2006-07-31 15:17:15 -04:00
Behdad Esfahbod
cf1b23a4c5 Add prototype for draw in each test file and remove it from the header. 2006-07-13 12:58:24 -04:00
Behdad Esfahbod
973d3a3d14 More test suite infrastructure improvements:
- Remove cairo_test_expect_failure.  cairo-test.c now checks
  env var CAIRO_XFAIL_TESTS to see if the running test is
  expected to fail.  The reason for expected failure is
  appended to the test description.
- Test description is written out.
- Failed/crashed tests also write a line out to stderr (in red),
  so one can now redirect stdout to /dev/null to only see failures.
- cairo_test() has been changed to not take the draw function
  anymore, instead, draw function is now part of the test struct.
- "make check" doesn't allow limiting backends to test using env
  var anymore.  To limit backends to test, one should use the
  TARGETS variable on the make command line.
- "make check-valgrind" now writes its log to valgrind-log instead
  of valgrind.log, to not interfere with test log file processing.
2006-07-11 22:19:39 -04:00
Keith Packard
b0c58593b3 Split out scaled font code to cairo-scaled-font.c
Replace cairo cache implementation (this code from cworth)
No more global glyph cache to clean up
Store glyphs in new per-scaled font caches which hold user-space metrics and device space bounding boxes
Refactor glyph drawing APIs so that the surface API is invoked directly from the gstate code.
Add path creation/destruction routines (to hold glyph paths)
New implementation of scaled fonts which uses per-scaled_font caches for glyphs and keeps user-space metrics, device-space bboxes along with glyph images and/or glyph paths.
Adapt to new scaled font API changes.
New cache and scaled_font APIs
Repond to bug fix in metrics computation for glyphs where y values were rounded up instead of down because of a sign difference between cairo and FreeType.
Reviewed by: otaylor, cworth
2005-08-31 15:08:02 +00:00
Owen Taylor
f229b1abfb when creating the temporary mask, do glyph ADD mask, not (glyph IN source) ADD mask. Set the mask as having component alpha when it's 4-channel.
test/text-antialias-subpixel.c test/Makefile.am: No longer XFAIL.
test/text-antialias-gray.c test/text-antialias-subpixel.c
Don't turn off metrics hinting, it doesn't make sense.
Update.
2005-08-23 13:34:14 +00:00
Carl Worth
9aa1f4d868 Clear to opaque white at the beginning of the test so that the 0 alpha values in the destination don't cause bizarre results. (main): Note that only the image backend should fail now.
Add new reference image.
2005-08-23 10:39:27 +00:00
Carl Worth
255913de9e Note that the XFAIL tests all need to be fixed before 1.0.
Add three new tests for testing the various antialiasing options for text rendering.
2005-07-27 13:28:15 +00:00