Commit graph

7118 commits

Author SHA1 Message Date
Chris Wilson
3bad3efaa2 [test] Add cairo-test-trace to .gitignore 2009-06-19 19:09:03 +01:00
Chris Wilson
62dc0ae46c [cairo] Offset the current path when pushing/popping groups.
We need to translate the path in order to compensate for the device offset
applied to the group surface when pushing and popping. (The path is
transformed to device space on creation, and so needs recomputing for the
new device.)
2009-06-19 19:08:34 +01:00
Chris Wilson
851c883962 [test] Add group-clip
Larry Ewing found an ancient and nasty bug whereby a path was not
corrected whilst pushing and popping groups.
2009-06-19 19:08:29 +01:00
Chris Wilson
0a34abace7 [test] Experiment with reference targets
Specify another boilerplate target to use as the reference for this
target. We then use this in cairo-test-trace in preference to using the
image surface. Still not perfect, though the framework is improving.
2009-06-19 19:06:17 +01:00
Chris Wilson
cec8579348 [xlib] Remove redundant code to query a xrender_format from a visual
We always query an xrender_format for a Visual upon surface creation, so
checking again in create_similar() is redundant. (It also interferes with
disabling XRender...)
2009-06-19 19:06:17 +01:00
Chris Wilson
dd842a2bed [boilerplate] Missing static on pdf user data key. 2009-06-19 19:06:17 +01:00
M Joonas Pihlaja
2da906f476 [script] Include unistd.h if we're twiddling file descriptors.
Including sys/mman.h doesn't pull in unistd.h on Solaris 9 so
we have to include it explicitly.
2009-06-19 19:01:15 +03:00
M Joonas Pihlaja
1b6dbcbbeb [trace] Compile without fontconfig.
Use CAIRO_HAS_FC_FONT to decide whether to export
cairo_ft_font_face_create_for_pattern() or not.
2009-06-19 19:01:14 +03:00
M Joonas Pihlaja
d9b5a98a78 [build] Require fontconfig >= 2.2.95 if we're using it at all.
We require at least fontconfig 2.2.95 when we're using
fontconfig because we depend on the FcResultOutOfMemory
error code introduced in that version.
2009-06-19 19:01:14 +03:00
Chris Wilson
84e587bbfa [trace] Prevent a child process from writing to the same file
After opening a specific file or fd for ourselves, reset the
CAIRO_TRACE_FD to point to an invalid fd in order to prevent any child
processes (who inherit our environment) from attempting to trace cairo
calls. If we allow them to continue, then the two traces will intermix
and be unreplayable.
2009-06-19 14:41:39 +01:00
Chris Wilson
18edea36ba [perf] Report line of error during trace
Query the number of new lines processed so far and report that on hitting
an error.
2009-06-19 14:14:32 +01:00
Chris Wilson
55721d380d [script] Report line number
Count the number of newlines processed in the trace and provide an API for
the user to query.
2009-06-19 14:13:34 +01:00
Chris Wilson
030ef4ca00 [trace] Change the threshold at which pixel data is immediately copied
Embed the pixels for images less than 32*32 as this catches most icons
which are frequently uploaded, but is still an unlikely size for a
destination image surface.
2009-06-19 11:56:14 +01:00
Chris Wilson
d3330d7beb [ft] Substitute twin if there are no fonts
Fixes bug 22356 -- Spurious "out of memory" error on system without fonts
https://bugs.freedesktop.org/show_bug.cgi?id=22356

If FcFontMatch() fails, then it means that there are no fonts available on
the system (or it may have been a malloc error, we have no way of telling).
Instead of report NO_MEMORY and disabling all drawing, one of the
rationales for including a builtin font was so that we could continue even
in the face of this error and show *something* to the user. (This being a
last resort (and especially important for demos!) and hopefully easier to
diagnose than no output at all.)
2009-06-19 11:20:48 +01:00
M Joonas Pihlaja
6d8b353658 [spans] Squash a compiler warning when creating error objects.
Handle the new CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED status code
in the switch/case of the ..._create_in_error() functions for
creating span renderers or scan converters.
2009-06-19 02:45:39 +03:00
M Joonas Pihlaja
7651227d3d Revert "[test] Make the xlib-fallback use the image refs."
This reverts commit 903b39c304.

The xlib-fallback actually renders mostly via traps at the moment,
so staying with xlib refs is the right thing to do.
2009-06-19 02:45:39 +03:00
M Joonas Pihlaja
729457b174 [test] Add trap rendered ref images for fill-image.
The fill code path for the xlib and fallback surfaces use trapezoids
rather than spans, so there's lots of differences due to antialising
differences at the edge of the fill.  This patch adds a ref image
for the xlib and test-fallback surfaces.
2009-06-19 02:45:39 +03:00
M Joonas Pihlaja
8e7f667abb [test] Mark scale-offset tests as XFAIL for image, xlib-fallback.
The scale-offset tests trigger a loss-of-precision bug when
converting double matrices from cairo to pixman format.

http://lists.cairographics.org/archives/cairo/2008-November/015671.html
2009-06-19 02:45:38 +03:00
Chris Wilson
c12533b135 [pattern] Add _cairo_pattern_fini_snapshot
Symmetric operation to _cairo_pattern_init_snapshot() this exists simply
to break the circular reference between the meta-surface and snapshot-cow.
2009-06-19 00:29:00 +01:00
Chris Wilson
2213c44737 [svg] Break circular snapshot reference by explicit finish
The svg backend snapshots the meta surface which because of snapshot-cow
creates a circular reference back to the creator. So in order to break the
circular reference when we have finished with the snapshot, we need to
call cairo_surface_finish() in addition to simply destroying the surface.
2009-06-19 00:29:00 +01:00
Chris Wilson
cd9eef1aad [scaled-font] Check the MRU font before resolving the implementor
This should hide most of the overhead of resolving a frequently used toy font.
2009-06-19 00:29:00 +01:00
Chris Wilson
5ad64dfda2 [test] Add the sha1sum of the required fonts
(Note, I think these are currently out-of-date... But it will serve as a
useful reminder to verify and update them in future.)
2009-06-19 00:28:59 +01:00
Chris Wilson
3063f0f44c [scaled-font-subset] Check for matching font-face implementors
Catch toy and user fonts which may have different font-faces for their
implementation than the original ones they were created with.
2009-06-19 00:28:59 +01:00
Chris Wilson
6e78c94615 [test] Move calls to the getters from out of the innermost loops.
Tidy the code slightly by removing excess and unsightly calls to
cairo_test_get_context() and cairo_get_scaled_font().
2009-06-19 00:28:58 +01:00
Chris Wilson
3da32e35af [analysis] Restore nops for the analysis null surface
Joonas reported that adding the extra routines to the null-surface as used
by the analysis surface broke user-fonts. So create a separate null
backend to be exported via the test-null surface.
2009-06-19 00:28:58 +01:00
Chris Wilson
c0e01d9cd7 [xlib] Improve GC caching efficacy
Shrink the overall size of the per-screen GC cache, but allow multiple GCs
per depth, as it quite common to need up to two temporary GCs along some
drawing paths. Decrease the number of GCs we obtain in total by returning
clean (i.e. a GC without a clip set) back to the screen pool after use.
Compensate for the increased number of put/get by performing the query
using atomic operations where available. So overall we see a dramatic
reduction on the numbers of XCreateGC and XFreeGC, of even greater benefit
for RENDER-less servers.
2009-06-19 00:28:57 +01:00
Jeff Muizelaar
7f238f5424 Use the scanline rasterizer in the win32 backend.
Brings http://people.mozilla.com/~jmuizelaar/world-map.html from 8fps to 13fps
in Vista on a Mac Mini
2009-06-18 17:13:13 -04:00
Jeff Muizelaar
d066154e62 Factor out _cairo_image_surface_span_render_row()
This allows other backends use the same function for rendering rows.
More specifically, I intend to use this with the win32-backend.
2009-06-18 19:29:12 +03:00
M Joonas Pihlaja
fd142d0a6e [shave] Robuster usage of the test shell built-in.
Solaris 9 confuses shave, resulting in an empty variable.
This patch papers over the resulting build failure from
the test shell built-in being called with an empty argument
which was unquoted.
2009-06-18 16:14:50 +01:00
M Joonas Pihlaja
9ecee571c1 [test/build] Don't test Freetype font stuff without Fontconfig.
Most Freetype hitting tests require Fontconfig to find
them some fonts.
2009-06-18 16:09:31 +01:00
M Joonas Pihlaja
742b1ad4b0 [test] Fix checking of the fenv.h include.
This adds a configure check for fenv.h and makes
invalid-matrix.c check for it with HAVE_FENV_H instead
of HAVE_FEDISABLEEXCEPT -- turns out Solaris doesn't
have fedisableexcept(), but it does have feclearexcept().

The same issue appears on OSX and was fixed in
ab86662ab4. This patch
adds some configure magic.
2009-06-18 16:07:56 +01:00
M Joonas Pihlaja
75f1d11d93 [test] Fallback to HUGE_VAL in place of INFINITY in invalid-matrix.c.
GCC 3.4.3 on OpenSolaris does not recognise INFINITY.  Use HUGE_VAL
instead for every compiler instead of just MSVC.
2009-06-18 16:07:56 +01:00
M Joonas Pihlaja
d1994d1ac2 [test/any2ppm] Daemonize without BSD's daemon().
Solaris libc doesn't provide daemon() so implement
any2ppm daemon's detaching without it.
2009-06-18 16:07:38 +01:00
M Joonas Pihlaja
aafff0b952 [boilerplate] Check for connect() in libsocket.
Solaris requires -lsocket to be able to talk to
the any2ppm daemon over unix domain sockets.
2009-06-18 15:48:59 +01:00
M Joonas Pihlaja
c4c0693169 [test] Make test constructors without perl.
Remove the dependency on perl when building the test suite
by replacing the script which makes cairo-test-constructors.c
with a C program.
2009-06-18 15:41:19 +01:00
M Joonas Pihlaja
cdd27a8d4c [test] Never use gcc __attribute__ magic for constructors.
The configure test for __attribute__((constructor)) succeeds when
compiling with Sun Studio 12 on OpenSolaris but the attribute
is just ignored and has no actual effect.  This causes the test
suite to not run any tests at all.  With this patch we revert to
always using make-cairo-test-constructors.pl.
2009-06-18 15:39:16 +01:00
M Joonas Pihlaja
46eb56a99f [cairo-surface] Handle the all clipped out case for regions.
Explicitly handle a region clip which represents that the
entire surface is clipped out by passing in a temporary
empty region to the backend set_clip_region() method.
Previously the passed in region may have been NULL even
when clip->all_clipped = TRUE.

Fixes a bug tickled by the clip-all test case which was
brought to light by 394e139213.
2009-06-18 16:42:53 +03:00
Chris Wilson
002264d572 [clip] Missing {} (coding style)
Carl spotted that I'd slipped in a little CODING_STYLE violation.
2009-06-17 17:15:26 +01:00
Nis Martensen
bc87074185 [path] Fix missing implicit move-to
When cairo_curve_to happens to start a new subpath (e.g., after a call
to cairo_new_sub_path()), it also needs to update the last_move_point.
Otherwise the new current point after a close_path() will be at an
unexpected position.

Therefore, call _cairo_path_fixed_move_to() explicitly.
2009-06-17 16:39:56 +01:00
Nis Martensen
3c5e57e694 [test] Verify current point position after subpath closure
Make sure cairo_close_path always takes the current point where it
should be.
2009-06-17 16:39:00 +01:00
Chris Wilson
394e139213 [clip] During _clip() limit the extracted traps to the current clip extents
By applying a tight _cairo_traps_limit() we can reduce the amount of work
we need to do when tessellating the path and extracting the trapezoids.
2009-06-17 16:20:07 +01:00
Chris Wilson
650b85ec77 [clip] Avoid copying region within _cairo_clip_intersect_region()
Within _cairo_clip_intersect_region() we can simply assign the freshly
extracted traps-region if we previously had no region set.
2009-06-17 14:19:19 +01:00
Chris Wilson
4bc89e224f [NEWS] Add release notes from 1.8.8 2009-06-16 15:13:46 +01:00
Chris Wilson
116c93cb7f [cairo] Remove instance of 'return free()'
Gah! This is a GCC-ism, so therefore it has to go.
2009-06-16 11:36:36 +01:00
Vladimir Vukicevic
22587f57bd Import Qt backend by Mozilla
Written by Vladimir Vukicevic to enable integration with Qt embedded
devices, this backend allows cairo code to target QPainter, and use
it as a source for other cairo backends.

This imports the sources from mozilla-central:
http://mxr.mozilla.org/mozilla-central/find?text=&kind=text&string=cairo-qpainter
renames them from cairo-qpainter to cairo-qt, and integrates the patch
by Oleg Romashin:
https://bugs.freedesktop.org/attachment.cgi?id=18953

And then attempts to restore 'make check' to full functionality.

However:
 - C++ does not play well with the PLT symbol hiding, and leaks into the
   global namespace. 'make check' fails at check-plt.sh

 - Qt embeds a GUI into QApplication which it requires to construct any
   QPainter drawable, i.e. used by the boilerplate to create a cairo-qt
   surface, and this leaks fonts (cairo-ft-fonts no less) causing assertion
   failures that all cairo objects are accounted for upon destruction.

[Updated by Chris Wilson]
Acked-by: Jeff Muizelaar <jeff@infidigm.net>
Acked-by: Carl Worth <cworth@cworth.org>
2009-06-16 11:03:46 +01:00
Chris Wilson
7d3881114a [perf] Report errors during replays 2009-06-16 11:03:45 +01:00
Chris Wilson
061e0477e9 [perf] Report iteration count
Show number of discard results by showing the number of statistically
valid samples out of total population count.
2009-06-16 11:03:41 +01:00
Chris Wilson
bab8af62e7 [region] Add PLT entry for cairo_region_create_rectangles() 2009-06-15 15:04:13 +01:00
Chris Wilson
6da9c410d4 Missing header file for cairo-test-null-surface. 2009-06-15 12:14:51 +01:00
Chris Wilson
e5727e20f5 Expose _cairo_null_surface_create() via a test surface
Using a null surface is a convenient method to measure the overhead of the
performance testing framework, so export it although as a test-surface so
that it will only be available in development builds and not pollute
distributed libraries.
2009-06-15 12:03:37 +01:00