Commit graph

314 commits

Author SHA1 Message Date
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
bed2701e1c Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)

In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.

Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:

ppc:
Speedups
========
image-rgba         evolution-20090607-0    1026085.22 0.18% -> 672972.07 0.77%:  1.52x speedup
▌
image-rgba         evolution-20090618-0    680579.98 0.12% -> 573237.66  0.16%:  1.19x speedup
▎
image-rgba      swfdec-fill-rate-4xaa-0    460296.92 0.36% -> 407464.63  0.42%:  1.13x speedup
▏
image-rgba      swfdec-fill-rate-2xaa-0    128431.95 0.47% -> 115051.86  0.42%:  1.12x speedup
▏
Slowdowns
=========
image-rgba     firefox-periodic-table-0    56837.61 0.78% -> 66055.17    3.20%:  1.09x slowdown
▏
2009-07-23 15:32:14 +01:00
Chris Wilson
1ae5942a3a Merge commit 'anholt/gl'
Conflicts:
	boilerplate/Makefile.sources
	boilerplate/cairo-boilerplate.c
	build/configure.ac.features
	src/cairo.h
	util/cairo-script/Makefile.am
2009-07-21 22:28:44 +01:00
Chris Wilson
e288317748 Add a jhbuild moduleset. 2009-07-20 18:56:10 +01:00
Chris Wilson
aac256b269 Compile fixes for mingw32.
Trivial typos found whilst using a cross-compiler.
2009-07-18 16:18:13 +01:00
Chris Wilson
52fa8760ae Add OpenVG backend.
Based on the work by Øyvind Kolås and Pierre Tardy -- many thanks to
Pierre for pushing this backend for inclusion as well as testing and
reviewing my initial patch. And many more thanks to pippin for writing the
backend in the first place!

Hacked and chopped by myself into a suitable basis for a backend. Quite a
few issues remain open, but would seem to be ready for testing on suitable
hardware.
2009-07-17 11:50:02 +01:00
Chris Wilson
1caa341039 Fix build under distcheck
Need to play a little dance to get the sources included and paths correct
whilst building source files with objdir != srcdir under distcheck.
2009-07-15 13:26:34 +01:00
Chris Wilson
710308c64e [script] Extended blend mode support. 2009-07-14 16:31:41 +01:00
Chris Wilson
ee8c50f2d6 Remove the defunct test-meta surface
Replace the internal test-meta surface will the freshly exported,
real meta-surface.
2009-07-04 22:00:09 +01:00
Chris Wilson
fef3649953 [script] Fix the trivial errors running the test suite
A few typos crept in breaking the script output and various refreshes of
the expected results.
2009-07-04 18:32:57 +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
f4019be7bd [trace] Remove a few transient pattern def/undef
It is easier on the eye to use
   '1 index set-source exch pop'
rather than
   'dup /p0 exch def p0 set-source /p0 undef'
(as patterns are expected to be temporary so we strive to avoid naming
them).
2009-07-04 13:16:42 +01:00
Chris Wilson
dcb7f1d034 [script] Add missing include <string.h>
As reported by Magnus Boman <captain.magnus@gmail.com>.

Fixes Bug 22610 -- Patch to add missing include in util/cairo-script/csi-replay.c
http://bugs.freedesktop.org/show_bug.cgi?id=22610
2009-07-04 08:08:25 +01:00
Chris Wilson
f7021d8f3e [script] Enable error handling for recursive scanners
It's conceivable that a script could execute another file and so we should
only setjmp on the first invocation.
2009-06-28 20:44:30 +01:00
Chris Wilson
963664727b [trace] Compile fix for --enable-script
Silly typo as pointed out by Hans Breuer <hans@breuer.org>.
2009-06-28 10:49:37 +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
Chris Wilson
34ac8673b2 [script] Use setjmp exception handling during scanning
Save ~5% of overhead by using longjmp on error to terminate scanning
instead of propagating the error, incurring lots of redundant error
checks.
2009-06-28 00:48:05 +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
M Joonas Pihlaja
1b6dbcbbeb [trace] Compile without fontconfig.
Use CAIRO_HAS_FC_FONT to decide whether to export
cairo_ft_font_face_create_for_pattern() or not.
2009-06-19 19:01:14 +03:00
Chris Wilson
84e587bbfa [trace] Prevent a child process from writing to the same file
After opening a specific file or fd for ourselves, reset the
CAIRO_TRACE_FD to point to an invalid fd in order to prevent any child
processes (who inherit our environment) from attempting to trace cairo
calls. If we allow them to continue, then the two traces will intermix
and be unreplayable.
2009-06-19 14:41:39 +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
030ef4ca00 [trace] Change the threshold at which pixel data is immediately copied
Embed the pixels for images less than 32*32 as this catches most icons
which are frequently uploaded, but is still an unlikely size for a
destination image surface.
2009-06-19 11:56:14 +01:00
Chris Wilson
e5727e20f5 Expose _cairo_null_surface_create() via a test surface
Using a null surface is a convenient method to measure the overhead of the
performance testing framework, so export it although as a test-surface so
that it will only be available in development builds and not pollute
distributed libraries.
2009-06-15 12:03:37 +01:00
Chris Wilson
f2057061c6 [trace] Add sticky bit to (system-wide) trace output dir
Need to allow user programs to dump their traces into the common output
directory, when using /etc/ld.so.preload to capture traces for the entire
desktop.
2009-06-15 12:02:25 +01:00
Chris Wilson
37f32f2951 [util] Disable default build of font-view
It's only a demonstration utility after a all and we do not need to incur
the cost of relinking it everytime we modify the main library.
2009-06-13 18:31:35 +01:00
Chris Wilson
f115c5479e [trace] Strip absolute path off name when profiling
Carl spotted this last night, but I misinterpreted it as an old problem
caused by the application changing its working directory before its first
cairo call - thus causing cairo-trace to attempt to open a file in the new
directory. Instead the problem was attempting to trace an executable with
an absolute path, where we just tagged it with a .lzma extentsion and
attempted to pipe the output there. Obviously this fails for the user
profiling system binaries. So use basename to strip the leading path.
2009-06-13 15:49:15 +01:00
Chris Wilson
c52eed6680 [trace] Handle wrapping python
python lazily loads libcairo.so and so it is not available via RTLD_NEXT,
and we need to dlopen cairo ourselves. Similarly the linker is not able to
resolve any naked function references and so we need to ensure that all of
our own calls into the library are wrapped with DLCALL.
2009-06-13 15:42:43 +01:00
Chris Wilson
606790a860 [script] Disable compilation of examples
Now that cairo-perf-trace exists and is a far superior replay tool, use
EXTRA_PROGRAM for the original replay tools.
2009-06-13 14:07:22 +01: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
6167f27adf [script] Fix memleak of duplicated strings from files
csi_string_new() duplicated the bytes which was not what was desired, so
implement a csi_string_new_for_bytes() to take ownership and prevent the
leak that was occuring, for example, every time we create a new font face.
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
015df191ba [trace] Prevent overflowing the operand stack when recreating objects
Objects like cairo_scaled_font_t may return a reference to a previously
defined scaled-font instead of creating a new token each time. This caused
cairo-trace to overflow its operand stack by pushing a new instance of the
old token every time. Modify the tracer such that a font token can only
appear once on the stack -- for font-faces we remove the old operand and
for scaled-fonts we simply pop, chosen to reflect expected usage.
2009-06-08 17:40:16 +01:00
Chris Wilson
09492288b3 [trace] Option to re-enable mark-dirty
Applications such as swfdec have a strictly correct use of mark-dirty and
so we need an option to re-enable mark-dirty tracing in conjunction with
--profile.
2009-06-08 17:38:14 +01:00
Chris Wilson
f08fe5b550 [trace] Redirect stdout to /dev/null when compressing
Otherwise we mix in stdout in with the trace and prevent replay.
2009-06-07 19:48:59 +01:00
Chris Wilson
f7a562a590 [configure] Don't attempt to build GTK+ utilities on system without GTK+ 2009-06-07 19:48: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
d753ba96ab [script] Manage used entries within hash tables
Apply the patch from Karl Tomlinson,
https://bugs.freedesktop.org/attachment.cgi?id=19802, to repack the hash
table if the number of free slots falls too low.
2009-06-06 13:52:20 +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
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
fa5d6c7afd [trace] Add a --profile mode
To save typing when creating macro-benchmarks --profile disables
mark-dirty and caller-info and compresses the trace using LZMA. Not for
computers short on memory!
2009-06-03 19:29:19 +01:00
Chris Wilson
56e9765f82 [util] Add font-view
A C variant of Behdad's python example font viewer.
2009-06-02 18:16:48 +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
Eric Anholt
f59f44c140 Merge commit 'origin/master' into gl
Felt like pulling the latest stuff, since I branched back in February.

Conflicts:
	build/configure.ac.features
	src/cairo.h
	util/cairo-script/csi-replay.c
2009-06-02 00:56:39 -07:00
Chris Wilson
247e76b923 [script] Speed up floating-point scanner
Hard-code frequent exponents to reduce number of calls to pow().
2009-06-01 18:04:13 +01:00
Chris Wilson
7dbc2fe80a [script] Simplify _dictionary_name_equal
Just a simple return TRUE since all necessary checking is performed by
_csi_hash_table_lookup().
2009-05-25 22:14:57 +01:00
Chris Wilson
0b5e92e66b [script] Check hash value between comparing keys 2009-05-25 22:14:57 +01:00
Chris Wilson
a364f71194 [trace] Set output location using pwd
Record the current working directory and pass that along to cairo-trace so
that the trace output is local to the user and not the application. This
is vital if the application is called via a script that changes directory.
2009-05-25 22:14:56 +01:00
Chris Wilson
a76e09ea65 [trace] Missing newlines in error messages. 2009-05-25 22:14:56 +01:00
Chris Wilson
87b764908a [gl] Add EGL target
Split the GLX context from the GL surface to enable use of an alternative
EGL interface.
2009-05-20 08:13:45 +01:00