Commit graph

7374 commits

Author SHA1 Message Date
Chris Wilson
5dd29d7e2d [directfb] Conditionally use DSPF_BGR555
Appears that this token is more recent than some of my headers, so check
for its presence before use.
2009-08-06 10:10:06 +01:00
Chris Wilson
1d2abe7d10 [gl] Refresh clip-operator ref.
A minor renderering difference, acceptable.
2009-07-31 19:38:23 +01:00
Chris Wilson
640a0be2e2 Merge branch 'gl-glyph-cache'
Comparing the glyph-cache on an i915:

   gnome-terminal-20090728:  1.51x speedup
          firefox-20090601:  No change
2009-07-31 19:34:59 +01:00
Chris Wilson
5c2239be4b [gl] Use scissors rather than allocating a temporary depth buffer. 2009-07-31 17:55:40 +01:00
Chris Wilson
067de9cf62 [test] Add clip-fill.
Test filling through a complex clip.
2009-07-31 17:52:29 +01:00
Chris Wilson
7db1fb6fa9 [test] Add clip-text
Test applying a complex clip to text.
2009-07-31 17:32:09 +01:00
Chris Wilson
728d3f6383 Revert "[gl] Fixup unbounded regions after spans"
This reverts commit f7121ca888.
2009-07-31 16:24:37 +01:00
Chris Wilson
74bdea1249 [spans] Emit empty rows.
A problem that does not present itself whilst using spans to intermediate
masks is that the tor-span-convertor did not emit the empty rows. When
compositing directly using spans with an unbounded operator this was
causing rendering artefacts, for overlapping-glyphs and the gl backend.
2009-07-31 16:20:54 +01:00
Chris Wilson
1e4b9ab04b [gl] Return status from _render_glyphs() 2009-07-31 15:28:14 +01:00
Chris Wilson
097484da6f [boilerplate] Conditionally tweak the xlib surface
Prior to introduction of the buggy members to the surface, we obviously
cannot set them. However, the boilerplate code is meant to compile against
older revisions of the library so we need to check for the existence prior
to use.
2009-07-31 14:48:32 +01:00
Chris Wilson
397538a251 [boilerplate] Update fallbacks after disabling RENDER
The xlib surface caches flags based on RENDER version, so after disabling
render to force fallbacks, we need to ensure that the flags are reset.
2009-07-31 14:33:11 +01:00
Chris Wilson
786d1f962a [xlib] Use server-side gradients.
We can offload creation of gradients to server that support RENDER 0.10
and later. This greatly reduces the amount of traffic we need to send over
our display connection as the gradient patterns are much smaller than the
full image. Even if the server fallbacks to using pixman, performance
should be improved by the reduced transport overhead. Furthermore this is a
requisite to enable hardware accelerated gradients with the xlib backend.

Running cairo-perf-trace on tiny, Celeron/i915:

  before: firefox-20090601 211.585
   after: firefox-20090601 270.939

and on tiger, CoreDuo/nvidia:

  before: firefox-20090601 70.143
   after: firefox-20090601 87.326

where linear gradients are used extensively throughout the GTK+ theme.
Not quite the result I was expecting!

In particular, looking at tiny:

 xlib-rgba paint-with-alpha_linear-rgba_over-512   47.11 (47.16 0.05%) -> 123.42 (123.72 0.13%):  2.62x slowdown
█▋
 xlib-rgba paint-with-alpha_linear3-rgba_over-512   47.27 (47.32 0.04%) -> 123.78 (124.04 0.13%):  2.62x slowdown
█▋
 xlib-rgba paint-with-alpha_linear-rgb_over-512   47.19 (47.21 0.02%) -> 123.37 (123.70 0.13%):  2.61x slowdown
█▋
 xlib-rgba paint-with-alpha_linear3-rgb_over-512   47.30 (47.31 0.04%) -> 123.52 (123.62 0.09%):  2.61x slowdown
█▋
 xlib-rgba     paint_linear3-rgb_over-512   47.29 (47.32 0.05%) -> 118.95 (119.60 0.29%):  2.52x slowdown
█▌
 xlib-rgba     paint_linear-rgba_over-512   47.14 (47.17 0.06%) -> 116.76 (117.06 0.16%):  2.48x slowdown
█▌
 xlib-rgba    paint_linear3-rgba_over-512   47.32 (47.34 0.04%) -> 116.85 (116.98 0.05%):  2.47x slowdown
█▌
 xlib-rgba      paint_linear-rgb_over-512   47.15 (47.19 0.03%) -> 114.08 (114.55 0.20%):  2.42x slowdown
█▍
 xlib-rgba paint-with-alpha_radial-rgb_over-512  117.25 (119.43 1.21%) -> 194.36 (194.73 0.09%):  1.66x slowdown
▋
 xlib-rgba paint-with-alpha_radial-rgba_over-512  117.22 (117.26 0.02%) -> 193.81 (194.17 0.11%):  1.65x slowdown
▋
 xlib-rgba     paint_radial-rgba_over-512  117.23 (117.26 0.02%) -> 186.35 (186.41 0.03%):  1.59x slowdown
▋
 xlib-rgba      paint_radial-rgb_over-512  117.23 (117.27 0.02%) -> 184.14 (184.62 1.51%):  1.57x slowdown
▋

Before 1.10, we may choose to disable server-side gradients for the
current crop of Xorg servers, similar to the extended repeat modes.

[Updated by Chris Wilson. All bugs are his.]
2009-07-31 14:33:01 +01:00
Chris Wilson
53cbbad8fb [xlib] Disable extended repeat modes if RENDER < 0.10
The extended repeat modes were only introduced in RENDER 0.10, so disable
them if the server reports an earlier version. This is in addition to
disabling the repeat modes if we know (guess!) the server to have a buggy
implementation.
2009-07-31 13:17:23 +01:00
Chris Wilson
e283e53563 [perf] Print min_ticks in report
As the change and ranking is based on the min_ticks, and as this can
sometimes deviate wildly from median_ticks, include min_ticks in the
output.

In particular it helps to explain cases like:

xlib-rgba rectangles_similar-rgba-mag_source-512    10.13 88.41% ->   5.77 0.19%:  1.50x slowdown

which becomes

xlib-rgba rectangles_similar-rgba-mag_source-512    3.83 (10.13 88.41%) ->   5.75 (5.77 0.19%):  1.50x slowdown

(Considering the poor standard deviation on the initial measurement, this
is more likely a sampling error than a true regression.)
2009-07-31 10:51:30 +01:00
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