Commit graph

7559 commits

Author SHA1 Message Date
M Joonas Pihlaja
f5df38ca5e [build] Fix typos in prototype warnings.
The -Wstrict-prototypes and -Wmissing-prototypes warnings
weren't actually in use due to typos.
2009-09-02 06:40:35 +03:00
M Joonas Pihlaja
c086b40a93 [build] Hush the Solaris compiler about enum abuse.
Sun Studio 12 doesn't like it when we mix our
enum values and types.  We do that a lot on purpose
so the warnings from compiles were very verbose.
2009-09-02 06:38:15 +03:00
M Joonas Pihlaja
f081a5ff55 [build] Refine the -Wno-attribute test to check our use cases.
We don't actually check that -Wno-attribute does what
we think it does.  On clang it doesn't since it happily
seems to recognize but ignore the attribute.

This patch factors out a silent version of CAIRO_CC_TRY_FLAG
which accepts an optional program argument and actually tests
that the compiler doesn't produce any warning messages.  It
is then used to check that -Wno-attribute doesn't complain
when the __warn_unused_result__ attribute is applied to
void functions or variables.
2009-09-02 06:35:14 +03:00
M Joonas Pihlaja
c87b366bfe [constructors] Guard against being called without any input files.
The make-cairo-(test|boilerplate)-constructors scripts ought
never to be called without arguments lest we are left constructorless.
2009-09-02 06:33:22 +03:00
M Joonas Pihlaja
b509b548b1 [trace] Check for __builtin_return_address explicitly.
Some other compilers such as clang and icc support the
__builtin_return_address() intrinsic as well, so we don't
need to check for __GNUC__ >= 3 only.
2009-09-02 04:50:21 +01:00
M Joonas Pihlaja
2b0e070f6a [trace] Replace an open coded test for matrix identity.
The code has a _matrix_is_identity() function we can use
instead of open coding the same test.
2009-09-02 04:50:21 +01:00
M Joonas Pihlaja
70ea9e3ce1 [trace] Don't crash on unknown enums values.
If the tracer encounters an unknown enum value it
ought not to crash. Theis patch replaces the idiom
of looking up a name for an enumerated value directly
from a table by a switch statement. As a bonus we get
warnings from the compiler when the enums are updated
in cairo.
2009-09-02 04:50:20 +01:00
M Joonas Pihlaja
174c2620c8 [trace] Check for object stack underflow.
If the tracer's object stack underflows we want to
know about is as soon as possible. This patch adds
checks against the stack overflowing and aborts the
program with an object stack dump if it does.
2009-09-02 04:50:20 +01:00
M Joonas Pihlaja
bb480d2358 [NEWS] Thank the AuroraUX team for facilitating Solaris testing. 2009-09-02 04:48:40 +01:00
M Joonas Pihlaja
c64f6f8a15 [trace] Get the tracee program name from the environment.
Support non-Linux systems which don't have a /proc/self/cmdline
by transferring the application name given to cairo-trace via
an environment variable CAIRO_TRACE_PROG_NAME.
2009-09-02 04:42:07 +01:00
Chris Wilson
17cdffafda [xlib] Remove stray code
Grr. Should have spotted this before pushing - remove the addition of the
superfluous code.
2009-09-02 00:41:18 +01:00
Chris Wilson
59c4fe93ee [xlib] Eliminate GC clipping
Eradicate the use of clipping with GC. By never using clipping, we never
have to worry about retrieving a dirty clip from the GC cache.
2009-09-02 00:34:37 +01:00
Chris Wilson
075fc5666a [test] Add clip-image
Exercise the XCopyArea() paths under clipping - whilst modifying that code
I noticed that it was not being exercised by the test suite.
2009-09-02 00:33:22 +01:00
Chris Wilson
7d1eb259f9 [xlib] Make xlib_display_t private and rename xlib_screen_info_t
The issue Joonas was trying to solve was the unwanted inclusion of
the inlines via cairo-freelist-private.h. Unwittingly he included
cairoint.h from cairo-xlib-private.h instead, a far more heinous crime as
that causes the boilerplate to try to use the hidden, private symbols.
Instead we resolve this issue by making the cairo_xlib_display_t structure
private to cairo-xlib-display.c and provide functions to manipulate the
abstract data type. Whilst in the vicinity, we rename
cairo_xlib_screen_info_t to cairo_xlib_screen_t for consistency and
cleanliness.
2009-09-01 23:12:43 +01:00
Chris Wilson
b8ddd66cf6 Revert "[freelist] Make _cairo_freepool_alloc_from_new_pool static inline."
This reverts commit 5a3fa29b37 as it breaks
the boilerplate when linking with gcc.
2009-09-01 21:49:01 +01:00
M Joonas Pihlaja
5a3fa29b37 [freelist] Make _cairo_freepool_alloc_from_new_pool static inline.
The xlib boilerplate includes a cairo private header to be able
to disable usage of the render extension.  This indirectly includes
cairo-freelist-private.h which contains a bunch of static inline
functions which use the private _cairo_freepool_alloc_from_new_pool
function, but since that is not inline also, it causes an undefined
extern which cannot be resolved.  The binutils linker doesn't care
since the freelist function aren't actually used in the boilerplate
but the Solaris linker does.  By making the .._alloc_from_new_pool
function inline no dangling references are created and linking
succeeds.
2009-09-01 23:30:56 +03:00
M Joonas Pihlaja
68c8eb955d [wrapper] Avoid a void return gccism.
Returning void using the pattern "return func_returning_void(...)"
is a gccism not supported by Sun Studio 12.
2009-09-01 23:30:56 +03:00
Chris Wilson
6ddab64025 [ps] Clip meta-surface to desired extents.
Ensure that the meta surface does not extend beyond the operation by
forcing a clip to the extents of the operation.

Fixes test/device-offset and test/device-offset-positive
2009-09-01 20:25:53 +01:00
Chris Wilson
665f582954 [ps/pdf] Trim patterns to operation extents
If we have to rasterise a pattern for use by PS/PDF (for example, to
satisfy CAIRO_EXTENT_PAD) then only generate an image large enough to
cover the operation extents. We ensure tight coverage by computing the
extents afresh - we could do this lazily in the future, but we can not
rely on the bounds as computed by the analysis surface as for native
operations they may not be tight.
2009-09-01 18:24:42 +01:00
Chris Wilson
c4c7db9675 [boilerplate] Use xlib as fallback reference for xcb
And exercise RGB code-paths.
2009-09-01 14:59:36 +01:00
Chris Wilson
e7a118d3f8 [path] Standalone header-compilation
Hmm, TRUE/FALSE apparently weren't defined before use. Odd.
2009-09-01 14:31:38 +01:00
Chris Wilson
4f880deeab Compiler warnings
Add an impossible default condition to avoid a compiler warning. And tweak
the code to avoid mismatching signed/unsigned comparisons.
2009-09-01 14:24:59 +01:00
Chris Wilson
1bcc3a3fa0 [tee] Rename 'append' to 'add' and add symmetric 'remove' 2009-09-01 14:24:06 +01:00
Chris Wilson
af82670dd3 [pattern] Remove unused hidden symbol for cairo_pattern_status() 2009-09-01 13:31:52 +01:00
Adrian Johnson
aca1dff259 PDF: Ensure operator is selected before painting surface 2009-08-31 23:13:32 +09:30
Adrian Johnson
a402bdbd32 PDF: Flush operators before writing to the PDF stream 2009-08-31 23:13:32 +09:30
Adrian Johnson
119355b2a4 PDF: Reset alpha to 1.0 before painting a surface
Fixes a test suite regression.
2009-08-31 23:13:32 +09:30
Adrian Johnson
20bd7d0edb Update ref images 2009-08-31 23:13:20 +09:30
Adrian Johnson
135912721f PDF: Avoid using patterns when filling a surface with EXTEND_NONE
The fill equivilant of the previous optimization.
2009-08-31 23:11:05 +09:30
Adrian Johnson
6512faeb94 PDF: Avoid using patterns when painting surfaces with EXTEND_NONE
This is an optimization the PS surface has been using to improve
printing speed and prevent printers from choking on large
images. Applying this optimzation to PDF prevents the same problem
occuring when the PDF is converted to PS.
2009-08-31 23:11:04 +09:30
Adrian Johnson
26d568a9ad PDF: Fix bug when when embedding surfaces 2009-08-31 23:11:04 +09:30
M Joonas Pihlaja
feaf38d0cd [test] Use HAVE_FLOCKFILE instead of _POSIX_C_SOURCE.
The _POSIX_C_SOURCE 2001.. #define requires C99 mode and
clang on Solaris is strict about such things. Use configure
tests for flockfile() instead.
2009-08-31 16:25:08 +03:00
M Joonas Pihlaja
9bb469c51c [trace] Use HAVE_FLOCKFILE/FUNLOCKFILE since configure test for them.
The trace source was using the flockfile() and funlockfile()
functions directly.
2009-08-31 16:06:50 +03:00
M Joonas Pihlaja
b5cf24a4fb [build] Remove duplicate invocation of AC_CHECK_HEADERS.
The fenv.h stuff was checked twice.
2009-08-31 16:06:31 +03:00
Chris Wilson
3acccf0ea5 [perf] Trim outliers from chart
Use "mild outliers" method to remove exceptional speed-ups and slow-downs
from the graph, so that the majority of information is not lost by the
scaling. Add the timing labels to the bars so that the true factor is
always presented.
2009-08-30 12:35:47 +01:00
Carlos Garcia Campos
687462be89 [build] Fix a typo in configure.ac 2009-08-30 12:07:28 +02:00
Chris Wilson
a6bcb6260e [bo-rectangular] Fix assertion failure with insertion sort
We remember the location of the last insert as the next edge is likely to
be nearby. However, we need to be careful when the pointer rests upon the
HEAD and ensure that we begin the search from the appropriate end.
2009-08-30 10:09:51 +01:00
Chris Wilson
19ebf83b67 Merge branch 'stroke-with-spans'
This branch brings self-intersection removal with virtually no
performance regression. (Compare with the initial implementation that
incurred a 5-10x slowdown due to having to tessellate whole strokes at a
time.) The importance of self-intersection removal is the improved visual
quality it brings - gone are those annoying sparkles on the outside of
rounded-rectangles for instance. Most of the performance overhead
associated with the self-intersection removal is avoided by switching from
trapezoids to spans for strokes. Obviously we are not able to do so for
the xlib backend as we do not yet have a polygon image type, and so the
tessellators are overhauled instead, along with more special casing for
frequent operations to avoid the increased complexity along the general
paths.

Speedups
========
 xlib-rgba             swfdec-youtube-0    11371.13 (11406.01 0.28%) -> 10450.00 (10461.84 0.66%):  1.09x speedup
▏
image-rgba          firefox-talos-svg-0    73696.53 (73828.28 3.42%) -> 68324.30 (70269.79 1.36%):  1.08x speedup
▏
image-rgba             swfdec-youtube-0    7843.08 (7873.89 2.57%) -> 7393.96 (7399.68 0.18%):  1.06x speedup

 xvfb-rgba             swfdec-youtube-0    9627.25 (9634.43 0.16%) -> 9020.55 (9040.97 0.27%):  1.07x speedup
▏
Slowdowns
=========
 xvfb-rgba         gnome-terminal-vim-0    7695.12 (7697.87 0.44%) -> 8569.45 (8588.29 0.19%):  1.11x slowdown
▏
 xvfb-rgba         swfdec-giant-steps-0    3811.77 (3815.06 0.23%) -> 4246.67 (4569.17 3.52%):  1.11x slowdown
▏
image-rgba                       gvim-0    7150.90 (7181.96 29.36%) -> 14641.04 (14651.36 0.11%):  2.05x slowdown
█

One method for overcoming these regressions is to reduce the complexity of
the polygons being fed into the tessellator (both in the number of edges
and intersections). This should be feasible by coupling into Jeff Muizelaar's
stroke-to-path work, which early indications suggest will bring a
significant performance improvement. On top of this, our span
implementation for the image backend is not as efficient as we would hope
for - and Joonas promises a much faster implementation soon.
2009-08-29 17:46:07 +01:00
Chris Wilson
a77f1933af Use the more generic is_box when doing simple extent checks
is_rectangle() is far stricter than is_box(), and is only required for a
very limited set of operations (essentially were the rectangle must
conform to the motion as described by cairo_rectangle). For the general
case where we just want to know whether we have a single rectangular path
that covers a certain area,  is_box() is sufficient.
2009-08-29 17:18:19 +01:00
Chris Wilson
0a548d08b5 [clip] Correctly compute a geometric mask for a rectilinear + arbitrary
Fix up the geometric clipper to handle intersecting a rectilinear path
with an arbitrary path and inspecting the result to see if it becomes a
a region.
2009-08-29 17:16:18 +01:00
Chris Wilson
8a323d7c89 [clip] Apply surface offset when combining with clip mask
In order to correctly combine the clip mask with the compositing mask the
clip path must be offset so that it is relative to the destination
surface.
2009-08-29 17:12:31 +01:00
Chris Wilson
21225a7163 [clip] Pass in destination offset for combining with clip-mask
When combining a clip-mask with a subsurface, as when used to combine with
the composite mask, we need to pass the destination surface offset to the
clip so that the paths can be corrected for the new surface.
2009-08-29 17:10:05 +01:00
Chris Wilson
ac6c6fe1d3 [test] Add rotated clip.
Exercise a bug found in not offsetting the clip mask when combining with
the composite mask.
2009-08-29 17:10:05 +01:00
Chris Wilson
c60280782d [script] Implement invert
Flesh out matrix inversion.
2009-08-29 17:10:05 +01:00
Damian Frank
06ca0b1475 Fix build on systems with older Xrender headers.
This patch revises xlib so that it doesn't depend on having recent
Xrender headers to build.  In particular, some definitions were added
to the private xrender header file, and an ifdef render version check
CAIRO_SURFACE_RENDER_SUPPORTS_OPERATOR was changed to a run-time
check using CAIRO_SURFACE_RENDER_HAS_PDF_OPERATORS.
2009-08-29 17:10:05 +01:00
Damian Frank
17ef949b6a Rename cairo-script static func to avoid MinGW conflict
cairo-script-operators.c's _dup function was colliding with one
defined in io.h by MinGW (gcc 4.3.0 package).  I renamed it
to _duplicate.
2009-08-29 17:10:05 +01:00
Chris Wilson
3e7e0eacef Update reference images
Refresh the test reference images to match the current output where
acceptable.
2009-08-29 17:07:41 +01:00
Chris Wilson
155e10e632 [script] Fix use of freed list
A typo, I missed converting the user over to the freshly sorted list,
leaving it iterating over original but checking the sorted for termination
conditions.
2009-08-29 17:07:40 +01:00
Chris Wilson
5393aa6d6c [path] Return the canonical box.
When returning the single box that represents a path, always return it
consistently wound.
2009-08-29 17:07:40 +01:00
Chris Wilson
afea5eb79d [scaled-font] Fix implementation-face refleak
If we found the font via the holdover cache, or if we returned due to an
error, we would leak a reference count on the implementaton face.
2009-08-29 17:07:39 +01:00