Commit graph

351 commits

Author SHA1 Message Date
Emanuele Aina
cca8b1960b cairo-trace: Fix duplicated surface push on similar-image
The current code results in trace lines with the source surface being
pushed on the stack two times instead of one:

s1 s1 //ARGB32 48 48 similar-image % s2

Instead of:

s1 //ARGB32 48 48 similar-image % s2

This greatly confuses later commands when the script was replayed,
causing traces for trivial GTK3 programs to be unplayable, usually
yielding the following error:
"invalid value (typically too big) for the size of the input (surface, pattern, etc.)"

Drop the duplicated entry from the trace line printed by the
cairo_surface_create_similar_image() override.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73580
Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
2015-01-20 18:14:52 +01:00
Bryce Harrington
42320793aa sphinx: Add ickle's explanation of what sphinx does 2014-09-24 12:12:47 -07:00
Behdad Esfahbod
f4dbba26d4 [cairo-trace] Work around fontconfig :charset= parse format change
As dicussed on the mailing list.
2014-07-14 15:55:12 -04:00
Behdad Esfahbod
312553af29 [trace] Don't print FC_CHARSET, FC_LANG, and FC_CAPABILITY
There are many more that can go, but these take the most bytes.
FC_CHARSET needs to go specially because I recently changed
its format in fontconfig.  Ouch!
2014-07-11 11:07:25 -04:00
Sylvestre Ledru
da9ef97372 Remove some useless declarations found by scan-build, the LLVM/clang static analyzer
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-05-06 10:14:53 -07:00
Ravi Nanjundappa
52b137bc3e test and util: maintain consistency in the usage of ARRAY_LENGTH macro
ARRAY_LENGTH macro is used in perf's cairo-perf.h, src's cairoint.h,
test's cairo-test.h and in some internal header files of util's
directory.So to maintain consistency ARRAY_SIZE is replaced with
ARRAY_LENGTH macro.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-04-30 13:01:35 -07:00
Bryce Harrington
39b7d5138e cairo-script: Compare status with CSI enums
CSI_STATUS_SUCCESS is defined as equivalent to CAIRO_STATUS_SUCCESS.
We should prefer the former when comparing against csi_status_t
variables, else we'll get a warning:

cairo-script-interpreter.c:637:23: warning: comparison between
‘csi_status_t’ and ‘enum _cairo_status’ [-Wenum-compare]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 11:26:02 -08:00
Bryce Harrington
18d66c88a2 cairo-script: Error if asked to decompress with missing compression lib
This quells the following warning:

warning: enumeration value ‘LZO’ not handled in switch [-Wswitch-enum]

The LZO enum value is defined and used elsewhere, even if lzo support
isn't available.

This situation might arise if cairo scripts were generated on one system
with lzo, and then replayed on a system without it.  For now simply
error out if this occurs.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 11:25:57 -08:00
Bryce Harrington
1ce452db4c cairo-trace: Stringify CAIRO_STATUS_JBIG2_GLOBAL_MISSING
This error enum was added last September when JBIG2 support was added.
Support it as well in the tracing code.  This fixes this warning:

trace.c:1544:5: warning: enumeration value
‘CAIRO_STATUS_JBIG2_GLOBAL_MISSING’ not handled in switch [-Wswitch]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 11:25:53 -08:00
Bryce Harrington
56a195a765 Fix SSIZE_T definition problem when making with MSYS on Windows7
Patch provided by Martin Schlemmer <Martin.Schlemmer@nwu.ac.za> on the
mailing list.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2013-10-31 20:34:15 -07:00
Chris Wilson
c1ac8db7e6 trace: Fix operand emission
Recent updates (in the past couple of years) to firefox have exposed
numerous bugs in the way we emit the operands. A few off-by-ones,
missing surfaces and outright bugs all of which are intermixed into
producing a corrupt stack.

Reported-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 16:37:24 +01:00
Chris Wilson
0266cb821f script: Add support for replaying device-scale
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 16:13:56 +01:00
Chris Wilson
a4164142f2 trace: Record set-device-scale
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 16:12:26 +01:00
Chris Wilson
17dc312221 trace: Improve operand emission
In particular fixing up a couple of corner cases in emitting the right
instructions for scaled-fonts and patterns.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-05 22:34:52 +01:00
Nicola Fontana
59ccc3d72e gobject: Add wrapper around cairo_matrix_t
Reviewed-By: Benjamin Otte <otte@redhat.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-23 19:47:54 +01:00
Chris Wilson
768b81b78e script: Set decompression length prior to calling decompressors
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59224
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-14 03:27:11 +00:00
Chris Wilson
e1307da861 script: Simply exchange source/dest images for _set_source_image
But note we can only do the exchange if they do indeed match and
there are no other references (the objects are only on the stack).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:01:37 +00:00
Chris Wilson
146da77d85 script: Attempt to decompress images in place
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:01:37 +00:00
Chris Wilson
45a4b42a36 script: Recompress strings using LZO whilst binding traces
Try using the lighter-weight LZO decompressor in an effort to speed up
replays (at the cost of making the bound traces slightly larger).
Presuming that with the slight increase in file size (from -1% to +10%),
the file data remains in the readahead buffer cache, replays see a
performance improvement of between 5-10%.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-05 21:10:35 +00:00
Chris Wilson
8cd604e18a gobject: Fix my typo s/TEST/TEXT/ in the previous commit
Again reported by Kouhei Sutou, who I am grateful for his deligence.
2013-01-04 14:03:40 +00:00
Kouhei Sutou
a4f221498c gobject: Fix "text_cluster_flags_get_type" typo
The macro missed the text from the name, rendering it useless.
2013-01-04 12:18:29 +00:00
Kouhei Sutou
ecc8c28b24 gobject: Add the correct macro name for the hint-metrics type
s/CAIRO_GOBJECT_TYPE_HNT_METRICS/CAIRO_GOBJECT_TYPE_HINT_METRICS/

However, as we have already released the broken headers, we need to
preserve that mistake in case applications are already using. Since it
is just a #define, there is little associated cost with carrying both
the incorrect spelling and the corrected define.
2013-01-03 15:07:18 +00:00
Chris Wilson
153b11612f script: Fix map-to-image/unmap stack manipulations
The idiom (and expectation) for surface operators is that it leaves the
surface on the stack for the next operation. Also we need to hold onto a
surface reference for objects put onto the stack, yet for the
map-to-image return we did not own one.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-28 09:57:29 +00:00
Chris Wilson
dfbf80a57d trace: Do not forcibly add surfaces to the dictionary
Adjust the stack manipulation to avoid moving an unknown surface to
the dictionary.

Reported-by: Dongyeon Kim <dy5.kim@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-28 09:36:59 +00:00
Chris Wilson
376d39121c trace: Fix operand emission for map-to-image and unmap-image
Reported-by: Dongyeon Kim <dy5.kim@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-27 12:25:56 +00:00
Chris Wilson
5844dead01 util/show-polygon: Show the limited range of each edge
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:37:58 +00:00
Alexis Ballier
f78a926922 cairo-sphinx: protect -ldl link with CAIRO_HAS_DL like in cairo-trace.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-08 22:00:31 +02:00
Alexis Ballier
3d2712d56a cairo-fdr: protect -ldl link with CAIRO_HAS_DL like in cairo-trace.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-08 21:59:39 +02:00
Behdad Esfahbod
1054840d86 Fix malloc-stats for newer glibc 2012-09-22 15:59:36 -04:00
Behdad Esfahbod
38c6084758 [util/malloc-stats] Use tighter spacing. 2012-09-17 16:27:04 -04:00
Chris Wilson
30d09cd33a cairo-script: Attempt to fallback for unresolved patterns
If we fail to resolve a particular pattern, try removing a few features
from the pattern and see if we can resolve that fallback and continue on
with the trace with a close approximation.

This is then behaves very similar as if the pattern requested a specific
font that was not available on the system and so was substituted.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-20 17:20:08 +01:00
Chris Wilson
b438e58308 trace: Fix propagation of CAIRO_TRACE_OUTDIR to children
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-11 17:42:17 +01:00
Maarten Bosmans
9fcbe25c2d Protect code using dlfcn.h with CAIRO_HAS_DLSYM 2012-04-10 12:07:49 +01:00
Kalev Lember
d18542b735 win32: Avoid redefining ssize_t
... if it's already defined by system headers. mingw-w64 includes a
ssize_t definition, so we'll have to make sure not to redefine it in
that case.
2012-03-29 21:13:21 +01:00
Dongyeon Kim
a473c03567 trace: Wrap GL surfaces 2012-03-19 10:36:08 +00:00
Chris Wilson
f5b5fad66e trace: Add breadcrumb for cairo_image_surface_get_data()
Just emit a marker for when cairo_image_surface_get_data() is called on
a surface so that we have a breadcrumb for when the pixels are first
exported. (Though note that pointer may be kept around and used much
later.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 11:58:51 +00:00
Nis Martensen
77da76ac6c doc: fix a few typos found by codespell
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Chris Wilson
4713562eda trace: Remove the warning about the unstable format
We're stuck with the PostScript style for this generation now.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:50:21 +00:00
Chris Wilson
f5f303f10d script: Prefer polymorphorism for mesh path construction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:48:50 +00:00
Chris Wilson
8844d50308 Convert cairo_mime_surface_t to cairo_raster_source_pattern_t
As discussed, overloading the cairo_surface_t semantics to include
sources (i.e. read-only surfaces) was duplicating the definition of
cairo_pattern_t. So rather than introduce a new surface type with
pattern semantics, start along the thorny road of extensible pattern
types.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:35:42 +00:00
Andrea Canciani
549b1f8d4b boilerplate: Remove unused thread id parameter
The thread id is not used anymore (it is always == 0), so it can be
removed.
2011-11-12 20:49:08 +01:00
Andrea Canciani
90b2fd34fb cairo-script: Don't ask for inlining of a cold-path function
Silences a lot of warnings:

inlining failed in call to 'scan_read.part.9': call is unlikely and
code size would grow
2011-11-09 14:17:10 +01:00
Chris Wilson
538fa0d6fb fill: Fix unantialiased rectilinear-fill-to-boxes
We were calling the antialias close function from the unantialiased
paths - a function that operates on a completely different structure to
the one passed in.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 15:58:14 +01:00
Chris Wilson
add9a4092b trace: Emit an stack operation to create a pattern from an undefined surface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-27 14:56:55 +01:00
Andrea Canciani
f8e4657d8a Make cairo-missing a static library
It was meant to be static, but my autotools-fu was not good enough.
2011-09-18 09:01:07 -07:00
Chris Wilson
35f41d253f fdr,tee: Reorder master/slave invocation to capture death-upon-signals
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-16 13:48:09 +01:00
Chris Wilson
af9fbd176b Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
2011-09-12 08:29:48 +01:00
Andrea Canciani
6ad63946d4 cairo-missing: Fix build
The cairo-missing code contains multiple typos and uses
_cairo_*alloc*() functions without including cairo-malloc-private.h
2011-09-04 16:23:37 -07:00
Andrea Canciani
761ef7ae8b cairo-missing: Fix and cleanup ssize_t type definition
The definition of ssize_t is needed in cairo-missing.h and can be
dropped from files which include it.
2011-09-04 16:23:37 -07:00
Andrea Canciani
6d6bfbd641 Introduce the cairo-missing library
The cairo-missing library provides the functions which are needed in
order to correctly compile cairo (or its utilities) and which were not
found during configuration.

Fixes the build on MacOS X Lion, which failed because of collisons
between the cairo internal getline and strndup and those in libc:

cairo-analyse-trace.c:282: error: static declaration of ‘getline’ follows non-static declaration
/usr/include/stdio.h:449: error: previous declaration of ‘getline’ was here
cairo-analyse-trace.c:307: error: static declaration of ‘strndup’ follows non-static declaration
...
2011-09-02 12:27:13 +02:00