Commit graph

6378 commits

Author SHA1 Message Date
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
Chris Wilson
a856371bef Add CairoScript backend.
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.)
2008-11-13 11:36:54 +00:00
Chris Wilson
47a56e0850 [type1] Bind the RD procedure
As the RD procedure may be called several hundred times for a full font,
it is worth binding.
2008-11-13 11:36:50 +00:00
Chris Wilson
0769d39d00 Add predicate likelihood macros.
Define the couple of standard macros that we can use to guide gcc
optimisations of which code path will be most likely taken.
2008-11-13 11:36:44 +00:00
Chris Wilson
b06c50cc54 [cairoint.h] Remove unused PLT entries.
Trim the slim_hidden_proto/def to match the currently used functions.
2008-11-13 11:36:43 +00:00
Chris Wilson
20fc2a2f92 [in-fill] Fixup boundary insideness testing
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.
2008-11-13 11:36:43 +00:00
Chris Wilson
9afad53730 [test] Expand in-fill-trapezoid
Test vertices and edges of a rectangle to probe 'corner-cases', using the
insideness conditions from flash.
2008-11-13 11:36:42 +00:00
Chris Wilson
cebc84f367 [hash] Separate out unique patterns of iterating over the table.
Avoid unnecessary conditionals for the hotpaths by separating out the
iteration over the elements into their distinct modes.
2008-11-13 11:36:42 +00:00
Chris Wilson
5f0aa27445 [trace] Add caller line info.
Use lookup_symbol() on the return address to identify the caller and emit
useful debug info to the trace.
2008-11-13 11:36:42 +00:00
Chris Wilson
4cd6b0c0b9 [trace] Check for an undefined pattern and use index instead. 2008-11-13 11:36:41 +00:00
Chris Wilson
76f249a493 [trace] Detect and report broken traces.
We cannot trace the cairo-script-interpreter as that uses Cairo's private
symbols.
2008-11-13 11:36:40 +00:00
Chris Wilson
01e2021b2b [trace] Trace mark-dirty
Capture the image data on mark dirty and record in the trace.
2008-11-13 11:36:39 +00:00
Chris Wilson
8f3d0b55f5 [trace] Add unstable warning.
Add warning that CairoScript is unfinished and I may radically alter the
format/syntax/language before release.
2008-11-13 11:36:32 +00:00
Chris Wilson
7ad2635ebe [trace] Disable stdout by default.
Don't hog the terminal when we save to a trace file anyway.
2008-11-13 11:36:32 +00:00
M Joonas Pihlaja
efa9e1088c [clip] Fix uninitialised status return in _cairo_clip_intersect_mask() for empty extents.
This fixes the clip-all test case crashing for me.
2008-11-13 13:10:18 +02:00
Behdad Esfahbod
279a7cef34 [os2] Fix includes
Patch from Dave Yeo to make cairo-os2.h include os2.h directly so the
header is standalone.
2008-11-13 10:50:41 +01:00
Jeff Muizelaar
0a682034a0 Make the clipping implementation comment clearer
When reviewing the spans changes, I reread this comment and it wasn't as clear
as it could be.
2008-11-11 13:26:09 -05:00
Peter Weilbacher
4fdd856569 README: adapt pixman version requirement to match configure.ac 2008-11-11 15:37:09 +01:00
Jeff Muizelaar
9c0042840c [quartz] Add the proper propagation of extents
This fixes the problems introduced by d682d275b9
2008-11-11 08:41:31 -05:00
Jeff Muizelaar
57551a9116 [quartz] Fix fallout caused by const cairo_pattern_t *
7944601864 broke the quartz backend.
Fix it by adding const to the appropriate parameters in the function
declarations and copying the pattern when needed.
2008-11-11 08:31:23 -05:00
Maarten Maathuis
164069b339 cairo-xcb: avoid leaking memory 2008-11-08 14:41:21 +00:00
Chris Wilson
5badcf6e37 [trace] Use a string literal for the type.
In order that the string is interned and so is only allocated the once.
2008-11-08 11:18:26 +00:00
Chris Wilson
1d0faefbc8 [trace] Record the XID as a number
Don't waste string constants (which get interned) for a simple number!
2008-11-08 11:18:26 +00:00
Chris Wilson
899a159b13 [trace] Remove stray /source
An accidental /source was pushing pushed onto the operand stack and never
used.
2008-11-08 11:18:25 +00:00
Chris Wilson
f1cae5c52a [ps] Trivial compile warning clenaup.
Add a missing const to silence the compiler.
2008-11-07 20:52:08 +00:00
Chris Wilson
2b32c8b9e5 [hash] Return lookup entry.
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.
2008-11-07 20:50:34 +00:00
Karl Tomlinson
d15fb9344b [hash] Set is_unique when finding an available for inserts
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.
2008-11-07 20:49:14 +00:00
Chris Wilson
cd2e18ddc6 [test] Fix-up rgb byte packing
Another embarrassing, but thankfully, trivial bug.
2008-11-07 19:35:26 +00:00
Chris Wilson
2554d17598 [surface] Pass a separate closure for the mime-type destroy notifier.
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.
2008-11-07 19:30:33 +00:00
Chris Wilson
ff0bd64e94 [NEWS] Add a few notes.
Help Carl with a speedy snapshot by writing a few notes about what has been
added so far to 1.9.
2008-11-06 01:22:39 +00:00
Chris Wilson
13627b4620 [in-fill] Fix transposed arguments.
Silly typo that escaped the test suite.
2008-11-06 01:07:25 +00:00
Chris Wilson
9dee7af41f [test] Add off-centre tests to in-fill-trapezoid.
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.
2008-11-06 01:06:20 +00:00
Chris Wilson
f5965cb7d6 [in-fill] Avoid tessellation by counting number of edge crossing to -∞
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.
2008-11-06 00:27:23 +00:00
Chris Wilson
0ac9846159 [test] Add WINDING variants to in-fill test
Check cairo_in_fill() with some WINDING tests as well as the current
EVEN_ODD.
2008-11-06 00:06:12 +00:00
Chris Wilson
476d5daa9b [trace] Only build if we have zlib.
Use the configure check for libz and do not attempt to build the trace
unless we have zlib.
2008-11-05 19:29:04 +00:00
Chris Wilson
34564aa84a [test/pdf2png] Remove dependency on GdkPixbuf
It's appears to be dropped from the current poppler trunk, so just use our
own venerable cairo_surface_write_ton_png().
2008-11-05 19:27:49 +00:00
Chris Wilson
564d64a132 [png] Complete the idempotent read_png() -> write_png()
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.
2008-11-05 18:47:34 +00:00
Chris Wilson
ec559822cf [trace] Use the mime-type image representation
When emitting image data, first check to see if we have a pre-compressed
alternate representation.
2008-11-05 18:13:10 +00:00
Chris Wilson
d63267e4e7 [test] Update mime-data to check image/png
Add a "image/png" mime-type test.
2008-11-05 18:13:10 +00:00
Chris Wilson
e4ec5c762f [svg] Embed original PNG data.
Embed the attached PNG representation of a surface in preference to
re-encoding the surface.
2008-11-05 18:13:10 +00:00
Chris Wilson
e40d62a0fe [png] Attach the png representation to cairo_surface_create_from_png().
Attach the original png data as an alternate representation for image
surfaces created by cairo_surface_create_from_png().
2008-11-05 18:13:09 +00:00
Chris Wilson
89616dee8f [surface] Don't allocate a structure for mime_data == NULL.
If the user attempts to clear the attached mime data representation, just
clear the user data slot and do not allocate an empty structure.
2008-11-05 18:13:09 +00:00
Behdad Esfahbod
43cfaec39c Define RepeatNone, etc if the available Render version doesn't (#18385) 2008-11-05 11:50:20 -05:00
Chris Wilson
199c0e7113 [svg] Embed jpeg data.
Support jpeg embedding for svg output.
2008-11-05 15:13:02 +00:00
Chris Wilson
2261590875 [trace] Trim a few bytes from glyph arrays
Remove some redundant whitespace from the glyph arrays to improve
readability and shrink the output file size.
2008-11-05 15:13:02 +00:00
Adrian Johnson
248dd97075 win32-printing: Implement JPEG support 2008-11-06 00:21:35 +10:30
Chris Wilson
29621bd399 [matrix] Remove stray offset from previous commit.
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.
2008-11-05 12:16:47 +00:00
Chris Wilson
e811173311 [matrix] Compensate pixman_matrix in device space.
We wish to reduce the visible error when converting to a pixman matrix, so
perform the compensation in device space instead of pattern space.
2008-11-05 11:16:08 +00:00
Chris Wilson
c95eebc923 [pattern] Split the translation between the matrix and [xy]_offset
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.
2008-11-05 10:00:13 +00:00
Chris Wilson
d1b8186fd7 [trace] Correct emission of set_font_face and set_source
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.
2008-11-05 08:36:09 +00:00