Commit graph

6265 commits

Author SHA1 Message Date
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
Carl Worth
30f2df1dec Fix typo in bug URL.
Thanks to AndrewR in IRC for pointing out the typo.
2008-10-30 08:40:35 -07:00
Carl Worth
b598dcd1b1 Fix release-publish to also update the current manual.
That is, the vesion that appears as:

	http://cairographics.org/manual
and:
	http://cairographics.org/cairo-manual.tar.gz

It was silly that we previously required a manual step to
upload the documentation (which we regularly forgot to do)
and that it uploaded with a date in the name rather than a
version. So we just drop the old doc-publish Makefile target
now as it's just not useful anymore.
2008-10-30 08:29:51 -07:00
Carl Worth
91183a503e RELEASING: Mention that a versioned manual is uploaded. 2008-10-30 08:26:55 -07:00
Carl Worth
5037fa238e Increment version to 1.9.1
We're finalyl opening the 1.9 development series in order to land
lots of exciting new features that people have been working on.
2008-10-30 08:23:06 -07:00
Carl Worth
d53537e8b5 Increment version to 1.8.3 after the 1.8.2 release.
Thanks to Chris Wilson (who else?) for the last-minute bug fix.
2008-10-30 08:20:59 -07:00
Carl Worth
f7c958d972 Increment cairo version to 1.8.2.
Hurrah! We're finally there.
2008-10-30 07:36:02 -07:00
Chris Wilson
42711a5586 [xlib] Fix _draw_image_surface() with opaque images.
If the image was opaque with no alpha channel, we filled the output alpha
with 0. Typically, the destination surface for dithering is an RGB window,
so this bug went unnoticed. However, test/xlib-expose-event is an example
where we generate an intermediate alpha-only pixmap for use as a stencil
and this was failing as the mask was left completely transparent. The
simple solution is to ensure that for opaque images, the output alpha is
set to the maximum permissible value.
2008-10-30 10:00:30 +00:00
Chris Wilson
c3940d342a [xlib] whitespace
Tweak the whitespace to lose some unnecessary line wrapping, casts and
blanks.
2008-10-30 10:00:30 +00:00
Behdad Esfahbod
e51648b601 [test/xlib-expose-event] Save the output image to disk 2008-10-30 04:43:45 -04:00
Carl Worth
f534bd549e Remove test/twin-ref.png.
I missed this in a previous commit, (I think I had used a
pattern of twin-*-ref.png which of course didn't match
this file).
2008-10-29 21:30:00 -07:00
Carl Worth
cf97966c07 NEWS: Finish the entry for the 1.8.2 release.
Add some summarizing paragraphs and organize bug-fixes and optimizations
into separate sections.
2008-10-29 21:01:01 -07:00