Commit graph

85 commits

Author SHA1 Message Date
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
9d7fd626c3 [script] Decompress font sources
Need to decompress patterns and embedded bytecode before passing to
fontconfig/FreeType.
2009-07-23 17:05:28 +01:00
Chris Wilson
710308c64e [script] Extended blend mode support. 2009-07-14 16:31:41 +01:00
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
2ecafb025c [script] Reuse glyph advance cache over multiple invocations
Store the metric cache as user-data on the scaled-font so that we can
retrieve it on future calls to show-glyphs and friends.
2009-06-28 10:09:01 +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
Chris Wilson
1498c9c333 [script] Also mmap backing storage for the pattern descriptions
These can be reasonably large and persist for long times due to the
font holdover caches, so manually swap them out to save space on tiny
swapless machines.
2009-06-12 08:33:25 +01:00
Chris Wilson
3aaea453b0 [script] Store fonts inside mmaped files.
As an aide to tiny swapless systems write the rarely used bytes that
define type42 fonts into a deleted file and mmap them back into our
address space.
2009-06-11 22:38:09 +01:00
Chris Wilson
f7dbdf1fd1 [script] Hide pixman-ops when copying pixels
Seeing unexpected time inside pixman composite is quite disturbing when
trying to track down the apparent slowness in some benchmarks. Remove one
source of this artefact by simply memcpy'ing pixel data when trivial.
2009-06-11 15:19:59 +01:00
Chris Wilson
16eb160c77 [script] Enable compilation without fontconfig
Some insane people actually try compiling cairo with freetype and without
fontconfig...
2009-06-06 20:10:49 +01:00
Chris Wilson
098822d7ee [script] Fix erroneous error return when rendering type3 glyphs
Only return a USER_FONT_ERROR if an error occurs whilst rendering the
glyph!
2009-06-06 10:35:19 +01:00
Chris Wilson
99482b17a5 [script] Improve caching of glyph advance
The glyph advance cache was only enabled for glyph indices < 256,
causing a large number of misses for non-ASCII text. Improve this by
simply applying the modulus of the index to select the cache slot - which
may cause some glyph advances to be overwritten and re-queried, but
improves the hit rate.
2009-06-02 15:13:46 +01:00
Chris Wilson
e38f85c5de [script] Pedantic violations
Fixup a few trivial errors with -pedantic.
2009-05-08 08:53:43 +01:00
Chris Wilson
0c00556990 [script] Missing include for INT32_MAX
Avoid depending upon stdint.h, or rather cut'n'pasting Cairo's portable
defines, by using INT_MAX and limits.h instead.
2009-05-08 08:52:32 +01:00
Chris Wilson
8abd21bd3a [script] Call the context creation hook
Hook in the creation hook so applications can record or even modify the
contexts used in replay.
2009-01-02 09:53:25 +00:00
Chris Wilson
fd96cea4fe [script] Improve array construction.
Limit the memory allocation to the initial array size and perform a direct
copy from the operand stack to the array.
2009-01-02 09:53:24 +00: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
Chris Wilson
449bf0bb7b [script] Silence incorrect compiler warnings
Bah, the compiler failed to do its IPA correctly and wrongly complained
about potential use of uninitialised out-params guarded by the return
value. Silence them!
2008-12-18 12:06:46 +00:00
Chris Wilson
0df43251d4 [replay] Take advantage of unresolved fonts
As Behdad has changed the underlying ft-font to accept unresolved patterns,
take advantage of that to simplify the replay code.
2008-12-18 12:06:35 +00:00
Chris Wilson
83f0e6cf62 [script] Inline the stack push
Frequently to push an object onto the stack all we need is to simply
perform the struct copy - so inline it and only call the out-of-line
function if we need to enlarge the stack.
2008-12-12 12:00:43 +00:00
Chris Wilson
565b3d6ad6 [script] Switch to hyphens.
Using hyphen in the operators is easier to read than underscores.
2008-12-12 12:00:43 +00:00
Chris Wilson
3abfd836a0 [script] Null constructor
Expose 'null', principally for comparison purposes.
2008-12-12 12:00:43 +00:00
M Joonas Pihlaja
7540ac7f23 [script] Reverse direction of bitshift.
Positive shift counts should shift left according to PostScript.
2008-12-12 12:00:43 +00:00
Chris Wilson
4be479cc63 [script] Add simple to integer converter
Simple operator to coerce the type of the object on top of the stack to
integer.
2008-12-12 12:00:43 +00:00
Chris Wilson
177a68ef3e [script] Add a few mathematical constants
Just pi and the sqrt(2) for the moment, more to come on demand.
2008-12-12 12:00:42 +00:00
Chris Wilson
5dfaa22a57 [script] Add repeat operator.
Simple operator to repeat procedure n times.
2008-12-12 12:00:42 +00:00
M Joonas Pihlaja
265ebd372a [script] Flesh out the relational comparison operators to be more PostScript-like.
The relational comparison operators can now compare strings vs names
by content as well as performing automatic type promotions on the
numeric types.  For other types relational comparisons succeeed
only if the values compare equal according to the eq operator, and
put the interpreter into a type-error state otherwise.
2008-12-12 12:00:42 +00:00
M Joonas Pihlaja
05afec7a8a [script] Implement the ne operator. 2008-12-12 12:00:41 +00:00
M Joonas Pihlaja
1aeb96dc28 [script] Implement PostScript-like semantics for the eq operator.
The eq operator would only work for some types and put the
interpreter in an error state if passed objects it didn't
know how to compare.  It would also not compare strings
by value nor allow strings to be compared to names.
This patch makes any two objects comparable.
2008-12-12 12:00:41 +00:00
M Joonas Pihlaja
4ba77f7765 [script] Fix dictionary construction to access the right stack slots.
It bound values to themselves and ignored keys.
2008-12-12 12:00:41 +00:00
Chris Wilson
e184bf0d35 Fix compilation with --enable-png=no
Adrian Johnson spotted that the build was broken if the PNG functions were
disabled. Fix.
2008-12-12 10:20:47 +00:00
Chris Wilson
5591cb58fd [script] Only use zlib if available.
Conditionally link against zlib - replaying a script will fail if the
trace uses a compressed format.
2008-11-26 17:43:22 +00:00
Chris Wilson
1f48b36933 [script] Build fix for ! HAS_FT_FONT
Correct the macro definition used when compiling without FreeType.
2008-11-21 09:35:41 +00:00
Chris Wilson
c41b99268d Conditionally include byteswap.h
Fixup compilation by copying the checks from cairo-wideint-private.h to
conditionally include byteswap.h and provide fallback implementations.
2008-11-19 11:59:21 +00: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