Commit graph

3755 commits

Author SHA1 Message Date
Chris Wilson
5ec27eef95 [pixman] Free the old rects if we fail to allocate new.
During the pixman_op, a complicated dance is performed to handle
enlarging the rectangle array to accommodate the op. One consequence
of this is to, under certain circumstances, replace the current
rectangle array with emptyData and track the old array with oldData.
Hence if we fail to realloc the enlarged array we need to free oldData.
2007-05-03 13:46:25 +01:00
Behdad Esfahbod
ef30708217 [boilerplate] Fix typo 2007-05-02 16:22:44 -04:00
Chris Wilson
c412e42c72 [cairo-xlib-surface] Check that the acquire surfaces are xlib surfaces
_cairo_pattern_acquire_surfaces() may substitute an image surface for
either the source or the mask should the backend not support creation
of similar scratch surfaces or an error occurs during creation. For
composition we require xlib surfaces and so we must trigger the
fallback path if this happens.
2007-05-02 21:17:39 +01:00
Behdad Esfahbod
f3153091b7 [cairo-mutex] Document the API for adding cairo_mutex_t implementations 2007-05-01 20:10:39 -04:00
Behdad Esfahbod
5bfd6553fd [cairo-mutex] Define a NOOP CAIRO_MUTEX_FINALIZE() for pthread
as now the mutex layer will define a generic CAIRO_MUTEX_FINALIZE()
whenever the implementation defines CAIRO_MUTEX_FINI().  In the
case of pthread however we don't need finalization as we don't
have any place to call it, and pthread_mutex_destroy() doesn't
do much anyway.
2007-05-01 19:48:33 -04:00
Behdad Esfahbod
c4e0a059fe [cairo-mutex] Remove NOOP definition of CAIRO_MUTEX_INITIALIZE
as now the mutex layer will use a NOOP CAIRO_MUTEX_INITIALIZE
by default if the implementation does not define CAIRO_MUTEX_INIT.
2007-05-01 19:46:51 -04:00
Behdad Esfahbod
06cc74d974 [cairo-mutex] Rewrite defaults for CAIRO_MUTEX macros not defined by the implementation
to make them better match the design I have in mind, that I will
document in a minute.  They are a lot more readable and understandable
now.
2007-05-01 19:45:29 -04:00
Behdad Esfahbod
e87a25dc7c [cairo-mutex] Fix usage of CAIRO_MUTEX_DECLARE()
Previously cairo-mutex.c was abusing cairo-mutex-private.h by
defining CAIRO_MUTEX_DECLARE before including it, and
cairo-mutex-private.h was simply not overriding any available
CAIRO_MUTEX_DECLARE.  This is not the way it should be.
cairo-mutex.c should instead define CAIRO_MUTEX_DECLARE and
include cairo-mutex-list-private.h for itself.
2007-05-01 19:24:26 -04:00
Behdad Esfahbod
1a33e44aa5 [RELEASING] Update GNOME URL to point to 2.19 planning page 2007-05-01 19:20:06 -04:00
Behdad Esfahbod
4764e6222b [cairo-mutex] Improve error message if no thread implementation found
to put back Carl's "acknowledge and accept" clause (!) before suggesting
use of CAIRO_NO_MUTEX.
2007-05-01 19:20:06 -04:00
Behdad Esfahbod
b5f015f21f [cairo-mutex] Make sure mutex implementation declares enough macros
We have defaults for the rest.
2007-05-01 19:20:06 -04:00
Behdad Esfahbod
b0a0a1779d [cairo-mutex] Make CAIRO_MUTEX_INIT/FINI take mutex object, not pointer to it
This is more consistent with CAIRO_MUTEX_LOCK/UNLOCK.
2007-05-01 19:20:05 -04:00
Behdad Esfahbod
f9154f7eda [cairo-mutex] Make sure CAIRO_MUTEX_FINI() evaluates its argument once 2007-05-01 19:20:05 -04:00
Behdad Esfahbod
a8d47d0c00 [cairo-mutex] Rename macro arguments from "name" to "mutex" 2007-05-01 19:20:05 -04:00
Carl Worth
f57a536fce Increment version to 1.4.7 after the 1.4.6 release 2007-05-01 13:45:58 -07:00
Carl Worth
ddca8fec07 perf: Add $(EXTRA_PROGRAMS) to CLEANFILES
Otherwise these programs stick around and break distclean,
distcheck, and hence release-publish targets.
2007-05-01 13:37:16 -07:00
Carl Worth
0390ed4f18 Increment version to 1.4.6 (and library versioning to 13:3:11) 2007-05-01 13:24:43 -07:00
Carl Worth
c9e0bb5c79 NEWS: Add notes for cairo 1.4.6 2007-05-01 13:20:56 -07:00
Chris Wilson
7f7f4d4f35 [cairo-xlib-surface.c] Free the Pixmap on surface construction failure.
If we create the Pixmap whilst constructing a similar xlib surface, then
it our responsibility to free the Pixmap should we fail to allocate the
surface.
2007-05-01 12:37:38 +01:00
Chris Wilson
3e3bd4df7e Minor typo in cairo_surface_destroy() documentation.
The type of @surface is #cairo_surface_t, not #cairo_t.
2007-05-01 11:28:45 +01:00
Behdad Esfahbod
f7cdbd385a [cairo-mutex-private.h] Move implementation-specific parts to cairo-mutex-type-private.h
This fixes the problem reported by Dave Yeo that boilerplate wasn't building:

In file included from ../src/cairo-scaled-font-private.h:44,
	     from cairo-boilerplate.c:65:
../src/cairo-mutex-private.h:183: error: syntax error before "extern"
../src/cairo-mutex-private.h:184: error: syntax error before "void"
../src/cairo-mutex-private.h:185: error: syntax error before "void"
make[3]: *** [cairo-boilerplate.lo] Error 1
2007-05-01 00:41:47 -04:00
Behdad Esfahbod
6de0f2d157 [cairo-mutex] Fix CAIRO_MUTEX_FINALIZE definition to take parantheses
This was breaking build on some systems as reported by Adrian Johnson
on the list.
2007-04-30 22:38:00 -04:00
Behdad Esfahbod
3f297a0fcc [TODO] Add various items discussed recently 2007-04-30 22:00:31 -04:00
Behdad Esfahbod
51440ad902 [ROADMAP] Mark clipping trapezoids done 2007-04-30 21:57:29 -04:00
Behdad Esfahbod
8ea48710dc [perf] Check availability before including nonstandard headers 2007-04-30 19:20:56 -04:00
Behdad Esfahbod
fbc8bf0503 [perf] Don't build cairo-perf in "make all" 2007-04-30 19:11:31 -04:00
Adrian Johnson
4be608399f Fix cygwin compile error
The WINVER macros need to be defined before including <windows.h>.
As a result of some recent include file rearranging, <windows.h>
was included indirectly before WINVER was defined.
2007-04-30 14:38:19 -07:00
Chris Wilson
a5d1fc923f Free all memory when cairo-perf exits.
Similar to cairo-test, we free any global memory used by cairo for its
caches through the debug interfaces. We do this so that valgrind does
not unnecessary warn about memory leaks for the cached data and any true
leak is then not lost in the noise.
2007-04-30 16:06:47 +01:00
Carl Worth
7e6ab5461c Add missing prototypes for getline and strndup
This is needed to prevent breaking the build for non-GNU systems.
2007-04-28 07:46:56 -07:00
Carl Worth
422798db1d cairo-perf-diff-files: Add missing include of libgen.h for basename 2007-04-28 07:46:15 -07:00
Carl Worth
d89d8e6b45 pixman.h: Add missing definition of WARN_UNUSED_RESULT
This was breaking the build on systems without support for the
__warn_unused_result__ attribute.
2007-04-28 07:45:26 -07:00
Carl Worth
cb6fcdae92 Fix typo in Makefile preventing builds from succeeding
The cairo-ps-surface-private.h file was not getting included in the
distribution.
2007-04-28 07:38:56 -07:00
Carl Worth
a392cc8508 Clarify documentation of cairo_in_stroke and cairo_in_fill
Like cairo_stroke_extents and cairo_fill_extents, these functions
work without regard to the surface dimensions or the current clip
region.
2007-04-27 22:46:47 -07:00
Carl Worth
8286b87416 Clip trapezoids that are partially (or wholly) outside the clip region.
It's quite simple to add a new _cairo_traps_limit call which installs
a box into the cairo_traps_t structure. Then at the time of
_cairo_traps_add we can discard any trapezoid that is wholly outside
the box and also clip any trapezoid that is partially outside the box.

We take advantage of this for both cairo_stroke and cairo_fill, (when
cairo is computing the trapezoids in cairo-surface-fallback.c). Note
that we explicitly do not do any clipping for cairo_stroke_extents,
cairo_fill_extents, cairo_in_stroke, or cairo_in_fill which are
defined to ignore clipping.

As seen by the long-lines perf case, this fix successfully works
around the bug in the X server where it creates overly large masks for
partially-outside-the-destination-surface trapezoids:

 xlib-rgba   long-lines-uncropped-100  545.84 -> 5.83: 93.09x speedup
██████████████████████████████████████████████
 xlib-rgb    long-lines-uncropped-100  554.74 -> 8.10: 69.04x speedup
██████████████████████████████████
2007-04-27 22:44:27 -07:00
Carl Worth
2dcfb944b0 Don't test PDF tests known to fail due to poppler limitations
The following four tests are disabled:

	gradient-alpha, linear-gradient, text-pattern, trap-clip

We don't use XFAIL as that would disable all backends, (but
we can still usefully use these tests on backends other than
PDF).
2007-04-27 16:41:17 -07:00
Adrian Johnson
179e339910 PDF: Change CTM to identity
Some PDF viewers forget the CTM when drawing gradient patterns
with SMasks. This patch works around these bugs by using the default
identity matrix for the CTM. All paths are transformed from
cairo to pdf coordinates before writing to the pdf file.
2007-04-27 16:13:01 -07:00
Adrian Johnson
1816d7c590 Add support for transparent gradients
This is based on the gradient patch written by Miklós Erdélyi at
http://lists.freedesktop.org/archives/cairo/2006-August/007648.html

Currently only EXTEND_NONE and EXTEND_PAD are supported. Other extend
types will go through the image fallback path.
2007-04-27 16:12:55 -07:00
Carl Worth
050dad7173 cairo-perf-diff-files: Always print old and new configuration names
Previously, if the change in the first test case was small enough
to be considered insignificant, then the header lines showing the
names of the old and new configurations would be omitted. This
commit fixes that bug.
2007-04-26 11:30:27 -07:00
Carl Worth
6035d3b47e cairo-perf-diff: Repair command-line option parsing.
Apparently --force and --html have been broken since the attempt
to address --help in ef5611df6c .
2007-04-25 16:28:14 -07:00
Jeff Muizelaar
0a1d2070e2 Fix bugs in fbCompositeSrc_8888x8x8888mmx and fbCompositeSrc_x888x8x8888mmx
And re-enable fbCompositeSrc_8888x8x8888mmx now that it should work.

This gives another little boost to the paint-with-alpha perf test:

image-rgba paint-with-alpha_image_rgba_over-512 11.76 -> 5.20: 1.85x speedup
▉
image-rgb  paint-with-alpha_image_rgba_over-512 11.76 -> 5.26: 1.84x speedup
▉
2007-04-25 16:27:04 -07:00
Carl Worth
342de46eb4 Make the traditional speedup vs. slowdown report style available again
Now, if you pass exactly two performance reports on the command line
you'll get the traditional report style again, (so the tool remains
backwards compatible). If you really want the new style with two
reports you can get it by adding /dev/null as a third argument.
2007-04-25 11:27:33 -07:00
Carl Worth
db2a761ae7 Implement support for generating a report from more than two files
This support is intended to compare the identical backends across multiple
reports from several different configurations, (of one sort or another).
The configuration names used in the report are taken from the filenames
of the report files, (which will format most nicely if 8 characters or
less).

The traditional two-input report mode, (showing one line perdiff with
all speedups before all slowdowns), is removed with this commit, but
is intended to return again shortly.
2007-04-25 11:27:33 -07:00
Carl Worth
5030cfce5d cairo-perf-diff-files: Use pointers instead of indexing to iterate over reports
We terminate the iteration by adding a final report with a NULL
name. This will simplify future code that iterates over more than
two reports simultaneously.
2007-04-25 11:27:33 -07:00
Carl Worth
6121f4fccf cairo-perf-diff-files: Simplify code to grow report->tests 2007-04-25 11:27:33 -07:00
Carl Worth
cc03f0499e cairo-perf-diff-files: Sort and compute stats at the time of loading a report 2007-04-25 11:27:33 -07:00
Carl Worth
228c83c9d2 cairo-perf-diff: Separate command-line options within the args structure
A function like cairo_perf_report_diff wants the options, but really
doesn't want/need to see the filenames for example,
2007-04-25 11:27:33 -07:00
Carl Worth
876786b3f7 Move implementation of getline and strndup
These kept getting in my way as I looked for structure declarations
at the top of the file.
2007-04-25 11:27:33 -07:00
Carl Worth
90d532e08f Replace old and new reports with reports array
Another baby step toward allowing comparison of more than two reports.
2007-04-25 11:27:33 -07:00
Carl Worth
c6c17633e4 Replace old_filename and new_filename with a filenames array
More preparation for comparing more than two perf reports.
2007-04-25 11:27:33 -07:00
Carl Worth
1849a7a8be cairo-perf-diff-files: Add new --min-change option, (replacing third positional argument)
An upcoming change will allow cairo-perf-diff-files to generate
a report based on more than two files. This prepares for that by
moving the minimum-change support from the 3rd positional argument
to a new --min-change option.
2007-04-25 11:27:32 -07:00