Use the new API Behdad exposed in 1.8 to precompute a glyph string using
Cairo and then benchmark cairo_show_glyphs(). This is then equivalent to
the text benchmark but without the extra step of converting to glyphs on
every call to cairo_show_text() i.e. it shows the underlying glyph
rendering performance.
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
After a short wild goose chase to see why
cairo_image_surface_fill_rectangles() was appearing in the profile,
tweak init_and_set_source_surface() to remove the redundant clear and
to propagate any errors in the auxiliary context.
The i915 is able to special case gradients with just 2 color stops to
avoid creating temporary gradient textures, so add a 3 stop linear
gradient to compare the speed difference.
Cover the similar source with min/mag scale factors as well, so we can
compare the performance impact with scaled image sources. This is useful
to distinguish between transport overhead and transform cost.
Since git 1.6 the plumbing commands aren't installed in the user's
path by default. This patch fixes cairo-perf-diff to find the
git-sh-setup command from git's lib dir.
These tests look at the differences in code paths
hit by filling paths that are rectilinear (or not) and
pixel aligned (or not) with the even-odd and non-zero
fill rules. The paths are not simple, so they don't
hit the special case quad/triangle tessellator.
We don't have one just for this purpose. The only other
path with many intersections that gets actually rendered is zrusin-another,
but that might be sped up in the future (say by identifying
collinearities up front or something like that.)
The attached patch makes the SDL tests compile under Mac OS X. The
problem is:
1) that <SDL_main.h> should be included in files that define the main
function for SDL Mac OS X programs (this is not true with the upcoming
SDL 1.3 release).
2) that -lSDLmain, because it is statically linked, needs the Cocoa
framework in the LDADD of the main program. Again, 1.3 will not require
this.
Include a COPYING inside perf/, test/, util/ to clarify the licensing
conditions beneath the respective directories. This is because cairo
itself (libcairo.so) is LGPL-2.1/MPL-1.1 but that only relates to src/.
The auxiliary source files are under a mix of free licenses and we wish to
be clear just what license applies to each file.
In particular, cairo-trace needs to include the GPL terms and conditions.
Behdad wants to include the feature with 1.10, so we enable it as early as
possible in 1.9 dev cycle to generate as much feedback as possible.
The first change is to use "<cairo>" as being a name unlikely to clash
with any real font names.
This reverts commits:
a824d284be,
2922336855,
e0046aaf41,
f534bd549e.
This performance test relied on the recently-removed ability
to select the internal twin-based font family with a name of
"cairo".
Presumably, we'll want to bring this performance case back when
some other means of requesting that font face is added.
Janoos spotted that the unaligned clip actually degenerated to an empty
clip due to a typo when constructing the second rectangle. Simply use a
cairo_rectangle() instead.
Generate a cairo-perf-diff graph for a series of commits in order to be
able to identify significant commits. Still very crude, but minimally
functional.
Add a new test case to Cairo for checking the performance of Cairo's
equivalent to GDK's gdk_pixbuf_composite_color() operation. That is an
operation that happens to be extremely useful when viewing or editing
transparent images so I think it is important that it is as fast as
possible.
Add the performance test case to compare the speed of filling a rounded
rectangle (one with camphered corners) as opposed to an ordinary
rectangle. Since the majority of the pixels are identical, ideally the two
cases would take similar times (modulo the additional overhead in the more
complex path).
Quick summary of changes:
- Move list of cairo source files out of src/Makefile.am and into
src/Sources.mk,
- Generate files src/Config.mk and src/Config.mk.win32 that choose
the right set of source files and headers based on configured
backends and features. This drastically simplifies building
using other build systems. The src/Makefile.win32 file needs
to be updated to reflect these changes.
- Add README files to various directories,
- Add toplevel HACKING file.
The compiler complained about passing a non-string literal as the format
to printf, so just to sanitize the code and keep the compiler happy, add
the magic "%s" format.
In order to run under memfault, the framework is first extended to handle
running concurrent tests - i.e. multi-threading. (Not that this is a
requirement for memfault, instead it shares a common goal of storing
per-test data). To that end all the global data is moved into a per-test
context and the targets are adjusted to avoid overlap on shared, global
resources (such as output files and frame buffers). In order to preserve
the simplicity of the standard draw routines, the context is not passed
explicitly as a parameter to the routines, but is instead attached to the
cairo_t via the user_data.
For the masochist, to enable the tests to be run across multiple threads
simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired
number.
In the long run, we can hope the need for memfault (runtime testing of
error paths) will be mitigated by static analysis. A promising candidate
for this task would appear to be http://hal.cs.berkeley.edu/cil/.