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.
A new meta-surface backend for serialising drawing operations to a
CairoScript file. The principal use (as currently envisaged) is to provide
a round-trip testing mechanism for CairoScript - i.e. we can generate
script files for every test in the suite and check that we can replay them
with perfect fidelity. (Obviously this does not provide complete coverage
of CairoScript's syntax, but should give reasonable coverage over the
operators.)
Benjamin Otte noticed that the top-left vertex was now included within the
fill extents. Having updated the test case to check the insideness
conditions as defined by flash, fix the edge handling to match.
7944601864 broke the quartz backend.
Fix it by adding const to the appropriate parameters in the function
declarations and copying the pattern when needed.
Use the return value to return the result from _cairo_hash_table_lookup()
(as opposed to filling an output parameter on the stack) as this (a)
results in cleaner code (no strict-alias breaking pointer casts), (b)
produces a smaller binary and (c) is measurably faster.
As we obey the rule in Cairo that we only insert if we know that there is
no existing entry in the hash table, we can therefore perform a much quicker
search knowing that the key is unique.
A limitation of the current API was that the destroy notifier was called
on the mime-data block. This prevents the user from passing in a pointer
to a managed block, for example a mime-data block belonging to a
ref-counted object. We can overcome this by allowing the user to specify
the closure to be used with the destroy notifier.
Reading through the previous commit spotted that the arguments to
edge_compare_for_y_against_x were transposed, but the test-suite had
failed to catch detect it. This is due that in order to actually
solve the equation we need to have a diagonal edge passing near an
off-centre point of interest, which was not among the test cases. So add
some off-centre tests to fully exercise the code.
Benjamin Otte reports that in one particular benchmark cairo_in_fill() is
a hotspot in the profile. Currently we tessellate the entire path and then
search for a containing trapezoid. This is very expensive compared to the
simple method of counting the number of edge crossing between the point of
interest and x=-∞. For example, this speeds tessellate-256 up by almost 3
orders of magnitude.
Write out the original PNG mime-data if attached to the surface during
cairo_surface_write_to_png(). Similar to how the compressed alternate
representations are handled by the other backends.
Note: by automatically attaching and using the mime-data in preference to
the image data, we break the read_from_png(); draw(); write_to_png()
cycle.
I moved the pixel centre to xc,yc but forgot to remove it during
compensation - as caught by the test suite.
Refresh a couple of reference images that depend upon exact pixel-centre
rounding conditions.
pixman limits the src] co-ordinates (and thus [xy]_offset] to 16bits,
so we need to be careful how much of the translation vector to push into
[xy]_offset. Since the range is the same for both, split the integer
component between the matrix and the offset.
test/scale-offset* now at least shows the source image, even if it is
misplaced.
set_font_face was not consuming it's operand but blithely placing an
undefined font_face onto the operand stack, whereas set_source was
performing invalid exchanges on the stack.