Commit graph

314 commits

Author SHA1 Message Date
Chris Wilson
f851009ec7 [trace] Compile without lookup-symbol
And check compilation with --disable-symbol-lookup
2009-09-13 10:57:42 +01:00
Chris Wilson
6cb3ff9c19 [configure] --enable-symbol-lookup
There you go Joonas, I don't always ignore your suggestions! This is
simple patch to allow the user to disable symbol loops in case the
auto-detection fails on some obscure (perhaps OpenBSD) platform. Or in
case the user really wants to trim a few bytes from a library only used
during tracing!
2009-09-13 10:52:14 +01:00
Chris Wilson
f34affaa1e [util] And reuse the same name repository name.
Completely confused by local caching of a broken cairo.modules by the
jhbuild client. ARGH!
2009-09-09 18:03:20 +01:00
Chris Wilson
e1774185d6 [util] And back to a unique repo name for cairo.modules
Gah, further experiments into the unknown and the unclear.
2009-09-09 17:52:10 +01:00
Chris Wilson
2905ebc99e [util] And restore the repository tag.
jbhuild requires a local definition.
2009-09-09 17:24:43 +01:00
Chris Wilson
4d7eb79d25 [util] Inherit the repository from xorg.modules
Experiment with inheriting the repository from xorg.module, in order to
avoid having two entries for the same server.
2009-09-09 17:12:14 +01:00
Chris Wilson
9389cb78a8 [build] Improve handling of missing test apparatus
Improve detection, reporting and disabling of test backends when we lack
the required libraries and utilities.
2009-09-08 17:51:33 +01:00
Chris Wilson
310cebf194 [configure] Add option to disable trace.
Some environments may be broken beyond our capabilities to detect, or
maybe the user is just insane and doesn't want to build my nice shiny
cairo-trace. Whatever, give them the option to choose:

  $ ./configure --disable-trace
2009-09-05 15:21:50 +01:00
Chris Wilson
ff6bc1e132 [script] Always create a fallback font
In order to get a baseline for win32 performance testing, always create a
font so that the trace can be replayed. Not ideal, but I feel this the
pragmatic solution for judging the performance differentials before I can
work out a better solution for loading typ42 fonts.
2009-09-02 21:22:33 +01:00
Chris Wilson
fcbb288e7c [script] Attempt to select a font if ! CAIRO_HAS_FT_FONT
In order to enable replay of traces on machines that do not use FreeType
as the native font system, we need to convert a type42 font into something
similar. Currently the fallback is just to select a font with the same
name - this ignores weight and slant, and many other details.
2009-09-02 21:02:18 +01:00
M Joonas Pihlaja
b509b548b1 [trace] Check for __builtin_return_address explicitly.
Some other compilers such as clang and icc support the
__builtin_return_address() intrinsic as well, so we don't
need to check for __GNUC__ >= 3 only.
2009-09-02 04:50:21 +01:00
M Joonas Pihlaja
2b0e070f6a [trace] Replace an open coded test for matrix identity.
The code has a _matrix_is_identity() function we can use
instead of open coding the same test.
2009-09-02 04:50:21 +01:00
M Joonas Pihlaja
70ea9e3ce1 [trace] Don't crash on unknown enums values.
If the tracer encounters an unknown enum value it
ought not to crash. Theis patch replaces the idiom
of looking up a name for an enumerated value directly
from a table by a switch statement. As a bonus we get
warnings from the compiler when the enums are updated
in cairo.
2009-09-02 04:50:20 +01:00
M Joonas Pihlaja
174c2620c8 [trace] Check for object stack underflow.
If the tracer's object stack underflows we want to
know about is as soon as possible. This patch adds
checks against the stack overflowing and aborts the
program with an object stack dump if it does.
2009-09-02 04:50:20 +01:00
M Joonas Pihlaja
c64f6f8a15 [trace] Get the tracee program name from the environment.
Support non-Linux systems which don't have a /proc/self/cmdline
by transferring the application name given to cairo-trace via
an environment variable CAIRO_TRACE_PROG_NAME.
2009-09-02 04:42:07 +01:00
Chris Wilson
1bcc3a3fa0 [tee] Rename 'append' to 'add' and add symmetric 'remove' 2009-09-01 14:24:06 +01:00
M Joonas Pihlaja
9bb469c51c [trace] Use HAVE_FLOCKFILE/FUNLOCKFILE since configure test for them.
The trace source was using the flockfile() and funlockfile()
functions directly.
2009-08-31 16:06:50 +03:00
Chris Wilson
c60280782d [script] Implement invert
Flesh out matrix inversion.
2009-08-29 17:10:05 +01:00
Damian Frank
17ef949b6a Rename cairo-script static func to avoid MinGW conflict
cairo-script-operators.c's _dup function was colliding with one
defined in io.h by MinGW (gcc 4.3.0 package).  I renamed it
to _duplicate.
2009-08-29 17:10:05 +01:00
Chris Wilson
7447915381 [script] Conditionalise the build
Allow the interpreter to be disabled if we can not satisfy its dependencies.
2009-08-29 17:07:37 +01:00
Chris Wilson
958f7ab123 [script] Support running on cairo-1.8
Pre 1.9 the application had to pass a resolved font to cairo -- so do so
in the interpreter if the cairo version is less than 1.9
2009-08-29 17:07:36 +01:00
Chris Wilson
425b0e35e2 Add xml surface
A very simple surface that produces a hierarchical DAG in a simple XML
format. It is intended to be used whilst debugging, for example with the
automatic regression finding tools of cairo-sphinx, and with test suites
that just want to verify that their code made a particular Cairo call.
2009-08-29 17:07:34 +01:00
Chris Wilson
6e0b3be903 Add cairo-sphinx utility for regression analysis
sphinx is an alternate version of the current cairo-test-trace. It's
purpose is to replay a live application (which may just be a replay of a
trace) against a backend and its reference. The improvement over the
original cairo-test-trace is that the reference backend may be from an
older version of cairo.
2009-08-29 17:07:34 +01:00
Chris Wilson
cd7b27ff5c Add 'flight-data-recorder' utility.
This is a simple variation on cairo-trace that wraps records the last 16
contexts by wrapping the target surface inside a tee surface, along with a
meta/recording surface. Then on receipt of a SIGUSR1, those last 16
contexts are played via a script-surface into /tmp/fdr.trace.

Mostly proof-of-concept, it seems to be causing a number of rendering
glitches whilst testing with firefox -- otherwise, it seems to works.
2009-08-29 08:08:39 +01:00
Chris Wilson
8d1bf830c0 Fix errors found by clang
Shadowed variables, unused writes and some dead code.
2009-08-29 08:08:39 +01:00
Chris Wilson
eba6b5126a [build] Add options for warning about bad casts
-Wbad-function-cast in particular. Triggers quite a few warnings where we
have explicitly cast to an integer.
2009-08-29 08:08:38 +01:00
Chris Wilson
7306305cc8 [script] Emit surface content
Include the desired content with the creation info.
2009-08-29 08:08:37 +01:00
Chris Wilson
fee647c985 [script] Read from a FILE stream
For ease of implementing the interpreter inside a pipeline, add a method
to execute a FILE *.
2009-08-29 08:08:37 +01:00
Chris Wilson
a9d997fecd [script] Introduce cairo_script_context_t
cairo_script_context_t is an encapsulation object for interfacing with the
output - multiple surfaces can share the same context, meaning that they
write to the same destination file/stream.
2009-08-29 08:08:36 +01:00
Chris Wilson
28887ac272 [trace] Fix emission of similar (track operands) 2009-08-29 08:08:36 +01:00
Chris Wilson
50c7d637f3 [trace] Emit an 'index' for an undefined surface
Larry Ewing hit a bug in cairo-trace whereby it tried to create a similar
surface referencing an undefined object. This fix checks whether the
object has yet to be defined, and if not issues an index in order to copy
the appropriate operand from the stack.
2009-08-29 08:08:36 +01:00
Chris Wilson
e2c31183e9 [script] Handle zero-length strings
Not sure where the zero length string is coming from, but we should
nevertheless handle it.
2009-08-29 08:08:35 +01:00
Chris Wilson
4c215162d2 [script] Off-by-one in allocation of string length.
We need pass in the real number of bytes in the string, excluding the NUL
terminator which is already accounted for.
2009-08-29 08:08:35 +01:00
Chris Wilson
55eddb7ef4 [script] A little utility to convert a trace into a trace
Replay the trace using the interpreter onto a script surface - useful for
checking idempotency.
2009-08-29 08:08:35 +01:00
Chris Wilson
bb919584c0 [script] Use a compact representation for horizontal offsets between glyphs
Kerning is quite frequent, that is to apply a horizontal but no vertical
offset to a glyph. For instance by discarding the vertical coordinate
where it remains the same and only encoding the horizontal offset we
reduce the file size by ~12.5% when tracing poppler.
2009-08-29 08:08:34 +01:00
Chris Wilson
cbee97f0e3 [script] Preserve '{}' whilst translating 2009-08-29 08:08:34 +01:00
Chris Wilson
dc886450ac [util] Show total edge length in show-edges 2009-08-29 08:08:31 +01:00
Chris Wilson
f8bb3617c3 Eliminate self-intersecting strokes.
We refactor the surface fallbacks to convert full strokes and fills to the
intermediate polygon representation (as opposed to before where we
returned the trapezoidal representation). This allow greater flexibility
to choose how then to rasterize the polygon. Where possible we use the
local spans rasteriser for its increased performance, but still have the
option to use the tessellator instead (for example, with the current
Render protocol which does not yet have a polygon image).

In order to accommodate this, the spans interface is tweaked to accept
whole polygons instead of a path and the tessellator is tweaked for speed.

Performance Impact
==================

...
Still measuring, expecting some severe regressions.
...
2009-08-29 08:08:28 +01:00
Behdad Esfahbod
e63d725ad4 [utils] Remove unused code 2009-08-10 12:47:37 -04:00
Chris Wilson
c4828666b9 [script] Handle translation of compressed strings.
After introducing the new syntax to mark a deflated string, we also need
to add the equivalent binary tokens.
2009-08-10 17:19:34 +01:00
Chris Wilson
81c4594712 [script] Ensure strings are nul terminated
Infrequently, but, for example, handling glyph strings, we require the
string to be nul terminated. (Otherwise an error occurs, which was
previously compounded by a drastic leak.)
2009-08-06 23:47:44 +01:00
Chris Wilson
86d6a48952 [script] Check for failure to store the glyph cache
If we fail to add the glyph cache (presumably because the font is in
error) do not leak the allocation. As this occurs for every single glyph
string, the leak can grow very quickly and mask the original bug.
2009-08-06 23:47:40 +01:00
Chris Wilson
af392f7e45 [script] Extend csi-replay to show how to use a single surface
Currently the replay creates a fresh surface for every new surface. Whilst
using it to view replays (such as with --xlib) this is often not what is
desired so add a mode (compile-time only for now) to use similar surfaces
and blits to the front buffer instead.
2009-08-06 23:19:52 +01:00
Chris Wilson
b7639a5f79 [trace] Close the dictionary before font
font expects the dictionary to be constructed on the stack for its use, so
close it. (I missed the closing '>>' when switching between dictionary
constructors.)
2009-08-06 10:55:18 +01:00
Chris Wilson
ee69f8aa5e [trace] Whitespace
A few gratuitous whitespace and increase the buffer size used whilst
reading in data files.
2009-08-06 10:30:52 +01:00
Chris Wilson
6d30021d65 [trace] Only write the 4 byte length to the stream
We were attempting to write out the whole length of the block when we were
just trying to write out the length value.
2009-08-06 10:29:49 +01:00
Chris Wilson
e2f912dc5b [script] Add cvi, cvr, mod
Add implementations of convert-to-integer, convert-to-real and modulus
supplied by Zack Weinberg <zweinberg@mozilla.com>.
2009-07-28 09:32:36 +01:00
Chris Wilson
25858d524d [script] Fix reference to font source after transferring to mmap
After diverting the pointers to accommodate lazy decompressing of the
source, the bytecode pointer was left pointing to the original location
that had already been freed - thus passing an invalid block to FreeType
and unsurprisingly then, blowing up.
2009-07-27 10:18:25 +01:00
Chris Wilson
e577096dff [boilerplate] Fix compilation against old revisions (as old as 1.9.2!) 2009-07-24 10:57:26 +01:00
Chris Wilson
8b8e03503d [script] mark scan_read() inline
Small function that is critical to performance whilst scanning scripts.
2009-07-24 10:44:04 +01:00