Commit graph

2913 commits

Author SHA1 Message Date
Brian Ewins
bf1c2ef1e2 [ATSUI] Support disabling antialiased text 2006-12-16 15:41:09 -05:00
M Joonas Pihlaja
4c95e2b7bf New performance test case "mosaic" for splines. 2006-12-16 21:32:19 +02:00
Frederic Crozat
fe21f9d8ca [check-defs.sh] Fix make check for OPD platforms
Make symbol checks work on OPD platform (such as IA64 or PPC64).
2006-12-16 13:55:21 -05:00
Carl Worth
fa618df6e2 Merge branch 'master' of git.cairographics.org:/git/cairo into cairo 2006-12-14 21:10:34 -08:00
Carl Worth
2b946cba0e Bump cairo version to 1.3.9 after making 1.3.8 snapshot 2006-12-14 21:09:45 -08:00
Carl Worth
129b55f5fc Increment cairo version to 1.3.8 (and libtool versioning to 12:2:10) 2006-12-14 20:44:25 -08:00
Carl Worth
8fa86e8970 NEWS: Add notes for cairo 1.3.8 snapshot 2006-12-14 20:43:31 -08:00
Jonathan Watt
81a620fb66 revert accidental mode changes in my previous commit 2006-12-15 04:52:28 +01:00
U-JONATHAN-X60S\jonathan
15e8486ef1 Merge branch 'master' of git://git.cairographics.org/git/cairo 2006-12-15 02:31:13 +01:00
U-JONATHAN-X60S\jonathan
bf78be63fc Fix a couple of character spacing issues on Windows 2006-12-15 00:48:54 +01:00
Carl Worth
8b31038b9f Fix a couple of more stale images holding up 'make distcheck' 2006-12-14 10:16:34 -08:00
David Turner
e9bef30d2b Optimize gradient computations
We update the test suite reference images where needed, (pdiff
avoided a few, but most still needed updating). We take advantage
of the need for new reference images to shrink some of the giant
tests to speed them up a bit.

This optimization provides a 2x improvement in linear gradient
generation performance (numbers from an x86 laptop):

image-rgb    paint_linear_rgba_source-512 26.13 -> 11.13: 2.35x speedup
█▍
image-rgb    paint_linear_rgba_source-256  6.47 ->  2.76: 2.34x speedup
█▍
image-rgba      paint_linear_rgb_over-256  6.51 ->  2.86: 2.28x speedup
█▎
image-rgb      paint_linear_rgba_over-512 28.62 -> 13.70: 2.09x speedup
█▏
image-rgba       fill_linear_rgb_over-256  3.24 ->  1.94: 1.66x speedup
▋
image-rgb     stroke_linear_rgba_over-256  5.68 ->  4.10: 1.39x speedup
▍
2006-12-14 09:27:45 -08:00
Carl Worth
af9cce6aa2 Fix 'make distcheck' after recent file removals 2006-12-14 09:18:26 -08:00
Carl Worth
4888a02666 test: Remove ps-specific reference images no longer needed thanks to pdiff 2006-12-14 07:58:02 -08:00
Carl Worth
5e0818d79d test: Remove svg-specific reference images no longer needed thanks to pdiff
This doesn't get rid of all the SVG reference images, but it
does clean up quite a few.
2006-12-14 07:58:02 -08:00
Carl Worth
c426e71141 Hook up pdiff to the test suite now that its written in C 2006-12-14 07:58:02 -08:00
Carl Worth
305cbd8e71 pdiff: Remove casts since we're out of the land of X++ where void* is stupidly broken 2006-12-14 07:58:01 -08:00
Carl Worth
f175b23559 pdiff: Rename everything to .c and fix an last littele C++ isms.
The only things we had missed were a few new/delete pairs, and some
obvious header file fixups, (like not doing <string>).
2006-12-14 07:58:01 -08:00
Carl Worth
18a4fa448f pdiff: Replace CompareArgs class with args_t struct
This gets rid of nearly the last vestiges of C++ from the pdiff code.
2006-12-14 07:58:01 -08:00
Carl Worth
871aba6c80 pdiff: Fix return value from perceptualdiff program 2006-12-14 07:58:01 -08:00
Carl Worth
2174ee2475 pdiff: Remove all uses of std::string 2006-12-14 07:58:01 -08:00
Carl Worth
91b156b82e pdiff: Remove RGBAImage classes now that we're just using cairo image surfaces 2006-12-14 07:58:01 -08:00
Carl Worth
4c812c38e4 pdiff: Remove hideous C++ reference passing 2006-12-14 07:58:01 -08:00
Carl Worth
2457756afd pdiff: Remove intermingled statements and declarations 2006-12-14 07:58:01 -08:00
Carl Worth
e947f5a4bd pdiff: Add .gitignore for perceptualdiff binary 2006-12-14 07:58:01 -08:00
Carl Worth
bb4d4dc771 pdiff: Remove old, unused Yee_Compare interface 2006-12-14 07:58:01 -08:00
Carl Worth
53c3a2f75b pdiff: Rewrite main program to use cairo-based pdiff_compare interface 2006-12-14 07:58:01 -08:00
Carl Worth
358645d6eb pdiff: Rip out unused ImgDiff code, (dropping -output option) 2006-12-14 07:58:00 -08:00
Carl Worth
4438fb6dca pdiff: Move function that depends on command-line argument class to same file as main 2006-12-14 07:58:00 -08:00
Carl Worth
c7379fcea4 pdiff: Rewrite Laplacian pyramid code from C++ to C 2006-12-14 07:58:00 -08:00
Carl Worth
29456d3865 pdiff: Convert C++-style comments to good old-fashioned C-style comments 2006-12-14 07:58:00 -08:00
Carl Worth
34a6af3c55 pdiff: Delete all trailing whitespace. 2006-12-14 07:58:00 -08:00
Carl Worth
d421a856d0 pdiff: Re-indent all code
I've given up on trying to preserve the old code formatting
for compatibility. We're not planning on augmenting the algorithm
itself, just integrating it into cairo. So I don't expect to
make changes that we'll be all that interested in pushing
upstream.
2006-12-14 07:58:00 -08:00
Carl Worth
4f6611ef6c pdiff: Fix line endings 2006-12-14 07:58:00 -08:00
Carl Worth
ccb3a6c4de pdiff: Compile pdiff algorithm as a libtool convenience library
The convenience library provides a pdiff_compare function with a
cairo interface into the perceptual diff algorithm.
2006-12-14 07:58:00 -08:00
Carl Worth
55f776876d test: Rework buffer_diff interface as new compare_surfaces
This is a slightly kinder interface that accepts cairo_image_surface_t
pointers rather than pointers to the raw image data and width, height,
stride. This brings us closer to hooking up the pdiff code.
2006-12-14 07:57:59 -08:00
Carl Worth
0d7870b6bf pdiff: Teach pdiff code to accept cairo image surfaces
This is a second small step in enabling cairo's test suite and the
pdiff code to start working together.
2006-12-14 07:57:59 -08:00
Dan Amelang
a87f494d4b Don't use the GNU-only grep option "-a"
We now use strings first, then grep to find the magic value, as suggested
by various people in the reports for the bugs that this fixes:

    https://bugs.freedesktop.org/show_bug.cgi?id=9247
    https://bugs.freedesktop.org/show_bug.cgi?id=9124
2006-12-12 16:34:50 -08:00
Carl Worth
41e01d95ed pdiff: Factor out a comparison function that doesn't read the 'args' structure
This is one small step in "libifying" pdiff which will make it
easier to share this code inside cairo's test suite.
2006-12-12 03:13:38 -08:00
Carl Worth
b50b8db6d7 test: Simplify buffer_diff by handling device offset in advance
In a manner similar to flattening in advance, we now extract the sub-
surface of interest (when testing with device offsets) before calling
into the buffer_diff functions. This allows these functions to accept
a single stride value once again instead of one for each of the three
images.
2006-12-12 02:17:19 -08:00
Behdad Esfahbod
1781e6018c [Xlib] Rewrite an optimized cairo_xlib_show_glyphs()
The old implementation was a very naive one that used to generate one XRender
glyph element per glyph.  That is, position glyphs individually.  This was
raised here:

  http://lists.freedesktop.org/archives/cairo/2006-December/008835.html

The new implmentation is a free rewriting of the Xft logic, that is,
compressing glyphs with "natural" advance into elements, but with various
optimizations and improvements.

In short, it works like this: glyphs are looped over, skipping those that are
not desired, and computing offset from "current position".  Whenever a glyph
has non-zero offsets from the current position, a new element should be
started.  All these are used to compute the request size in the render
protocol.  Whenever the request size may exceed the max request size, or at
the end, glyphs are flushed.  For this to work, we now set non-zero glyph
advances when sending glyphs to the server.

Notable optimizations and improvements include:

  - Reusing the input glyph array (with double glyph positions) as a working
    array to compute glyph offsets.

  - Reusing the input glyph array as the output glyph-index array to be passed
    to XRender.

  - Marking glyphs to be skipped as so, avoiding a copy of the glyph array,
    which is what the old code was doing.

  - Skip glyphs with positions "out-of-range".  That is, those with positions
    that would cause an overflow in Xrender's glyph offset calculations.

On my Fedora desktop on Pentium 4, and on a Nokia 770, it shows a 6% speedup on
the timetext test.
2006-12-12 03:30:21 -05:00
Behdad Esfahbod
198c1439ab Cache rounded glyph advance values
This is done in cairo_scaled_glyph_t->x/y_advance.  The value is mostly useful
for raster backends, for example to set as default advance of a glyph, and
later on optimize glyph positionings that use the default advance.
2006-12-12 03:30:19 -05:00
Behdad Esfahbod
e7ed9eee76 [cairo-gstate] Use a local buffer on the stack for small glyph operations
We duplicate the incoming glyph array for two reasons: 1) applying
transformations, and 2) to let the lower level functions have a glyph array
they can modify.  By using a 2kb array on the stack we can avoid malloc() for
requests of less than 100 glyphs.  The size of the array can be tuned by
setting CAIRO_STACK_BUFFER_SIZE.
2006-12-12 03:30:14 -05:00
Behdad Esfahbod
da60bc45f2 [cairoint] Define CAIRO_STACK_BUFFER_SIZE (defaults to 2kb)
This is the suggested size in bytes of buffers allocated on the stack per
function, mostly used for glyph rendering.  We typically use a local buffer on
the stack to avoid mallocing for small requests.  Requests that do not fit are
malloc()ed automatically.  The default value should be enough for about a
100-glyph cairo_show_glyphs() operation.
2006-12-11 03:10:05 -05:00
Behdad Esfahbod
5a9642c574 Add/remove const to cairo_glyph_t* arguments consistently
The rule is: cairo_glyph_t* is always passed as const for measurement
purposes.  This was not reflected in our public api previously.  Fixed

Showing glyphs used to have cairo_glyph_t* always as const.  With this
changed, it is only const on cairo_t and cairo_gstate_t operations.
cairo_surface_t, cairo_scaled_font_t, and individual backends receive
cairo_glyph_t* as non-const.  The desired semantics is that they may modify
the contents of the array as long as they do not return
CAIRO_STATUS_UNSUPPORTED.  This makes it possible to avoid copying the glyph
array again and again, and edit it in-place.  Backends are in fact free to use
the array as a generic buffer as they see fit.
2006-12-11 01:39:51 -05:00
Behdad Esfahbod
70695f5c62 [FreeType] Remove "UNSUPPORTED" show_glyphs stub and NULL its entry
The fallback paths always assume UNSUPPORTED if a method is NULL, so, no need
for a method to just return UNSUPPORTED.
2006-12-10 02:33:59 -05:00
Dan Amelang
fea60c7283 Change _cairo_lround to correctly handle edge cases previously missed
A nice side effect of this new approach is that the valid input range
was expanded back to (INT_MIN, INT_MAX]. No performance regressions observed.
Also included is documentation about the internal mysteries of _cairo_lround,
as previously promised.
2006-12-09 21:05:20 -08:00
Behdad Esfahbod
cc75159587 [FreeType] Do not return large structs from functions
Pass cairo_ft_options_t around by pointer, not by value.  That's what we do
with cairo_font_options_t anyway, and there is no reason to not do the same
here.  (makes -Waggregate-return warnings go away btw).
2006-12-08 16:10:57 -05:00
Behdad Esfahbod
beadc7da86 [docs] Update templates 2006-12-08 15:42:24 -05:00
Behdad Esfahbod
cdd79c104d [docs] Generate index of new symbols in 1.4 2006-12-08 15:41:52 -05:00