summaryrefslogtreecommitdiff
path: root/util/cairo-trace/trace.c
AgeCommit message (Collapse)AuthorFilesLines
2009-01-02[trace] Adopt _cairo_dtostrChris Wilson1-374/+546
In order to have locale-independent output of decimal values, we need to manually transform such numbers into strings. As this is a solved problem for cairo, we adopt _cairo_output_stream_printf() and in particular the _cairo_dtostr() routine for our own printf processing.
2009-01-02[script] Recreate surface content.Chris Wilson1-1/+7
Use the content recorded in the trace, defaulting to COLOR_ALPHA, to determine the replayed surface type.
2009-01-02[trace] Correct escaped characters in string literal.Chris Wilson1-1/+12
Laziness caused the control character to be used instead of its replacement in the escaped string!
2009-01-02[trace] Correct a couple of typos.Chris Wilson1-2/+2
A couple of minor typos in the escaped characters strings.
2009-01-02[trace] Fix OBO in emit_glyphs()Chris Wilson1-1/+1
The largest index that will fit within 8 bits is 255 not 256!
2009-01-02[trace] Minor tidy.Chris Wilson1-4/+4
Improve scoping of variables.
2008-12-18[trace] Runtime version check.Chris Wilson1-22/+25
Check that the application is using cairo >= 1.9 before attempting to query the mime-data.
2008-12-12[script] Switch to hyphens.Chris Wilson1-57/+57
Using hyphen in the operators is easier to read than underscores.
2008-12-12Fix compilation with --enable-png=noChris Wilson1-0/+4
Adrian Johnson spotted that the build was broken if the PNG functions were disabled. Fix.
2008-11-19[trace] Correctly push font-face onto the operand stack.Chris Wilson1-25/+36
We tried to push a reference to an undefined font-face, now we just copy from the operand stack.
2008-11-19[trace] Construct matrices directlyChris Wilson1-5/+5
Avoid building a temporary array by constructing the matrix directly.
2008-11-19Conditionally include byteswap.hChris Wilson1-1/+16
Fixup compilation by copying the checks from cairo-wideint-private.h to conditionally include byteswap.h and provide fallback implementations.
2008-11-19[trace] Simple unbounded cache for symbol lookups.Chris Wilson1-4/+5
Reparsing the dwarf info for every lookup is very slow, so cache the symbol lookups. This initial implementation is unbounded in the simple belief that the actual number of unique lookups during a program's lifetime should be fairly small. (Extending to a bounded MRU list is left as an exercise for the reader.)
2008-11-13[trace] Add caller line info.Chris Wilson1-13/+121
Use lookup_symbol() on the return address to identify the caller and emit useful debug info to the trace.
2008-11-13[trace] Check for an undefined pattern and use index instead.Chris Wilson1-2/+18
2008-11-13[trace] Detect and report broken traces.Chris Wilson1-1/+14
We cannot trace the cairo-script-interpreter as that uses Cairo's private symbols.
2008-11-13[trace] Trace mark-dirtyChris Wilson1-16/+105
Capture the image data on mark dirty and record in the trace.
2008-11-13[trace] Add unstable warning.Chris Wilson1-0/+1
Add warning that CairoScript is unfinished and I may radically alter the format/syntax/language before release.
2008-11-08[trace] Use a string literal for the type.Chris Wilson1-14/+14
In order that the string is interned and so is only allocated the once.
2008-11-08[trace] Record the XID as a numberChris Wilson1-3/+3
Don't waste string constants (which get interned) for a simple number!
2008-11-08[trace] Remove stray /sourceChris Wilson1-1/+0
An accidental /source was pushing pushed onto the operand stack and never used.
2008-11-07[surface] Pass a separate closure for the mime-type destroy notifier.Chris Wilson1-2/+4
A limitation of the current API was that the destroy notifier was called on the mime-data block. This prevents the user from passing in a pointer to a managed block, for example a mime-data block belonging to a ref-counted object. We can overcome this by allowing the user to specify the closure to be used with the destroy notifier.
2008-11-05[trace] Use the mime-type image representationChris Wilson1-89/+214
When emitting image data, first check to see if we have a pre-compressed alternate representation.
2008-11-05[trace] Trim a few bytes from glyph arraysChris Wilson1-27/+38
Remove some redundant whitespace from the glyph arrays to improve readability and shrink the output file size.
2008-11-05[trace] Correct emission of set_font_face and set_sourceChris Wilson1-9/+27
set_font_face was not consuming it's operand but blithely placing an undefined font_face onto the operand stack, whereas set_source was performing invalid exchanges on the stack.
2008-11-05[trace] Capture foreign drawables.Chris Wilson1-9/+93
If we attempt to use a surface as a source before we write to it, record the surface contents.
2008-11-05[trace] Mark filter mode as immediate.Chris Wilson1-1/+1
Be consistent and use "//" for the filter mode to indicate a constant.
2008-11-04[trace] Fix emission of cairo_scaled_font_create()Chris Wilson1-14/+13
In the case where the font face was no longer on the operand stack, the font face would not have been passed to cairo_scaled_font_create().
2008-11-04[trace] Use a common directory by default.Chris Wilson1-2/+6
If called directly (e.g. via /etc/ld.so.preload) put the output trace into a central directory, and not the pwd.
2008-11-04[trace] Convert [1 0 0 1 0 0] to identityChris Wilson1-9/+25
Simplify the trace/replay by replacing the identity array with the identity operator.
2008-11-03[trace] Big-endian compile fixes.Chris Wilson1-4/+4
A few typos.
2008-11-03[trace] Wrap test surfaces.Chris Wilson1-8/+108
Wrap the test surfaces to avoid crashes whilst tracing the test suite.
2008-11-03[mime-data] Allow embedding of arbitrary mime-types.Chris Wilson1-1/+1
Use the surface user-data array allow to store an arbitrary set of alternate image representations keyed by an interned string (which ensures that it has a unique key in the user-visible namespace). Update the API to mirror that of cairo_surface_set_user_data() [i.e. return a status indicator] and switch internal users of the mime-data to the public functions.
2008-11-03[trace] Emit set_mime_data().Chris Wilson1-2/+28
Wrap the new cairo_surface_set_mime_data() function.
2008-11-03[trace] Fix boundary terminationsChris Wilson1-1/+1
Don't increment the terminator!
2008-11-03[trace] Use utf8 len in show_text_glyphs().Chris Wilson1-16/+20
Honour the parameter specifying the length of the utf8 string when emitting show_text_glyphs.
2008-10-31[util] Add cairo-trace.Chris Wilson1-0/+3345
This tool can be used to trace all the cairo function calls made by an applications. This is useful for either extracting a test case triggering a bug from an application, or simply to get a general idea of how an application is using cairo. After make install, cairo-trace program arguments, will print out all the cairo calls to the terminal and also capture theme in ./program.$pid.trace The format of the output is CairoScript, watch this space for more cairo-script tools!