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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.