Commit graph

2793 commits

Author SHA1 Message Date
Carl Worth
fdbb820ece test: Use round to pass only integers to cairo_show_glyphs (in 3 more tests)
This is the same fix as in the recent commit (166dffc96a)
but for the same idiom that appears in the operator-clear,
operator-source, and unbounded-operator tests. This fixes
the failures that were introduced by the recent switch to
_cairo_lround.
2006-11-22 16:43:45 -08:00
Dan Amelang
11d21dbaa3 Change _cairo_matrix_to_pixman_matrix to use a pixman_transform_t as the template, thus avoiding a forced memcpy 2006-11-22 16:25:54 -08:00
Dan Amelang
8a5e296239 Optimize _cairo_matrix_to_pixman_matrix for the common case of an identity matrix 2006-11-22 16:25:54 -08:00
Dan Amelang
b7cd46ddc2 Add and incorporate _cairo_gstate_transform_glyphs_to_backend
After changing _cairo_gstate_show_glyphs and _cairo_gstate_glyph_path to use
this function, we see a significant speedup due to the elimination of redundant
FP calculations.
2006-11-22 16:25:54 -08:00
Dan Amelang
6cfb4a01e0 Refactor _cairo_matrix_is_integer_translation
Now that we have _cairo_matrix_is_translation, we can change
_cairo_matrix_is_integer_translation to use it and thus reduce code
duplication.
2006-11-22 16:25:54 -08:00
Dan Amelang
ca79307bdf Add _cairo_matrix_is_translation 2006-11-22 16:25:54 -08:00
Daniel Amelang
57fba8d9b6 Replace existing rounding code with _cairo_lround 2006-11-22 16:25:53 -08:00
Daniel Amelang
efb483c3a3 Add _cairo_lround for much faster rounding
This function uses the same "magic number" approach as _cairo_fixed_from_double.
2006-11-22 16:25:53 -08:00
Carl Worth
166dffc96a test/clip-operator: Use round to pass only integers to cairo_show_glyphs
We were previously passing half-integer values here, which will
not be robust to changes in the rounding mode used for
cairo_show_glyphs. Use round() to match the rounding expected
by the reference images.
2006-11-22 16:25:53 -08:00
Behdad Esfahbod
eaaeba170d [SVG] Fix compiler warning
cairo-svg-surface.c:980: warning: 'id' might be used uninitialized in this function
2006-11-21 19:05:16 -05:00
Behdad Esfahbod
c6fceb6721 [PS] Rename n_glyphs to num_glyphs_unsigned
Follow-up on my previous commit.  Use a more descriptive name to avoid
confusion between n_glyphs and num_glyphs.
2006-11-21 17:52:58 -05:00
Behdad Esfahbod
75eeb88976 [PS] Eliminate compiler warnings about unoptimizable loops
An innocient-looking loop like this:

  for (j = 0; j <= last; j++)
    something();

cannot be optimized, because it may loop forever!
Imagine the case that last is MAXINT, the loop will never end.  The correct
way to write it is:

  for (j = 0; j < last+1; j++)
    something();

In this case, if last is MAXINT, the loop will never run.  Not correct, but
better than looping forever.

Still better would be to correctly handle the MAXINT case (even though it
doesn't make any sense to show MAXINT number of glyphs in one operation!)  To
do that, we can use the fact that the input num_glyphs is a signed.  If
there is one good thing about using signed int as input length, it's that you
can use an unsigned looping variable to avoid looping forever.  That is
exactly what this patch does.
2006-11-21 12:11:19 -05:00
Emmanuel Pacaud
2dbb3dfd5f SVG: plug a memory leak
What's the point in creating a memory stream if we overload the
pointer a couple of lines below ?
2006-11-21 14:43:43 +01:00
Behdad Esfahbod
12f8718a3e [SVG] Define enum _cairo_svg_version. 2006-11-21 00:22:19 -05:00
Vladimir Vukicevic
9cffc56228 [test] add big-trap test
This test fills a single path (a trapezoid, even) that's larger than the
16.16 precision used in pixman and other code.  It leads to memory
scribbling and a crash.  Note that there is no crash if a clip is not set.
2006-11-20 15:30:04 -08:00
Carl Worth
a91c1e3ea6 Require librsvg 2.15.0 (was 2.14.0) for testing of SVG backend.
Bryce Harrington saw off-by-one errors in output image size with
a 2.14.x version of librsvg.
2006-11-20 14:01:50 -08:00
Carl Worth
e5bd21136c Add const qualifier to cairo_path_t* parameter of cairo_append_path 2006-11-20 09:36:10 -08:00
Emmanuel Pacaud
10920c1326 Merge branch 'svgprint' 2006-11-18 12:59:12 +01:00
Carl Worth
1ed3811338 perf: Add box_outline test case.
This test shows that drawing a 100x100 single-pixel wide box outline is
currently 5 to 16 times slower when using the natural cairo_stroke() as
compared to a rather awkward cairo_fill() of two rectangles.

[ # ]  backend-content                    test-size min(ticks)  min(ms) median(ms) stddev. iterations
[  0]    image-rgba         box-outline-stroke-100     301321    0.218    0.219  0.39%   5
[  1]    image-rgba           box-outline-fill-100      18178    0.013    0.013  0.43%   5
[  0]     xlib-rgba         box-outline-stroke-100     379177    0.275    0.276  1.39%   6
[  1]     xlib-rgba           box-outline-fill-100      83355    0.060    0.060  0.17%   5
2006-11-17 18:00:36 -08:00
Carl Worth
a8faa0aef1 cairo-perf: When iteration count is given on command-line, never execute fewer 2006-11-17 17:48:39 -08:00
Carl Worth
a97b697d8f ROADMAP: Set cairo 1.4 to early January for sake of Gnome 2.18 2006-11-16 10:38:53 -08:00
Carl Worth
db603d6647 Increment cairo version to 1.3.3 after 1.3.2 snapshot 2006-11-15 15:33:52 -08:00
Carl Worth
804e20b55d Update cairo version and libtool version for 1.3.2 snapshot 2006-11-15 13:32:15 -08:00
Carl Worth
c63fd9437b NEWS: Add notes for 1.3.2 snapshot 2006-11-15 13:30:16 -08:00
Behdad Esfahbod
a2d625edc6 Add notes for the 1.2.6 release. 2006-11-14 16:08:58 -08:00
Carl Worth
eeb1fa42aa Add missing pattern-getters-ref.png to Makefile to avoid breaking distcheck target 2006-11-14 15:13:58 -08:00
Carl Worth
28a9f1dd14 Fix get-clip test for surfaces not implementing set_clip_region 2006-11-14 15:13:58 -08:00
Carl Worth
7b86cf513e Remove non-existent reference images from Makefile to avoid breaking distcheck target 2006-11-14 15:13:58 -08:00
Carl Worth
0f7381b26e cairo-perf-diff: Run git-ls-tree from the correct directory
Before this change, cairo-perf-diff would work correctly only
if run from the top-level directory, (and if run from any other
directory it would not pull in the latest boilerplate and perf
files).
2006-11-14 15:13:58 -08:00
Behdad Esfahbod
f3f6ea3092 Fix typo. 2006-11-14 17:58:09 -05:00
Carl Worth
29b01f93ca Make miter join code use tessellate_convex_quad rather than tessellate_polygon
This provides an additional 22-29% speedup on top of the previous
fix for stroking paths with many miter joins:

image-rgba  world_map-800  459.73 0.27% -> 356.80 0.32%:  1.29x speedup
▎
image-rgb   world_map-800  458.83 0.37% -> 358.08 0.41%:  1.28x speedup
▎
 xlib-rgba  world_map-800  566.57 0.23% -> 463.84 0.31%:  1.22x speedup
▎
 xlib-rgb   world_map-800  562.31 0.64% -> 460.51 0.83%:  1.22x speedup
▎
2006-11-13 16:50:30 -08:00
Carl Worth
3d53f623fa Make _cairo_stroker_add_sub_edge use tessellate_convex_quad rather than tessellate_polygon
This gives a 17-20% speedup for stroking polygons with many
straight line segments as seen in the world_map test case:

Speedups
========
image-rgba  world_map-800  555.41 0.17% -> 460.69 0.20%:  1.21x speedup
▎
image-rgb   world_map-800  554.91 0.25% -> 460.73 0.26%:  1.20x speedup
▎
 xlib-rgb   world_map-800  669.85 3.70% -> 570.31 0.24%:  1.17x speedup
▏
 xlib-rgba  world_map-800  663.71 0.46% -> 567.74 0.19%:  1.17x speedup
▏
2006-11-13 16:50:00 -08:00
Carl Worth
fefa7d9b99 Rewrite tessellate_rectangle as tessellate_convex_quad to make it more useful
Currently there aren't even any users of this code, (they had
stopped using it when they realized what they really wanted
was tessellate_convex_quad).
2006-11-13 15:57:50 -08:00
Carl Worth
e324bbcbc6 Add a status field to cairo_traps_t to enable less error checking 2006-11-13 14:44:21 -08:00
Carl Worth
74f5fe241e cairo-perf-diff: rsync only git-managed files from boilerplate/perf
Previously, we were using rsync to recursively copy all files
from boilerplate and perf when doing the performance tests. This
had the fatal flaw that pre-built binaries would be hard coded to
link against the cairo library from $CAIRO_DIR with an absolute
path, (due to libtool rpath stuff).

By only copying git-managed files, we only get source and the compiled
binaries (or libtool wrappers) will now be hard-coded to link against
the library under test.
2006-11-13 14:44:07 -08:00
Emmanuel Pacaud
2928f6eb5f test/pixman-rotate.c: Don't issue a show_page, it's already done in cairo-test.c 2006-11-12 20:49:34 +01:00
Emmanuel Pacaud
4f02395267 Use SVG multipage capability. 2006-11-12 20:45:50 +01:00
Emmanuel Pacaud
ad6d3a8369 Add SVGPrint support.
It's only activated when svg version >= 1.2.
Last page without a show page call is ignored if blank.
2006-11-12 20:45:10 +01:00
Carl Worth
26b74049e7 cairo-perf-diff: Use rsync instead of cp to avoid some unnecessary rebuilding 2006-11-10 11:26:01 -08:00
Carl Worth
f1f189b81a cairo-perf-diff: Separate old and new build directories
With the fancy new, incremental cairo-perf-diff we don't want to keep
resetting the same working tree back and forth between the old and new
versions and rebuilding everything all over again. So use two different
build directories instead of one.

This fixes the rebuild of the library itself, but the perf stuff is still
being rebuilt, (since it's being re-copied each time).
2006-11-10 10:34:37 -08:00
Carl Worth
d9b697c46c cairo-perf-diff: Allow incremental refinement of performance results
cairo-perf-diff now accepts a -f command-line option to force it to
re-generate performance results even if something exists in the cache
already. It also now uses raw mode and appends to the cached file
rather than rewriting the results.

Finally, it also now allows a -- option on the command line and passes
all the subsequent command-line options to cairo-perf. This is handy for
limiting cairo-perf to run only on a subset of the tests of interest.
2006-11-10 10:34:35 -08:00
Carl Worth
439bf81e56 Fix broken size calculation for xrealloc
Another one of those "untested code == broken code" situations.
2006-11-10 10:00:31 -08:00
Carl Worth
f6b400a292 perf: Add world-map performance test case.
The map for this test case was originally demonstrated as a
performance problem in this mozilla bug report:

	A very slow SVG file with <path>s
	https://bugzilla.mozilla.org/show_bug.cgi?id=332413

I obtained permission from the creator of the original file to
include the data here, (see comments in world-map.h for details).
2006-11-08 06:07:01 -08:00
Carl Worth
2d927eaefa perf/Makefile.am: Add missing zrusin-another.h file to list 2006-11-08 06:07:01 -08:00
Carl Worth
0d1340f716 perf: Eliminate CAIRO_STATS_MIN_VALID_SAMPLES
We don't need this at this deep level since callers can now
implement this limiting manually since stats.iterations is
now returned. Also, this was interfering with the -i option
to cairo-perf anyway.
2006-11-08 06:07:01 -08:00
Carl Worth
6d5df0e3e2 cairo-perf-diff-files: Add support for diffing "raw" files from "cairo-perf -r" 2006-11-08 06:07:01 -08:00
Carl Worth
d1e1192090 cairo-perf: Print ticks_per_ms value in raw mode so raw analysis tools can report times 2006-11-08 06:07:01 -08:00
Carl Worth
5393989272 perf: Move statistics code into new cairo-stats.h for sharing 2006-11-08 06:07:01 -08:00
Carl Worth
7673e3ac3f boilerplate: Add xrealloc function 2006-11-08 06:07:01 -08:00
Vladimir Vukicevic
1e4515c548 [win32] implement EXTEND_REPEAT in composite when possible
Optimizes EXTEND_REPEAT, especially when DDBs are in use through the
use of PatBlt or manually expanding out the repeated blits (up to a
limit).  Will still fall back to fallback code as necessary.
2006-11-07 13:15:28 -08:00