Commit graph

2882 commits

Author SHA1 Message Date
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
Behdad Esfahbod
16c7587f2d [slim] Define slim macros to dummy prototypes for non-gcc compilers (#9150) 2006-12-08 15:40:59 -05:00
Behdad Esfahbod
6122c30930 [pixman] Remove unused slim_internal.h 2006-12-08 15:38:34 -05:00
Behdad Esfahbod
734b321aab [doc] Minor wording improvement. 2006-12-07 00:14:37 -05:00
Behdad Esfahbod
eedd86165e [docs] Document CAIRO_VERSION_STRING. 2006-12-07 00:08:09 -05:00
Behdad Esfahbod
9b87fab8ce [docs] Hook various new API into cairo-sections.txt 2006-12-06 23:52:22 -05:00
Behdad Esfahbod
0e028ee0f3 [doc/public/Makefile.am] Move the list of private headers generatable
Move the list of private headers into separate file Headers.mk that
Makefile.am includes (using automake).  To update the list, just remove
Headers.mk and make.
2006-12-06 23:40:08 -05:00
Behdad Esfahbod
b8e1f3778e [docs] Document various CAIRO_VERSION_* macros 2006-12-06 23:38:20 -05:00
M Joonas Pihlaja
fd03991a6a test: random-intersections
The purpose of this test case is to help make
sure that changes to the trapezoid generation or
intersection computation in the tessellator
don't break it.
2006-12-07 04:46:07 +02:00
M Joonas Pihlaja
6301f92d2a Rework the in-fill-empty-trapezoid test to not use the cairo_test() framework.
As suggested by Behdad Esfahbod, we can not use the cairo_test() framework
when it is getting in the way.  The test itself doesn't depend on any
particular backend.

http://lists.freedesktop.org/archives/cairo/2006-December/008809.html
2006-12-07 02:31:10 +02:00
M Joonas Pihlaja
c13a1a2ed0 Replace point sampling in the fill-degenerate-sort-order with rendering.
Clean up the test to not even check the ps backend as per:

http://lists.freedesktop.org/archives/cairo/2006-December/008806.html
2006-12-07 02:31:10 +02:00
M Joonas Pihlaja
565a715d11 Change license of tessellator tests to the MIT license.
The blurb for the fill-degenerate-sort-order, fill-missed-stop and
in-fill-empty-trapezoid tests changed to this one:

http://www.opensource.org/licenses/mit-license.php

c.f. http://lists.freedesktop.org/archives/cairo/2006-December/008806.html
2006-12-07 02:31:10 +02:00
M Joonas Pihlaja
e857ac325a tessellator bug fix: linking fails on x86_64 due to superfluous inline attribute.
Remove inline attribute from cairo_bo_event_compare_abstract()
to fix the linking issue reported by Jinghua Luo on the mailing list:

http://lists.freedesktop.org/archives/cairo/2006-November/008574.html
2006-12-07 02:31:10 +02:00
Behdad Esfahbod
16c0db0d68 [test] Break the "make clean" target into serveral rm calls
Some systems cannot handle very long list of arguments.  Carl was hitting this
for "make clean".  Break it out into several rm calls triggered by the
clean-local target.
2006-12-06 19:03:03 -05:00
Behdad Esfahbod
3cf9947795 [.gitignore] Add big-trap 2006-12-06 19:03:02 -05:00
Peter Weilbacher
4b43a3a1c4 Add OS/2 backend and its requirement to INSTALL and README, following the example of BeOS. 2006-12-07 00:27:29 +01:00
Carl Worth
652f73f090 Bump version to 1.3.7 after making 1.3.6 snapshot 2006-12-06 13:40:52 -08:00
Carl Worth
648ef4487d Increment cairo version to 1.3.6 (and libtool versioning to 12:1:10) 2006-12-06 13:22:41 -08:00
Carl Worth
f0459b3c53 NEWS: Add notes for 1.3.6 snapshot 2006-12-06 13:20:04 -08:00
Carl Worth
e840c120dd Fix 'make distcheck' by mentioning test/pdiff in DIST_SUBDIRS 2006-12-06 13:19:30 -08:00
Carl Worth
b83f9e766a ROADMAP: Note that the Banker's rounding bug is fixed 2006-12-06 13:17:41 -08:00
Dan Amelang
ce58f874fe Change _cairo_lround to use arithmetic rounding
This fixes the text rendering bug reported here:

    https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=217819

No performance impact on x86. On the 770, I see minor speedups in text_solid
and text_image (~1.05x).
2006-12-06 12:30:28 -08:00
M Joonas Pihlaja
d0eff39196 tessellator: input validation and guard bit removal
This patch removes the guard bits from the tessellator internal
coordinates and reworks the input validation to make sure that the
tessellator code should never die on an assert.  When the extent of a
polygon exceeds a width or height of 2^31-1, then the rightmost
(resp. bottommost) points are clamped to within 2^31-1 of the leftmost
(resp. topmost) point of the polygon.  The clamping produces bad
rendering for really large polygons, and needs to be fixed in a saner
manner.

Cleaned up as per

http://lists.freedesktop.org/archives/cairo/2006-December/008806.html
2006-12-06 05:58:44 +02:00
M Joonas Pihlaja
f8ba749172 tessellator: offset working coordinates to be nonnegative
This patch improves the translation invariance of the tessellator
by offsetting all input coordinates to be nonnegative and paves
the way for future optimisations using the coordinate range.

Also changes the assertions to make sure that it is safe to add
the guard bits.  This needs to be changed to do something sensible
about input coordinates that are too large instead of croaking.
The plan is to steal the guard bits from the least significant
instead of the most significant user bits, and having all coordinates
nonnegative will make the rounding involved there easier.
2006-12-06 05:58:44 +02:00
M Joonas Pihlaja
633c51b442 tessellator bug fix: in-fill-empty-trapezoid
The cairo_in_fill() function sometimes gives false positives
when it samples a point on the edge of an empty trapezoid.
This patch alleviates the bug (but doesn't fix it completely),
for the common(?) case where the left and right edges of the
empty trapezoid have equal top and bottom points.
2006-12-06 05:58:44 +02:00
M Joonas Pihlaja
e6c8febca7 tessellator bug fix: fill-missed-stop
Fixes the regression exhibited by the test fill-missed-stop,
where the tessellator would sometimes extend a trapezoid
too far below the end of the right edge.
2006-12-06 05:58:44 +02:00
M Joonas Pihlaja
614117e487 tessellator bug fix: fill-degenerate-sort-order
Fixes the regression fill-degenerate-sort-order, where
confusion arises in the event order for collinear edges.
Also fixes (or at least hides) the issues with zrusin-another
sometimes generating different trapezoids depending on the
state of the random number generator in cairo-skiplist.c.
2006-12-06 05:58:44 +02:00
M Joonas Pihlaja
48b42efcfe test: check for tessellator regression from missed stop events
The new tessellator contains a regression where stop events
that aren't followed by start events sometimes cause the
trapezoid to the left of an edge to be too high.
2006-12-06 05:58:44 +02:00
M Joonas Pihlaja
e94e0a1ca2 test: check if cairo_in_fill() is reporting false positives for empty trapezoids.
cairo_in_fill() may report true if a query point lands on an edge of an
empty trapezoid.
2006-12-06 05:58:44 +02:00
M Joonas Pihlaja
00d7b6acdd test: tessellator event comparator test case for degenerate edges.
There's currently a regression bug in the tessellation code from
switching to the new tessellator.  The bug is caused by
confusion in the comparator used to order events when there are
degenerate edges.  This test is derived from the zrusin-another
performance test case.
2006-12-06 05:58:44 +02:00
Carl Worth
c92f23caa5 ROADMAP: Add _cairo_lround bug for 1.3.6. Note some completed items for 1.4.0 2006-12-05 11:14:49 -08:00
M Joonas Pihlaja
4057a98f88 cairo-perf-diff-files: Don't segfault reading cooked perf reports.
Fixes cairo-perf-diff-files for non-raw cairo-perf reports.  Similar
to the patch on the mailing list, only applied to the caller of
_cairo_stats_compute():

http://lists.freedesktop.org/archives/cairo/2006-December/008720.html
2006-12-05 06:02:45 +02:00