Commit graph

6276 commits

Author SHA1 Message Date
Chris Wilson
992f74d884 [test] Use '.' as the field separator in the names
We frequently use '-' within the test name or format name and so we
encounter confusion as '-' is also used as the field separator. At times
this has caused a new test to break an old test because the new test would
match one of the old test's target specific reference images. So switch
everything over to use '.' between fields (test name, target, format,
subtest, etc.).
2008-10-31 13:50:55 +00:00
Chris Wilson
e90073f7dd [test] Build test suite into single binary.
Avoid calling libtool to link every single test case, by building just one
binary from all the sources.

This binary is then given the task of choosing tests to run (based on user
selection and individual test requirement), forking each test into its own
process and accumulating the results.
2008-10-31 12:30:11 +00:00
Chris Wilson
8457972d40 [type3] Whitespace.
Tightly scope the output stream.
2008-10-31 02:25:22 +00:00
Chris Wilson
08f4d49a94 [xlib] Intialise clip_dirty.
Eeek, forgot to set the clip_dirty to 0 on construction.
2008-10-31 02:25:22 +00:00
Chris Wilson
b722d5b2b9 Merge branch '1.8' 2008-10-31 02:24:25 +00:00
Chris Wilson
710f7d30d3 [scaled-font] Fix typo that prevented meta_surface lookup.
test/text-glyph-range was crashing since we requested the meta_surface but
the glyph wrongly believed it already had the meta_surface but was
checking for a path instead.
2008-10-31 02:24:05 +00:00
Adrian Johnson
05fce5bced PS/PDF: Set image Interpolation flag
If the filter mode is anything other than DEFAILT, FAST or NEAREST set the
Interpolate flag in the image dictionary so that a smoothing filter is
applied when rasterising the vector file.

As we have no control over the implementation of the Interpolate filter
(the PS/PDF specifications leave it undefined) we need to capture the
output of poppler/GS and update our reference images. (For a couple of
tests, the filtering is irrelevant so for those we set the filter to
NEAREST.)

Note that GhostScript's Interpolate filter does not work on rotated images
(and a variety of other transformations) so several of the PS reference
images have use nearest-neighbour sampling instead of a bilinear filter.
2008-10-30 21:24:54 +00:00
Chris Wilson
2c53bdb82a [paginated] Emit fallback images using FILTER_NEAREST.
Fallback images should (in theory) be emitted at native resolution, so
disable filtering to avoid introducing potential artifacts into cairo's
ideal output.
2008-10-30 21:24:49 +00:00
Chris Wilson
f03d3f9f7f [boilerplate] Remove #if VERSION>1.9.0
Remove the obsolete #if statement.
2008-10-30 19:24:29 +00:00
Chris Wilson
ef98eb26f7 [test] Reenable device offset testing.
Restore device offset testing that was temporarily disable in the run up
to the 1.8 release.
2008-10-30 19:23:17 +00:00
Chris Wilson
4f2f46ef1b Restore the ability to choose the internal font.
Behdad wants to include the feature with 1.10, so we enable it as early as
possible in 1.9 dev cycle to generate as much feedback as possible.

The first change is to use "<cairo>" as being a name unlikely to clash
with any real font names.

This reverts commits:
  a824d284be,
  2922336855,
  e0046aaf41,
  f534bd549e.
2008-10-30 19:14:45 +00:00
Chris Wilson
52c3fc58b5 [tessellator] Simplify dequeuing by using a sentinel value.
Instead of maintaining an index and comparing it to the count, just mark
the last startstop event with NULL and stop dequeuing events upon seeing
that sentinel value. (Removes an unreadable line, and cachegrind hints
that it may be a tiny bit faster.)
2008-10-30 19:08:24 +00:00
Chris Wilson
ef9e0a5d1d [tessellator] Use a combsort for sorting the event queue.
In my experiments using cairo-perf, the inlined combsort is ~20% quicker
than the library qsort.
2008-10-30 19:08:24 +00:00
Behdad Esfahbod
b146130841 [Makefile.am.releasing] Symlink /manual and /cairo-manual.tar.gz only for releases
And not for snapshots.  Also symlink /cairo-manual-X.Y.Z.tar.gz for all
versions.
2008-10-30 14:35:51 -04:00
Chris Wilson
e3a7f522a6 [tessellator] Perform cheap checks before computing intersect.
First check if we can reject the intersection without having to perform
the full divides, based on analysing:
  t * (ady*bdx - bdy*adx) = bdy * (ax - bx) - bdx * (ay - by)
  s * (ady*bdx - bdy*adx) = ady * (ax - bx) - adx * (ay - by)
and excluding the result if by inspection we know that
(s, t) <= 0 || (s, t) => 1.

Doing so virtually eliminates all division and speeds up the strokes (when
performing self-intersection elimination using the tessellator) perf cases
by about 5%.
2008-10-30 18:25:45 +00:00
Chris Wilson
553fde4bb3 [tessellator] Simplify special cases of edges to compare.
Use our prior knowledge of the inputs and trivial conditions to simplify
the edge equations and in many common conditions, such as vertical edges
and common points, reduce the operations down to a just returning the
non-degenerate 32 bit value.  This adds an overhead of a few conditionals,
but on the fast paths we actually generate fewer branches and many fewer
arithmetic operations such that it improves performance of the fill
performance tests by around 10%.
2008-10-30 18:03:59 +00:00
Chris Wilson
cc109df2a7 [test] Update .gitignore
Add a couple of new programs to gitignore.
2008-10-30 17:52:15 +00:00
Chris Wilson
7d546bba21 [xlib] Eliminate shadowed variable.
Cleanup a minor -Wshadow warning.
2008-10-30 17:52:15 +00:00
Chris Wilson
e3388b8180 [cff-subset] Eliminate shadowed variable.
Cleanup a minor -Wshadow warning.
2008-10-30 17:52:15 +00:00
Chris Wilson
3e18114aff [user-font] Eliminate shadowed variable
Cleanup a minor -Wshadow warning.
2008-10-30 17:52:15 +00:00
Chris Wilson
d073537e82 [scaled-font] Eliminate shadowed variable.
Cleanup a minor -Wshadow warning.
2008-10-30 17:52:14 +00:00
Chris Wilson
6429e3f394 [xlib] Only set Picture clip as necessary.
Only set ClipRectangles on a new Picture, avoiding redundant calls to
clear the non-existent ClipMask otherwise.
2008-10-30 17:52:14 +00:00
Chris Wilson
cd45258c5b [xlib] Only clear the GC clip mask as necessary.
Avoid redundant calls to XSetClipMask() for clean GCs.
2008-10-30 17:52:14 +00:00
Chris Wilson
d384f86499 [xlib] Propagate real status from get_screen_info().
Return the real error from _cairo_xlib_screen_info_get() in order to avoid
having to create a fake NO_MEMORY error.
2008-10-30 17:52:14 +00:00
Chris Wilson
e25b106e9c [xlib] Propagate real status from get_display()
Avoid throwing away the error and inventing a new NO_MEMORY error for
_cairo_xlib_display_get().
2008-10-30 17:52:14 +00:00
Chris Wilson
2555f83b11 [xlib] Avoid repeated calls to XRenderQueryVersion
Use the value determined during display initialisation in order to avoid
redundant XRenderQueryFormats requests.
2008-10-30 17:52:13 +00:00
Chris Wilson
0d0c6a199c [matrix] Optimise invert for simple scaling|translation matrices.
The matrix is quite often just a simple scale and translate (or even
identity!). For this class of matrix, we can skip the full adjoint
rearrangement and determinant calculation and just compute the inverse
directly.
2008-10-30 17:52:13 +00:00
Chris Wilson
74876b00cd [xlib] Exploit compaction of XRenderFillRectangle()
libXrender amalgamates sequences of XRenderFillRectangle() into a single
XRenderFillRectangles request (when permissible). Since it is common for a
cairo application to draw rectangles individually in order to exploit fast
paths within cairo [rectilinear fills], it is a reasonably common pattern.
2008-10-30 17:52:13 +00:00
Chris Wilson
64726ccfb9 [traps] Whitespace.
Fixup whitespace in line with CODING_STYLE and rest of file.
2008-10-30 17:52:13 +00:00
Chris Wilson
d5543005e7 [surface] Only copy font options if the target surface has them.
No need to copy font options if the similar surface is from the same
backend and no special options have been applied by the user. Doing so
breaks lazy initialisation of backend specific options.
2008-10-30 17:52:13 +00:00
Chris Wilson
a002375810 [xlib] Defer querying of font options until first use
Constructing the font options cause the initialisation of Xlc and invoke
several round-trips to the X server, significantly delaying the creation
of the first surface. By deferring that operation until the first use of
fonts then we avoid that overhead for very simple applications (like the
test suite) and should improve start-up latency for larger application.
2008-10-30 17:52:13 +00:00
Chris Wilson
6706590d4e [pattern] Reduce likelihood of range overflow with large downscaling.
Exploit the auxiliary offset vector in the attributes to reduce
likelihood of range overflow in the translation components when converting
the pattern matrix to fixed-point pixman_matrix_t.

An example of this is bug 9148
  Bug 9148 - invalid rendering when painting large scaled-down surfaces
  (https://bugs.freedesktop.org/show_bug.cgi?id=9148)
but the issue is perhaps even more likely with high resolution fallback
images.
2008-10-30 17:52:12 +00:00
Chris Wilson
c0af8c7063 [pattern] Tweak REFLECT HACK
In order to workaound a directfb bug, tweak the reflect->repeat pattern so
that it covers the destination rectangle. Although the number of paint()
increases, the number of read/written pixels remain the same so that
performance should not deteriorate, but instead be improved by using a
cloned source. The early return of the REFLECT surface is discarded so
that the latter optimisations for surface sources can be applied. One side
effect of this is that acquire_source_image() is removed due to its lax
reference counting which thereby exposes the ROI optimisations for image
destinations as well.
2008-10-30 17:52:12 +00:00
Chris Wilson
234623b3d5 [pattern] Support unbounded surfaces.
An unbounded surface should just report an infinite pattern extent and not
return UNSUPPORTED from _cairo_pattern_get_extents().
2008-10-30 17:52:12 +00:00
Chris Wilson
2836be6f75 Cleanup 'status && status != UNSUPPORTED'
Replace instances of 'status && status != UNSUPPORTED' with the more
readable _cairo_status_is_error().
2008-10-30 17:52:12 +00:00
Chris Wilson
13ba43eb8f [matrix] Optimize finding the bounding box under an orthogonal matrix.
We frequently need to find the bounds of a pattern under an identity
matrix, or a simple scale+translation. For these cases we do not need to
transform each corner and search for the bounds as the matrix is x/y
separable and so allows us to inspect the results for the extreme x/y
points independently.
2008-10-30 17:52:12 +00:00
Chris Wilson
6ed957fc24 [gstate] Use _cairo_pattern_black for the default source.
Avoid allocating a default source pattern by using the static black pattern
object. The one complication is that we need to ensure that the static
pattern does leak to the application, so we replace it with an allocated
solid pattern within _cairo_gstate_get_source().
2008-10-30 17:52:11 +00:00
Chris Wilson
7944601864 [pattern] Avoid needless copying of patterns.
Only copy the pattern if we need to modify it, e.g. preserve a copy in a
snapshot or a soft-mask, or to modify the matrix. Otherwise we can
continue to use the original pattern and mark it as const in order to
generate compiler warnings if we do attempt to write to it.
2008-10-30 17:52:05 +00:00
Chris Wilson
9d2189afbd [pattern] Do not recompute the inverse if setting an identical matrix.
More micro-optimisation.
2008-10-30 17:14:27 +00:00
Chris Wilson
2c277ddbea [matrix] Avoid error correction overhead for translation matrices.
We can only correct rounding errors between cairo and pixman matrices for
scaled matrices - so skip the inversion and point transformation overhead
for simple translation matrices.
2008-10-30 17:14:27 +00:00
Chris Wilson
57a1d932f3 [array] Rearrange user_data_fini() to optimize common case.
Micro-optimisation to avoid the _cairo_array_index() for the common case
of 0 elements.
2008-10-30 17:14:27 +00:00
Chris Wilson
2852127c72 [cairoint] Add a few cairo_pure.
Start marking up the prototypes with function attributes - first the
obvious pure functions.
2008-10-30 17:14:27 +00:00
Chris Wilson
cf072c7203 [sdl] Add new backend.
Add a new backend to allow easy interoperability with the Simple
DirectMedia Layer.
2008-10-30 17:04:53 +00:00
Chris Wilson
31ada1ea15 Merge branch '1.8' 2008-10-30 16:56:07 +00:00
Chris Wilson
ab15d76275 [test] Remove XFAIL from user-font-mask
user-font-mask should PASS modulo the scaling anomalies in the external
renderers, so remove it from the XFAIL list.
2008-10-30 16:54:23 +00:00
Chris Wilson
540f555840 [analysis] Only limit to mask extends if bounded by mask.
The extents of cairo_mask() is only limited to the mask if the operation
is bounded by the mask.
2008-10-30 16:19:54 +00:00
Chris Wilson
4b29988939 Review users of cairo_rectangle_int_t for incorrect unsigned promotion.
Adrian Johnson discovered cases where we mistakenly compared the result
of unsigned arithmetic where we need signed quantities. Look for similar
cases in the users of cairo_rectangle_int_t.
2008-10-30 16:19:38 +00:00
Chris Wilson
0e4156121f [rectangle] Fix unsigned promotion whilst computing intersect.
_cairo_rectangle_intersect() incorrectly allows unsigned promotion during
its arithmetic.
2008-10-30 16:19:26 +00:00
Chris Wilson
2464b8a0a9 [pattern] Allow the projected surface extents to be negative.
In order to handle projection of analysis surface with user-fonts we need
to accommodate patterns extending into negative coordinate space.
2008-10-30 16:19:11 +00:00
Chris Wilson
d5d29075bd [gstate] Allocate temporary variable for backend_to_user transform.
_cairo_gstate_backend_to_user_rectangle() requires that its input
arguments are non-NULL and describe the input rectangle to be transformed.
However, we were passing through output parameters from the public API
which were allowed to be NULL. So we need to allocate temporary variables
in which to compute the output rectangle, but only copy them as required.
2008-10-30 16:16:09 +00:00