Commit graph

6356 commits

Author SHA1 Message Date
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
Chris Wilson
4a4b10271a [trace] Capture foreign drawables.
If we attempt to use a surface as a source before we write to it, record
the surface contents.
2008-11-05 08:36:02 +00:00
Chris Wilson
432fe1ec27 [trace] Mark filter mode as immediate.
Be consistent and use "//" for the filter mode to indicate a constant.
2008-11-05 08:36:01 +00:00
Chris Wilson
68309481aa [test] Mark targets with is_meta?
Allow tests to skip targets based on whether they are a meta surface or
not.
2008-11-05 08:36:01 +00:00
Chris Wilson
8855f9583e [test] Add scale-offset-(similar|image)
Add a test case for the scaling bug reported by Michel Iwaniec:
http://lists.cairographics.org/archives/cairo/2008-November/015660.html
2008-11-05 08:01:27 +00:00
Chris Wilson
aad9809003 [test] Only depend on any2ppm if we build it.
Do not add a dependency to any2ppm if it has been deconfigured.
2008-11-05 08:01:27 +00:00
Chris Wilson
59bdeba9ab [matrix] Minimise pixman conversion error.
Minimise the error of the pixman matrix about the centre of the displayed
area rather than the origin.
2008-11-05 08:01:27 +00:00
Chris Wilson
068d465bb3 [trace] Fix emission of cairo_scaled_font_create()
In the case where the font face was no longer on the operand stack, the
font face would not have been passed to cairo_scaled_font_create().
2008-11-04 14:57:21 +00:00
Chris Wilson
a3d56c60e8 [trace] Use a common directory by default.
If called directly (e.g. via /etc/ld.so.preload) put the output trace into
a central directory, and not the pwd.
2008-11-04 14:22:08 +00:00
Chris Wilson
3f7a21c5c9 [test] Add jpeg.jpg to EXTRA_DIST
Forgot to add the new file to the distribution with the previous commit.
2008-11-04 13:46:10 +00:00
Chris Wilson
9900a2adf3 [test] Update mime-data jpeg reference data.
<adrianj> ickle_: If we are going to use a different image for jpeg in
mime-data maybe we could create a jpg that contains the text "jpeg". That
way when support for the other image formats is added the mime-data test
could have one image for each type with each image and it is easy to see
that each image is the correct one.
2008-11-04 13:41:02 +00:00
Chris Wilson
c13a09ddb4 [test] Use a different jpeg image for mime-data
Detect when we successfully encode the JPEG data from the mime-type by
using a completely image.
2008-11-04 13:03:24 +00:00
Chris Wilson
8407470409 [test] Adapt pdf-mime-data for non-srcdir build.
Need to look for reference/input images from srcdir as well.
2008-11-04 13:03:24 +00:00
Chris Wilson
8007618837 [test] Fix compilation of imagediff.
imagediff broke once again.
2008-11-04 13:03:24 +00:00
Chris Wilson
282d774427 [mime-type] Request the mime-data for the source surface, not ourselves!
Fixup a typo I introduced that caused us to request the jpeg data for the
destination surface and not the source.
2008-11-04 13:03:24 +00:00
Chris Wilson
aa616abc9a [png] Use RGB for opaque images.
If the ARGB32 is opaque, discard the alpha channel - so we should generate
byte identical output to the reference images.
2008-11-04 13:03:23 +00:00
Adrian Johnson
30976635d7 PS: Implement JPEG embedding 2008-11-04 22:54:25 +10:30
Adrian Johnson
73bc278c7a Add pdf mime data test
To test that images in PDF files correctly embedded the mime data.
2008-11-04 22:39:36 +10:30
Chris Wilson
3f18d38fbd [win32] Compile fix for extend-pad extents.
Update the show_glyphs() prototype to include the extents argument.
2008-11-04 10:43:07 +00:00
Chris Wilson
5ba95b7e12 [trace] Convert [1 0 0 1 0 0] to identity
Simplify the trace/replay by replacing the identity array with the
identity operator.
2008-11-04 10:43:02 +00:00
Chris Wilson
3664b32195 [trace] Remove more @..@ from Makefile.am
Use $(..) for make variable substitution as opposed to incorrectly using
@..@ for substitution by configure.
2008-11-04 10:42:49 +00:00
Behdad Esfahbod
310026ab42 [aclocal.dolt.m4] Fix build with bash versions <= 3.0 (bug #18363) 2008-11-04 01:51:06 -05:00
Chris Wilson
9021755012 [mime-data] Copy a reference to the mime-data on snapshotting.
Instead of doing a full-copy of the mime data (which can be 10K-100K,
or even larger) just copy a reference to the original mime to the
snapshot surface (as suggested by Behdad).
2008-11-03 23:45:12 +00:00