Commit graph

7416 commits

Author SHA1 Message Date
Chris Wilson
77c1109616 [perf] Reset global caches after every trace
I'd disabled this to look at cairo-qt performance, then forgot about it.
Be clean, cleanup globals -- this should fix the huge performance loss
when running in series multiple backends that need separate font caches.
2009-08-29 08:08:25 +01:00
Chris Wilson
9c8e60f771 [perf] Remove cpuset warning for cairo-perf-trace
These traces run for much longer than the original synthetic benchmarks
and seek to replicate 'real-world' applications, so the warning that the
xserver and cairo-perf are not bound to any cpu is false.
2009-08-29 08:08:25 +01:00
Chris Wilson
d07ed5d990 [perf] Add charting utility
cairo-perf-chart takes multiple runs (currently it is limited to
prefiltered data sets) and pretty-prints a chart showing performace
improvements/regressions (in either ASCII or HTML) along with a
cairo-perf-chart.png
2009-08-29 08:08:00 +01:00
Chris Wilson
015eccadcb [perf] Fix unaligned-clip
We failed to reset the scale after each loop, eventually generating a vast
clip-mask that exceeded memory capacity.
2009-08-26 23:51:43 +01:00
Chris Wilson
6f8fae21e6 [perf] Add a box mode to spiral
Add a very similar 'spiral' path (really just concentric boxes) that hit
the rectangular optimisations so that we can compare how effective they
are.
2009-08-26 23:51:43 +01:00
Chris Wilson
e79a9a87c3 [perf] Support objdir!=srcdir in cairo-perf-diff
Crude support to detect when we have cairo-perf-diff-files in the local
directory which is not srcdir.
2009-08-26 23:51:43 +01:00
Chris Wilson
6bfb77a33c [perf] Add spiral strokes
Use cairo_stroke() to perform the equivalent of
spiral-rect-(pix|non)align-evenodd-fill. A useful comparison of stroking
versus filling, as we can assume the composition costs are similar.
2009-08-26 23:51:42 +01:00
Chris Wilson
54b2935c38 [perf] Reset the path after each spiral
Oops we were accumulating paths during each spiral iteration and so the
tests were getting slower and slower and slower...

[And fix a couple of other instances of path accumulation.]
2009-08-26 23:51:42 +01:00
Chris Wilson
fddfe4973f [perf] Add clipped modes to dragon
Investigate the performance hit for unclipped/aligned/unaligned/masked
modes with a reasonably complex geometry.
2009-08-26 23:51:42 +01:00
Chris Wilson
8b3be26c7b [test] Remove misleading code/comments from a1-image-sample 2009-08-26 23:51:42 +01:00
Chris Wilson
e702df59b0 [test] Attempt to automatically detect running under gdb
A common mistake is to forget to pass the foreground mode to
cairo-test-suite when launching it under the debugger, resulting in the
debugger not attaching to the children and missing the error you were
trying to capture. Under linux, we can inspect the path to our parent's
executable and if that looks like gdb, we assume it is and disable forking
of traces.
2009-08-26 23:51:42 +01:00
Chris Wilson
bf4977b645 [test] Exit on first failure '-x'
Add a command line option to the test suite to cause it to exit after the
first failure. The purpose of this is for integration into 'git bisect run',
where the failing test is unknown and we are looking for any failure. For
example, for use in a regression script to find commits in the midst of as
series that need a refresh of a reference image (or fixing!).
2009-08-26 23:51:42 +01:00
Benjamin Otte
40aefac5d7 [xlib] DO_XCOPYAREA and DO_XTILE optimizations break with Window source
Cairo should include the contents of subwindows when using a Window as a
source but will clip to subwindows when using a Window as a destination.
This can be set using the GC's subwindow_mode.

XCopyArea and XFillRectangle can however only use one GC for both source
and destination. Cairo's mode is set to (the default) ClipByChildren.
This means that copying from a Window is broken, so we only allow the
optimization when we know that the source is a Pixmap.

The performance impact of this change has not been tested. It should be
small, as the code will use XRender otherwise.

If it turns out to be a bigger impact, the optimizations could be
improved by doing a two-step copy process:
1) Copy to an intermediate Pixmap with IncludeInferiors
2) Copy to the destination with ClipByChildren
(potentially omitting one one of the steps if source or destination are
known to be Pixmaps).

references:
commit 0c5d28a4e5
https://bugs.freedesktop.org/show_bug.cgi?id=12996
2009-08-26 21:22:52 +02:00
Behdad Esfahbod
90536ef2dd [build] Remove bogus warning that we require at least one native font backend
That limitation was lifted long ago after twin face was introduced.
2009-08-25 00:28:08 -04:00
Behdad Esfahbod
20e227fc39 [build] Fix typo 2009-08-24 23:57:21 -04:00
Søren Sandmann Pedersen
87fb9a9ded [test] Update reference image for the extended-blend-mode test.
A recent pixman change caused one-bit differences in some pixels.
2009-08-17 00:59:46 -04:00
Chris Wilson
d1b8e260d4 [qt] Fix compilation
Enabling 'FAST CLIP' appears to trigger an infinite loop so disable.

Enabling 'FAST FILL' has limited effect on performance, so disable whilst
the basic QT surface is improved.
2009-08-10 21:31:10 +01:00
Chris Wilson
dff0a91742 [xlib] Rewrite UNSUPPORTED() avoiding gcc-ism
Behdad pointed out that fprintf() returns a value so that we could simply
use the comma operator to return the correct value instead of the
expression-block gcc-ism.
2009-08-10 18:01:14 +01:00
Behdad Esfahbod
e63d725ad4 [utils] Remove unused code 2009-08-10 12:47:37 -04:00
Andrea Canciani
d4d0fcb4a8 [quartz] Compile fix for show_glyphs
Correct the prototype for _cairo_quartz_surface_show_glyphs().
2009-08-10 17:44:31 +01:00
Chris Wilson
2a2a19457b [surface] Check for a NULL snapshot
The backend is permitted to return a NULL surface when snapshotting to
indicate that it cannot (or choses not to) implement the method.
2009-08-10 17:44:25 +01:00
Chris Wilson
2e8ce34454 [quartz] Use the implementation font-face not the associated
As the associated is now explicitly the font-face used to create the font
by the user, whereas what we require is the current implementation
(quartz) font.
2009-08-10 17:20:00 +01:00
Chris Wilson
a4dc372bab [scaled-font] Update API documentation
Now that the toy-font-face is exposed to the user, it is expected to be
returned when the user queries the font face associated with a scaled font.
2009-08-10 17:19:53 +01:00
Chris Wilson
c4828666b9 [script] Handle translation of compressed strings.
After introducing the new syntax to mark a deflated string, we also need
to add the equivalent binary tokens.
2009-08-10 17:19:34 +01:00
Andrea Canciani
3487049195 [quartz] Fix one more compile error 2009-08-09 21:47:40 +01:00
Chris Wilson
c2e75b9993 [quartz] Attempt to fix compile errors
ranma42 spotted that the quartz-backend no longer compiled after bed270,
so once again attempt to blindly fix those errors...
2009-08-09 21:12:36 +01:00
Chris Wilson
81c4594712 [script] Ensure strings are nul terminated
Infrequently, but, for example, handling glyph strings, we require the
string to be nul terminated. (Otherwise an error occurs, which was
previously compounded by a drastic leak.)
2009-08-06 23:47:44 +01:00
Chris Wilson
86d6a48952 [script] Check for failure to store the glyph cache
If we fail to add the glyph cache (presumably because the font is in
error) do not leak the allocation. As this occurs for every single glyph
string, the leak can grow very quickly and mask the original bug.
2009-08-06 23:47:40 +01:00
Chris Wilson
af392f7e45 [script] Extend csi-replay to show how to use a single surface
Currently the replay creates a fresh surface for every new surface. Whilst
using it to view replays (such as with --xlib) this is often not what is
desired so add a mode (compile-time only for now) to use similar surfaces
and blits to the front buffer instead.
2009-08-06 23:19:52 +01:00
Chris Wilson
b7639a5f79 [trace] Close the dictionary before font
font expects the dictionary to be constructed on the stack for its use, so
close it. (I missed the closing '>>' when switching between dictionary
constructors.)
2009-08-06 10:55:18 +01:00
Chris Wilson
19f54d872f [gl] Move hidden cairo_gl_surface_create() proto to header
Make check-plt.sh happy
2009-08-06 10:40:32 +01:00
Chris Wilson
ee69f8aa5e [trace] Whitespace
A few gratuitous whitespace and increase the buffer size used whilst
reading in data files.
2009-08-06 10:30:52 +01:00
Chris Wilson
6d30021d65 [trace] Only write the 4 byte length to the stream
We were attempting to write out the whole length of the block when we were
just trying to write out the length value.
2009-08-06 10:29:49 +01:00
Chris Wilson
a439bd99d0 [perf] Compare drawing random curves
Extend the intersection tests with straight lines, with random curves as
well.
2009-08-06 10:17:21 +01:00
Chris Wilson
1327df2cf2 [pattern] Invalid access beyond end of freed-pool
Oops, we were attempting to return a pointer from beyond the end of our
array.
2009-08-06 10:16:45 +01:00
Chris Wilson
920f59a755 [build] Configure switch to disable atomics
Workaround for my arm toolchain which succeeds in linking the configure
program, only to complain when linking a program (such as cairo-perf)
against libcairo.so. Annoying.
2009-08-06 10:16:33 +01:00
Chris Wilson
cb30c1f367 [path] Extend identical lines.
If a subsequent PATH_OP is just a continuation of the previous line, i.e.
it has the same gradient, then just replace the end-point of the previous
line with the new point rather than adding a new operation. Surprisingly
this occurs in the wild, but the main motivation is a future optimisation
to reduce the number of intersections during stroke-to-path.
2009-08-06 10:16:02 +01:00
Chris Wilson
85b688a3f6 [matrix] Use hypot()
Use hypot() instead of open-coding sqrt(x*x + y*y). In theory, the
compiler could emit highly efficient code. In practice it's slower, but
more likely to be more accurate -- but the difference over a bare sqrt()
is likely not to be perceptible.
2009-08-06 10:15:51 +01:00
Chris Wilson
0db9e010fa [perf] Calibrate tests to run for at least 2 seconds
By ensuring that tests take longer than a couple of seconds we eliminate
systematic errors in our measurements. However, we also effectively
eliminate the synchronisation overhead. To compensate, we attempt to
estimate the overhead by reporting the difference between a single
instance and the minimum averaged instance.
2009-08-06 10:15:40 +01:00
Chris Wilson
60c574ad06 [surface] Protect against the user setting a fallback resolution of 0.
Bug 23067 -- using clear drawing operator crashes printing
http://bugs.freedesktop.org/show_bug.cgi?id=23067

Here we were hitting an assert within the paginated surface after creating
a zero sized fallback image, due to the paginated surface being created
with an x fallback resolution of 0 dpi (by
_gtk_printer_create_cairo_surface(), gtk/gtkprinter.c:924).

Avoid the bug by guarding against bad input to
cairo_surface_set_fallback_resolution() which also allows us to identity
the invalid caller.
2009-08-06 10:12:01 +01:00
Chris Wilson
a3f393cf64 [configure] Also check for libiberty.h
cairo-trace also uses the libiberty.h without checking for its presence --
causing a build failure if bfd was installed but not that header.
2009-08-06 10:11:42 +01:00
Chris Wilson
51bd27afa1 [boilerplate/test] Convert make-*-constructors to shell
Remove the intermediate C program that was a nuisance whilst
cross-compiling and replace it with a simple shell script that is just a
combination of cat + sed.
2009-08-06 10:11:32 +01:00
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