Commit graph

9110 commits

Author SHA1 Message Date
Chris Wilson
ce8a8424aa [perf] Change the order of slowdowns.
More the large slowdowns to the end. This has two pleasing effects:

  1. There is symmetry between large speedups at the top, and large
     slowdowns at the bottom, with long bars -> short bars -> long bars.

  2. After a cairo-perf-diff run the largest slowdowns are immediately
     visible on the console. What better way to flag performance
     regressions?
2009-07-31 09:43:12 +01:00
Chris Wilson
877ed645f9 [perf] Add a more complex fill, a set of rings
In investigating performance regressions with the wip/tessellator, I'm
keen to inspect how the tessellator scales with polygon complexity.
2009-07-31 09:43:12 +01:00
Chris Wilson
3dbc4170f0 [perf] Add a single shot long-lines
Compare the performance of self-intersection removal by comparing the cost
of individually stroking each line versus stroking them all en-mass.
2009-07-31 09:43:12 +01:00
Chris Wilson
2f033af5ab [perf] Fix the asymmetry in long lines
We missed the final long diagonal to the bottom-right.
2009-07-31 09:43:12 +01:00
Chris Wilson
944206e55b [perf] Correct typo in long-lines.c
Computed may_y using height not width, fortunately the test cases have
always been square.
2009-07-31 09:43:12 +01:00
Chris Wilson
229887e980 [perf] Check output
Add a CAIRO_PERF_OUTPUT environment variable to cause cairo-perf to first
generate an output image in order to manually check that the test is
functioning correctly. This needs to be automated, so that we have
absolute confidence that the performance tests are not broken - but isn't
that the role of the test suite? If we were ever to publish cairo-perf
results, I would want some means of verification that the test-suite had
first been passed.
2009-07-31 09:39:38 +01:00
Chris Wilson
8c6ecfe648 [perf] Remove the warning about failing to open a directory
The warning is repeated in the error message if we fail to find any
traces, and now that we search a path it is likely that some elements do
not exist. Thus we annoy the user with irrelevant, non-fatal warnings.

Still looking for suggestions for the most appropriate home for the system
wide cairo-traces dir...
2009-07-29 16:19:21 +01:00
Chris Wilson
8c1aed17ca [perf] Add another stroking micro-benchmark
The original stroke only contains a single subpath. Self-intersection
removal particularly affects strokes with multiple curved segments, so add
a path that encompasses both straight edges and rounded corners.
2009-07-29 16:17:12 +01:00
Chris Wilson
71f5649846 [path] Fix iter to handle circular list of buffers
When switching the path over to use the circularly linked list, 73f801,
I missed updating the path iterator.
2009-07-29 16:17:12 +01:00
Chris Wilson
acfcf4a31b [path] Remove the broken rel-curve-to as line-to
As pointed out by Andrea, and now tested by test/degenerate-rel-curve-to,
this attempt at removing degenerate curve-to was broken.
2009-07-29 16:17:11 +01:00
Chris Wilson
81d3e15e6c [test] Yet another bug in curve-to as line-to.
Andrea Canciani (ranma42) found another instance of my broken 'degenerate'
curve-to as line-to optimisation. All I can say is when I do something
wrong, at least I'm consistent!

This test case highlights the bug in the rel-curve-to path.
2009-07-29 16:17:11 +01:00
Chris Wilson
f7121ca888 [gl] Fixup unbounded regions after spans 2009-07-28 20:56:56 +01:00
Chris Wilson
5631f01075 [gl] Cache texture snapshots. 2009-07-28 20:56:50 +01:00
Chris Wilson
3b0bb2cfd2 [gl] Replace DrawPixels with TexSubImage 2009-07-28 20:56:48 +01:00
Chris Wilson
4b7a1a2da7 [gl] Disable the EXTEND_REFLECT convertor
As we can handle EXTEND_REFLECT via the samplers, we do not need to
convert such patterns to EXTEND_REPEAT during acquisition.
2009-07-28 20:56:48 +01:00
Chris Wilson
780a95b024 [gl] Trim glyphs to surface/clip extents. 2009-07-28 20:56:39 +01:00
Chris Wilson
b1227dea29 [gl] Render glyphs to an intermediate mask as opposed to falling back.
There are many common scenarios, mostly involving overlapping glyphs,
for which to guarantee correct rendering we have to composite the glyphs
via an explicit mask. That is instead of just blending the glyphs on to
the destination, we have to add the glyphs to a mask, and then composite
that mask+source with the destination.
2009-07-28 16:39:52 +01:00
Chris Wilson
cd259489e2 [gl] Fallback for overlapping glyphs. 2009-07-28 15:58:54 +01:00
Chris Wilson
3d8f1d3dc8 [gl] Only unlock the glyph cache when full. 2009-07-28 15:38:45 +01:00
Adrian Johnson
922b1fe8e3 Ensure Type 3 fonts do not use the name .notdef in the PS encoding 2009-07-28 22:34:42 +09:30
Chris Wilson
a251e34dbb [gl] Move check for vertex buffer support to individual operations.
As we can fallback instead of using vertex buffers, do so rather than
preventing any use of GL acceleration.
2009-07-28 13:46:36 +01:00
Chris Wilson
90657bacc3 [gl] Separate out supported operator check.
By performing the check on whether the operator is supported prior to
acquiring the context, we do not need to handle the error part way
through the context setup. This makes the code much cleaner, and save
some work for the unsupported cases.
2009-07-28 13:30:31 +01:00
Chris Wilson
21d50e2163 [gl] Unthaw font along contended path.
If we bail after freezing the font, make sure we thaw that it is thawed
before returning.
2009-07-28 13:30:26 +01:00
Adrian Johnson
5440055fc0 Ensure Type 3 fonts do not add a .notdef glyph 2009-07-28 21:34:28 +09:30
Adrian Johnson
1ae5a41951 PDF: Only Type 3 fonts should include glyph 0 in /ToUnicode
4c498098 made all 8-bit fonts include glyph 0 which incorrectly
included Type 1 fallback fonts.
2009-07-28 21:34:28 +09:30
Chris Wilson
c11f369057 [perf] Avoid NULL derefs on broken result files.
Instead of testing for a NULL return we checked that the pointer didn't
point to NIL. Oops.
2009-07-28 13:02:10 +01:00
Chris Wilson
19f4498234 [test] Wrap yet another call to get_image_surface() inside a timeout.
I missed this call to get_image_surface() that is now being hit having
restored the reference image for dash-infinite-loop.
2009-07-28 12:58:07 +01:00
Chris Wilson
e2f912dc5b [script] Add cvi, cvr, mod
Add implementations of convert-to-integer, convert-to-real and modulus
supplied by Zack Weinberg <zweinberg@mozilla.com>.
2009-07-28 09:32:36 +01:00
Chris Wilson
24b5ac6377 [test] Add timeouts around finishing and converting surfaces to images.
In order to catch infinite loops whilst replaying and converting vector
surfaces to images (via external renderers) we need to also install
alarms around the calls to finish() and get_image().
2009-07-28 08:41:50 +01:00
M Joonas Pihlaja
dacc380dd9 [test] Test extremely small dash lengths.
The stroker code is liable to wedge when passed
dash patterns which don't advance the dash offset
due to limited precision arithmetic.  This test
attempts to hit all the places in the stroker where
that can happen.

Reported on the cairo mailing list by Hans Breuer:

http://lists.cairographics.org/archives/cairo/2009-June/017506.html
2009-07-28 08:41:49 +01:00
Chris Wilson
128d6fb2da [path] Remove the erroneous conversion of a 'zero-length' curve-to
As pointed out by Andrea, and now tested by test/degenerate-curve-to, a
curve-to that begins and ends on the same point may extend further due to
its control points. It can not be simply replaced with a degenerate
line-to. In order to do so we will need more extensive degeneracy
checking, ala _cairo_spline_init().
2009-07-28 08:37:54 +01:00
Chris Wilson
660c389d11 [test] Add degenerate-curve-to
Andrea Canciani (ranma42) pointed out a second bug in the curve-to as
line-to optimisation, that is a curve starting and finishing on the same
point is not necessarily degenerate. This test case exercises 5 different
curves that start and end on the same point.
2009-07-28 08:37:03 +01:00
Carl Worth
d31de83e01 Mark curve-to-as-line-to as XFAIL for PS backend.
Looks like ghostscript has a similar buggy optimization like we
just fixed in cairo. I'm just waiting on a new bugzilla account
from bugs.ghostscript.com after which I plan to report the bug
there.
2009-07-27 15:58:27 -07:00
Carl Worth
45919a4f0c Revert "[path] Convert straight curve-to to line-to"
This reverts commit c72ca2f229.

This commit was broken as verified by the curve-to-as-line-to test
case.
2009-07-27 15:45:55 -07:00
Carl Worth
5bed405b27 Revert "[spline] Treat a straight spline as degenerate."
This reverts commit f3d265559a.

This commit was broken as verified by the curve-to-as-line-to test
case.
2009-07-27 15:45:15 -07:00
Carl Worth
01acad1659 Merge branch 'master' of git.cairographics.org:/git/cairo 2009-07-27 15:26:19 -07:00
Carl Worth
3cc9a6050d Add new test: curve-to-as-line-to
This test anticipates a future optimization, (already pushed
upstream but not pulled yet), with a buggy implementation
of replacing curve_to with line_to.
2009-07-27 15:24:55 -07:00
Chris Wilson
e19b2866ed [gl] Actually remove the glyph from the rtree on scaled_font_fini
Mark the node as available when the scaled_glyph is finished, and then
attempt to collapse the parent node.
2009-07-27 13:16:30 -07:00
Chris Wilson
e0b7979a30 [gl] Switch to using the common rtree implementation. 2009-07-27 13:16:23 -07:00
Eric Anholt
37bf06d66e [gl] Fix handling of clip for glyphs (clip-operator test). 2009-07-27 13:16:23 -07:00
Eric Anholt
74f3351319 [gl] Switch the glyph cache to using VBOs.
This is a major performance improvement for GL even on non-TNL hardware
(i915), as we get to emit one giant DrawArrays and make GL drivers love us.
Now we're actually faster than not having the glyph cache.

Before glyph cache (HP 945GM):
[  0]       gl             firefox-20090601  238.103  238.195   0.35%    5/6
After:
[  0]       gl             firefox-20090601   68.181   76.735   5.46%    6/6
2009-07-27 13:16:23 -07:00
Eric Anholt
ee4138e587 [gl] Start adding glyph cache support.
This is pretty much cut-and-paste from ickle's cairo-drm-i915-surface, and
uses fixed function and doesn't use VBOs.
2009-07-27 13:16:23 -07:00
Chris Wilson
cf15aed0c4 [xlib] Add a timely reminder to ensure that bugs are properly filed.
In a discussion on IRC, attention was drawn to a dubious comment in
_cairo_xlib_show_glyphs() - the precise details of which have passed
out of the collective memory.
2009-07-27 19:18:21 +01:00
Chris Wilson
2da01ed552 [rtree] Merge the common unpin_and_evict_unused() routine
Having written the same method to prune glyphs from the rtree three times,
I thought wise to add the common method to the core routines.
2009-07-27 18:23:11 +01:00
Chris Wilson
9f6a0f5668 [paginated] Propagate error return during finish.
In bed2701, I removed the explicit finish of the paginated's target
surface, since as a wrapper it did not explicitly own the surface and so
should not be calling finish(). However, we do need to propagate errors
from the backing surface, such as PDF, which will only be detected during
the implicit finish in the final destroy. So check to see it we hold the
last reference to the target (and so our destroy will trigger the implicit
finish) and call the finish explicitly and check the error status
afterwards.
2009-07-27 14:05:04 +01:00
Chris Wilson
6ca3720ba6 [test] Overlapping glyphs
Add a test case to explicitly check handling of overlapping glyphs.
2009-07-27 10:19:03 +01:00
Chris Wilson
09a2b2ed31 [xlib] Fast-path the likely case of retrieving a known xrender_format
If we know the CPU can read pointers atomically, then we can simply peek
into the cached_xrender_formats to see if we already have a match, before
taking the mutex. (Acquiring the mutex here is a minor nuisance that
appears on the callgrind profiles.)
2009-07-27 10:18:59 +01:00
Chris Wilson
efb3445ee1 Add a simple rectangle tree (rtree) implementation
In order to efficient store small images, we need to pack them into a
large texture. The rtree handles allocation of small rectangles out of a
much larger whole. As well as tracking free rectangles, it can also be
used to note which parts of the texture are 'pinned' -- that is have
operations currently pending and so can not be modified until that batch
of operations have been flushed. When the rtree is full, i.e. there is no
single free rectangle to accommodate the allocation request, it will
randomly evict an unpinned block large enough to fit the request. The
block may comprise just a single glyph, or a subtree of many glyphs. This
may not be the best strategy, but it is an effective start.
2009-07-27 10:18:26 +01:00
Chris Wilson
c72ca2f229 [path] Convert straight curve-to to line-to
Avoid the high cost associated with curves if we can convert the curve to
a straight line.
2009-07-27 10:18:25 +01:00
Chris Wilson
f3d265559a [spline] Treat a straight spline as degenerate.
The fallback for degenerate splines is to treat them as a line-to, so if
the spline is straight, we can just replace it with a simple line-to by
treating as degenerate.
2009-07-27 10:18:25 +01:00