Commit graph

1900 commits

Author SHA1 Message Date
Benjamin Otte
2ce1afa322 test-suite: add image_diff_is_failure() function
This cleans the code and fixes a boolean logic error where this check
was done manually.
2010-04-28 13:15:09 +02:00
Chris Wilson
80fc2a8e49 test: Expand xlib-expose-event to cover all backends
Use a similar surface to create an equivalent backing surface for
any backend, thus enabling the test to run against any target.

The comment about forcing fallbacks has long since been false.
2010-04-28 09:50:49 +01:00
Chris Wilson
d3c4349730 test: Mark surfaces as finished if the data goes out of scope.
The issue being that as the on-stack data is being referenced via a
zero-copy snapshot outside of the functions scope as the surface is only
finished and the source written long after the draw() returns. The
correct procedure is that the user must call cairo_surface_finish()
prior to any surface becoming inaccessible. In this case, this triggers
the snapshot to preserve a copy of the data whilst it is still valid.
2010-04-28 08:39:21 +01:00
Chris Wilson
453b1cba11 test: Update image ref images, and used fonts in README 2010-04-27 16:47:31 +01:00
Chris Wilson
70656bba81 test: Add image16 refs 2010-04-27 14:19:22 +01:00
Andrea Canciani
b8a7f8621a Update FSF address
I updated the Free Software Foundation address using the following script.

for i in $(git grep Temple | cut -d: -f1 )
do
  sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-04-27 11:13:38 +02:00
Benjamin Otte
9672aab6b7 tests: Integrate xlib-expose-event test into usual tests
Previously the test was using the preamble vfunc and generating output
itself. Now it uses the draw function and ignores any but the xlib
backends.
2010-04-26 21:42:47 +02:00
Chris Wilson
241ce933f8 test: Add clip-shape
cu found a bug when using clipping and fills with the image backend, but
it turns out to be the lost sign bug afflicting everything...

To trigger the bug requires evaluating the clip surface prior to using
in with _cairo_clip_combine_with_surface(). Which is taken along a
particular path when using a clip mask with non-pixel geometry on image,
but more easily hit by the fallback code.

Reported-by: <cairouser@yahoo.com>
2010-04-25 09:45:41 +01:00
Chris Wilson
567e485f28 test: Add clip-empty-group
Exercise a bug reported by Jeff Muizelaar whereby cairo_push_group() was
broken by everything being clipped out.
2010-04-23 14:47:51 +01:00
Benjamin Otte
5fed41ee2b test: Add test checking that all setters properly check surface->status
In particular, make sure that the setters when called on a const nil
surface don't try to set surface->status.
2010-04-14 22:45:18 +02:00
Chris Wilson
557016a86a test: Add clip-contexts
This should exercise a bug found by Jeff Muizelaar that
cairo-surface-clipper was mistakenly thinking that clip operations on a
second context was a no-op as the topmost clip path matched that of the
previous context.
2010-04-10 16:03:14 +01:00
Chris Wilson
697094488c test: Add inverse text
This is exercising a bug that I have introduced either in the xcb
backend or in the driver in my experimental branches. So simple, yet so
wrong.
2010-04-02 08:51:03 +01:00
Andrea Canciani
01e1821942 test: Add gradient-zero-stops-mask
Add a test to check that gradient with no stops are not considered
opaque by gstate (and thus masking with them is not optimized to
paint).
2010-03-31 12:14:25 +02:00
Chris Wilson
25a77b263d boilerplate: Cleanup the list of backends upon shutdown. 2010-03-23 16:49:21 +00:00
Chris Wilson
181403fb53 test/clear-source: Free source after use. 2010-03-23 09:38:59 +00:00
Chris Wilson
1d4ad78774 test/pthread-same-source: Free source after use. 2010-03-23 08:20:49 +00:00
Chris Wilson
bfc027ac6d test/clip-image: Free image after use. 2010-03-23 08:16:57 +00:00
Chris Wilson
a7cb314b06 test/any2ppm: Check for errors after executing script. 2010-03-21 20:40:54 +00:00
Chris Wilson
473e006ad6 test: Add a1-mask-sample
Test sampling positions with a NEAREST mask.
2010-03-06 18:12:36 +00:00
Chris Wilson
70412bba0e test: Avoid derefencing a NULL xcb connection 2010-03-03 23:57:35 +00:00
Chris Wilson
5bfea8447b test: Add references for rounded-rectangle-{fill,stroke} 2010-03-03 23:57:35 +00:00
Chris Wilson
d91bab565c test: Remove the double-clip from clip-group-shapes
A push/pop is an implicit save/restore, so a clip applied inside the
group is temporary, whereas a clip applied outside affects both the
geometry inside *and* the application of the group when painted. So
reset the clip afterwards to get the desired behaviour.
2010-03-02 08:12:52 +00:00
M Joonas Pihlaja
5b7f4bb241 api: Introduce CAIRO_FORMAT_INVALID formally in the API.
We were exposing the actual value of CAIRO_FORMAT_INVALID
through API functions already, so it makes sense to just
go ahead and put it in the cairo_format_t enum.
2010-03-01 01:21:31 +02:00
M Joonas Pihlaja
260d7f8ace test: Test downscaling and extending a surface pattern.
Franz Schmid reported a regression in 1.9.6 when downscaling
and using EXTEND_REPEAT for an image surface pattern.  This
patch adds such tests for every extend mode.
2010-02-27 17:41:28 +02:00
M Joonas Pihlaja
ebadc2ed08 test: Add tests covering more clip fast paths in groups.
The clip-group-shapes-* tests check that it doesn't
matter whether the clip path is set before or after
pushing a group using specific types of clip paths
(aligned/unaligned rectangles and general paths.)
2010-02-27 03:28:59 +02:00
M Joonas Pihlaja
dcf897967d test: Fix a wrongly typed return value in scaled-font-zero-matrix.
The test was returning a cairo_status_t, but should be returning
a cairo_test_status_t instead.  When the test failed it was
being reported as having crashed, rather than merely failed,
because the enum value of CAIRO_TEST_CRASHED happened to be
same as the cairo_status_t value of the cairo context at
the end of the failing test.
2010-02-25 14:20:27 +02:00
Benjamin Otte
1897156d96 test: Add bug-bo-rectangular
Exercises a bug found in the special case rectangular tessellator with
colinear eo edges.
2010-02-23 08:54:39 +00:00
Carl Worth
cb090136b2 Update REFERENCE_IMAGES list for "make distcheck".
As usual, "make distcheck" does not work until we update this list.
2010-02-19 17:30:09 -08:00
Eric Anholt
9057c4b6be test: Add an option to explicitly specify a test name to the runner. 2010-02-17 12:56:58 -08:00
Chris Wilson
51047483f4 test: Add clip-twice-rectangle
Jeff Muizeelar found another bug with clipping whereby the clip was
been incorrectly discarded.
2010-02-12 12:24:01 +00:00
Chris Wilson
a4793d1331 test: Add linear-gradient-subset
It was observed that we never actually test the condition that the
gradient is only defined for a portion of its range, i.e. the starting
offset is >0 and the ending offset is <0. By definition the colour
between 0 and start offset is the start color, so check that this
behaviour is followed by all backends.
2010-02-07 19:27:32 +00:00
Chris Wilson
2a59220aa4 test: Add linear-step-function
Another bug identified by Jeff Muizelaar was that the bounds for a
zero-length (i.e. it started and stopped at the same point) were
miscomputed. This test case exercises that bug.

Note: I believe the output is wrong here when padding a zero-length
gradient. On the left it should be red, and on the right it should be
blue.
2010-02-02 16:31:36 +00:00
Chris Wilson
7dc464bb2b test: Add clip-empty-save
Jeff Muizelaar found a bug in _cairo_clip_init_copy() which was not
correctly propagating the all-clipped status when an empty clip was
saved in the gstate. This test case exercises that bug.
2010-02-02 16:31:36 +00:00
Benjamin Otte
58980b4ad6 build: Remove glitz surface
glitz is unmaintained and the GL surface is far superior anyway.
2010-01-27 09:56:14 +01:00
Chris Wilson
c453d8ab70 test: Erroneous ref image for big-line xlib-fallback. 2010-01-25 11:56:29 +00:00
Chris Wilson
1236c41072 xcb: Refresh.
Still an experimental backend, it's now a little too late to stabilise
for 1.10, but this should represent a major step forward in its feature
set and an attempt to catch up with all the bug fixes that have been
performed on xlib. Notably not tested yet (and expected to be broken)
are mixed-endian connections and low bitdepth servers (the dithering
support has not been copied over for instance). However, it seems robust
enough for daily use...

Of particular note in this update is that the xcb surface is now capable
of subverting the xlib surface through the ./configure --enable-xlib-xcb
option. This replaces the xlib surface with a proxy that forwards all
operations to an equivalent xcb surface whilst preserving the cairo-xlib
API that is required for compatibility with the existing applications,
for instance GTK+ and Mozilla. Also you can experiment with enabling a
DRM bypass, though you need to be extremely foolhardy to do so.
2010-01-22 23:01:52 +00:00
Chris Wilson
b9407af6a4 image: Implement high level interface.
Write a dedicated compositor for pixman so that we avoid the
middle-layer syndrome of surface-fallback. The major upshot of this
rewrite is that the image surface is now several times quicker for glyph
compositing, which dramatically improves performance for text rendering
by firefox and friends. It also uses a couple of the new scan
convertors, such as the rectangular scan converter for rectilinear
paths.

Speedups
========
image-rgba          firefox-talos-gfx-0    342050.17 (342155.88 0.02%) -> 69412.44 (69702.90 0.21%):  4.93x speedup
███▉
image-rgba                        vim-0    97518.13 (97696.23 1.21%) -> 30712.63 (31238.65 0.85%):  3.18x speedup
██▏
image-rgba                  evolution-0    69927.77 (110261.08 19.84%) -> 24430.05 (25368.85 1.89%):  2.86x speedup
█▉
image-rgba                    poppler-0    41452.61 (41547.03 2.51%) -> 21195.52 (21656.85 1.08%):  1.96x speedup
█
image-rgba       firefox-planet-gnome-0    217512.61 (217636.80 0.06%) -> 123341.02 (123641.94 0.12%):  1.76x speedup
▊
image-rgba             swfdec-youtube-0    41302.71 (41373.60 0.11%) -> 31343.93 (31488.87 0.23%):  1.32x speedup
▍
image-rgba         swfdec-giant-steps-0    20699.54 (20739.52 0.10%) -> 17360.19 (17375.51 0.04%):  1.19x speedup
▎
image-rgba                       gvim-0    167837.47 (168027.68 0.51%) -> 151105.94 (151635.85 0.18%):  1.11x speedup
▏
image-rgba          firefox-talos-svg-0    375273.43 (388250.94 1.60%) -> 356846.09 (370370.08 1.86%):  1.05x speedup
2010-01-22 23:01:52 +00:00
Chris Wilson
005b0c4eb2 test: Add explicit device management to xlib-surface-source
Mostly pedagogical example.
2010-01-22 23:01:51 +00:00
Chris Wilson
ca02b51ef6 test: Add an xcb surface source test 2010-01-22 23:01:51 +00:00
Chris Wilson
f0678fb70c test: Tweak aligned of text-rotate
Reset the rotation for every quadrant so that the starting rectangles
are pixel-aligned.
2010-01-22 23:01:51 +00:00
Chris Wilson
2edd2adafc test: Exercise scan converters with large rounded rectangles.
Having added a specialised scan converter on the premise that it should
be better at handling rounded rectangles, ensure that they are indeed
rendered correctly.
2010-01-22 23:01:51 +00:00
Chris Wilson
5187501e99 test: Add --track-origins=yes to valgrind flags.
Enable origin tracking by default for make check-valgrind. This is
slower and consumes more memory than regular valgrind, but the
additional information provided about the source of the uninitialised
data is often invaluable.
2010-01-22 23:01:51 +00:00
Chris Wilson
49ab86772a script: Port cairo_script_context_t to cairo_device_t
Use the unifying cairo_device_t for cairo_script_context_t and replace.
2010-01-22 23:01:50 +00:00
Chris Wilson
dc8290814c Add subsurface.
A subsurface is a region of another surface that may be used either to
restrict the writable area of a context or the readable extents of a
source. Whilst writing, access to the exterior of the subsurface is
prevented via clipping and when used as a source reads from the exterior
of the subsurface are governed via the extend mechanism of the pattern.
2010-01-22 23:01:50 +00:00
Benjamin Otte
3e17c559b0 [test] Add pthread-same-source test
Multiple threads render using the same source surface, but with
different extend and filter.
2010-01-22 23:01:49 +00:00
Benjamin Otte
30a12f802f [test] Add a simple multithreading test 2010-01-22 23:01:49 +00:00
Benjamin Otte
038829eb84 [test] Add new test checking is_clear is handled properly
This test does various operations with a clear source surface with
various content types.
The idea is to make sure optimizations done when surface->is_clear ==
TRUE only happen in the proper cases.
2010-01-22 23:01:49 +00:00
Chris Wilson
411c09eed7 perf: Enable a surface cache for perf-trace
Real applications that control their Drawable externally to Cairo are
'disadvantaged' by cairo-perf-trace when it creates a similar surface
for each new instance of the same Drawable. The difficulty in
maintaining one perf surface for every application surface is that the
traces do not track lifetimes for the application surfaces, so we would
just accumulate stale surfaces. The surface cache takes a different
approach and returns the same surface for each active Drawable, and
maintains a hold-over of the MRU 16 surfaces. This achieves 60-80% hit
rate with firefox, which is probably as good as can be expected.
Obviously for double-buffered applications we only every draw to freshly
created surfaces (and Gtk+ bypasses cairo to do the final copy -- the
ideal application would just use a push-group for double buffering, in
which case we would capture and replay the entire expose event).

To enable use of the surface cache whilst replaying use -c:

  ./cairo-perf-trace -c firefox-talos-gfx
2010-01-22 23:01:46 +00:00
Chris Wilson
f40560a9bb test: Add linear-uniform
Jeff reported a regression found by Mozilla whereby a uniform gradient
was not being premultiplied on conversion to a solid pattern.

  https://bugzilla.mozilla.org/show_bug.cgi?id=539165
  [Bug 539165] gradients with a single stop do not have their color
               multiplied by the alpha.
2010-01-15 12:25:53 +00:00
Chris Wilson
e22c02dbae test: Add degenerate-arcs
A simple test to ensure that using degenerate-arcs such as when drawing
a rounded rectangle with radii=0 construct a proper path.
2010-01-15 12:25:53 +00:00