Commit graph

6 commits

Author SHA1 Message Date
Chris Wilson
23648e2fdf [script] Prototypical binary translator
Hook into the scanner to write out binary version of the tokenized
objects -- note we bind executable names (i.e. check to see if is an
operator and substitute the name with an operator -- this breaks
overloading of operators by scripts).

By converting scripts to a binary form, they are more compact and
execute faster:

  firefox-world-map.trace 526850146 bytes
              bound.trace 275187755 bytes

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]     null                        bound   34.481   34.741   0.68%    3/3
[  1]     null            firefox-world-map   89.635   89.716   0.19%    3/3
[  0]      drm                        bound   79.304   79.350   0.61%    3/3
[  1]      drm            firefox-world-map  135.380  135.475   0.58%    3/3
[  0]    image                        bound   95.819   96.258   2.85%    3/3
[  1]    image            firefox-world-map  156.889  156.935   1.36%    3/3
[  0]     xlib                        bound  539.130  550.220   1.40%    3/3
[  1]     xlib            firefox-world-map  596.244  613.487   1.74%    3/3

This trace has a lot of complex paths and the use of binary floating point
reduces the file size by about 50%, with a commensurate reduction in scan
time and significant reduction in operator lookup overhead. Note that this
test is still IO/CPU bound on my i915 with its pitifully slow flash...
2009-07-04 15:29:07 +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
867c88ae90 [script] Add a finish method to the interpreter
When using fonts circular references are established between the holdover
font caches and the interpreter which need manual intervention via
cairo_script_interpreter_finish() to break.
2009-06-06 12:59:39 +01:00
Chris Wilson
ecb8dce27c [script] Recreate surface content.
Use the content recorded in the trace, defaulting to COLOR_ALPHA, to
determine the replayed surface type.
2009-01-02 09:53:24 +00:00
M Joonas Pihlaja
3b11997a23 [cairo-script] Remove outdated #error to allow compilation to succeed.
The interpreter doesn't depend on the script surface anymore.
2008-11-13 18:06:40 +02:00
Chris Wilson
cdfffc7420 Add CairoScript interpreter
Add a CairoScript interpreter library and use it to replay the test output
for the CairoScript backend. The library is also used by the currently
standalone Sphinx debugger [git://anongit.freedesktop.org/~ickle/sphinx].
The syntax/operator semantics are not yet finalized, but are expected to
mature before the next stable release.
2008-11-13 11:36:55 +00:00