Commit graph

1532 commits

Author SHA1 Message Date
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
Chris Wilson
4aae4bfa8f test: Fix typo in path-stroke-twice reference image
Sigh. I committed the reference image with the name
path-stroke-twice-ref.png.
2010-01-12 17:11:15 +00:00
Chris Wilson
a5dd5a6069 test: Add path-stroke-twice
Exercises a bug found by alois@astro.ch, whereby we inadvertently remove
a line segment when the path doubles back upon itself.

  Bug 26010 - cairo_line_to optimizes away path segments
  http://bugs.freedesktop.org/show_bug.cgi?id=26010
2010-01-12 17:07:28 +00:00
M Joonas Pihlaja
b76565d2f4 [test] Don't use uninitialised data in surface-source.c
The draw_pattern() function assumed the incoming surface
was clear, but it's not.  Explicitly clear the surface first.
2009-11-29 15:40:30 +02:00
M Joonas Pihlaja
b394240941 [test] Add missing mark_dirty() calls to test cases.
A recent optimisation has added a flag to the image
surface which is used to track whether the surface
is clear or not.  This makes it imperative that clients
call cairo_surface_mark_dirty() if they use cairo to
allocate their pixel buffers and then proceed to
initialize them without telling cairo about it.
2009-11-29 13:17:51 +02:00
Benjamin Otte
0d8a04ef47 test: Add cases to exercise clipping after no-ops
Whilst investigating:

  Bug 31788: SVG <line> with y1 == y2 and both with fractional
             part don't render
  https://bugs.webkit.org/show_bug.cgi?id=31788

I found that it can be reduced to a no-op clip following a no-op stroke
or fill. These conditions are exercised here and are shown to be a bug
introduced in the 1.9.x development series.
2009-11-25 10:53:39 +00:00
Andrea Canciani
9c24288c82 Revert "[test] Reorder dash-infinite-loop to not hit a runaway allocation."
The infinite loop problem in _cairo_stroker_dash_start is solved by
commit ee02f3484899527380df94c00f40da87f41660ea, so hitting that
problem is not possible anymore and dash-infinite stroke always
hit the memory intensive loops.
This reverts commit 29432d3d32.
2009-11-11 16:45:19 +01:00
Andrea Canciani
b1a7639465 Add dash-offset test
Stroking a dash pattern of odd length with a negative offset is broken
(except when the pattern is composed by a single dash).
2009-11-11 16:38:29 +01:00
Andrea Canciani
c181f9e9ae Add new operator-alpha-alpha test
Compositing of alpha-only sources is not throughly tested and
as a consequence the misbehaviour of some backends is not
shown by the test suite.

[ickle: Added XFAILs for pdf, ps, svg.]
2009-11-09 16:58:06 +00:00
Chris Wilson
8a10c25c3f test: Tweak Benjamin's xcomposite-projection
Include Benjamin's advice on how to make the bug more visible inline
with the code.
2009-11-05 10:02:54 +00:00
Benjamin Otte
aa1f245ea3 [test] Add "target=raster" to test
The test isn't useful on vector backends and fails there due to
antialiasing issues.
2009-11-04 13:56:15 +01:00
Benjamin Otte
84bbf179c3 [test] Add a test exposing bugs in XRenderComposite
This test fills a slightly rotated surface slightly above the 0 line.
This hits some corner cases in the XRenderComposite path.
I discovered these issues while playing with video rendering onto the
canvas in HTML5 (both Webkit and Mozilla have this problem).
I used CAIRO_ANTIALIAS_NONE and a single-color source in the test to get
rid of aliasing issues in the output images. This makes some issues
slightly less visible, but still fails for all of them. If you want to
get a clearer view, disable it and use romedalen.png instead - it has
the same size as the red surface.

(At least) 3 bugs are at work here:
- if _line_exceeds_16_16() triggers for the reference point, the
  source surface will be misaligned.
- the intel driver seems to have an off-by-one bug on my i945 when
  positioning the source surface, causing black seams at the top
  (not visible in the test unless using romedalen.png) and on the left
  of the image.
- My Xvfb fails completely in picture up/download in the xlib-fallback
  path.
2009-11-04 11:20:04 +01:00
Benjamin Otte
942a15ba9e [test] Update upscale test to expose an Xlib failure
By filling the background with grey, we can see that Xlib fills areas
with black that it shouldn't. Xlib therefore now fails this test.
2009-11-02 12:51:14 +01:00
M Joonas Pihlaja
43a775f60d [meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.
The new name is more descriptive than the rather opaque meta surface.
Discussed with vigour on the mailing list and #cairo:

http://lists.cairographics.org/archives/cairo/2009-July/017571.html
2009-10-22 02:29:47 +03:00
Andrea Canciani
cef8194178 [test] Add surface-pattern-operator
Test the results of compositing ALPHA and COLOR_ALPHA surfaces
with different operators.
2009-10-20 14:57:41 +01:00
Chris Wilson
710303ef15 [test] Update rotate-image-surface-paint
Update this test case so the background is not the default border colour
so that we spot when the backend pads out the transformed image surface.
2009-10-19 17:21:57 +01:00
Chris Wilson
96117c1212 [test] Add radial-gradient-source
ranma42 found a bug in compositing with a radial gradient using the
SOURCE operator with EXTEND_NONE, as exercised here.
2009-10-17 10:37:38 +01:00
Carl Worth
ad6334b987 Add mising images to REFERENCE_IMAGES list.
Again, the kind of thing that only gets fixed at release time.
But at least we have a nice test for this.
2009-10-15 15:33:20 -07:00
Carl Worth
cdad5e1076 Mark in-fill-empty-trapezoid as an XFAIL test.
Otherwise, it was disrupting my attempts to release a snapshot, (since
it doesn't respect CAIRO_TEST_TARGET=" " and not run like most of the
tests do).
2009-10-15 14:58:39 -07:00