Age | Commit message (Collapse) | Author | Files | Lines |
|
cairo_script_context_t is an encapsulation object for interfacing with the
output - multiple surfaces can share the same context, meaning that they
write to the same destination file/stream.
|
|
|
|
We were hitting an assertion attempting to eliminate intersections inside
the rectilinear tessellator for empty strokes. We can avoid this
assertion, by only marking the traps as having potential intersections iff
it is non-empty.
|
|
As we now superimpose a per-operation clip, this defeats the current
top-level caching mechanism. Instead we need to cache the mask for
each path. This still seems quite wasteful, and an avenue would be to
avoid caching if the path is rectilinear and reduce the number of
required composite operations. (However, first find test case...)
|
|
Larry Ewing hit a bug in cairo-trace whereby it tried to create a similar
surface referencing an undefined object. This fix checks whether the
object has yet to be defined, and if not issues an index in order to copy
the appropriate operand from the stack.
|
|
As using mask() prevents various optimisations in the backends (for
example the use of geometric clips) and for some may trigger fallbacks,
perform the simplifications usually done (too late) by the pattern layer
in the generic gstate layer. This allows us on the odd occasion to
transform a mask() into a paint() but perhaps more importantly removes the
need for identical transformations in each backend.
|
|
Not sure where the zero length string is coming from, but we should
nevertheless handle it.
|
|
We need pass in the real number of bytes in the string, excluding the NUL
terminator which is already accounted for.
|
|
Replay the trace using the interpreter onto a script surface - useful for
checking idempotency.
|
|
We can skip re-emitting stroke parameters if the values are unchanged and
the scaling matrix is unaltered.
|
|
If the user is just using the default values, there is no point re-emitting
them.
|
|
Do emit the clear that is performed by the surface layer on similar
surfaces.
|
|
Solid patterns do not use their matrices, filter or extend properties so
ignore them for the purposes of comparing and hashing.
|
|
Kerning is quite frequent, that is to apply a horizontal but no vertical
offset to a glyph. For instance by discarding the vertical coordinate
where it remains the same and only encoding the horizontal offset we
reduce the file size by ~12.5% when tracing poppler.
|
|
|
|
Use cairo_list to unhook the font correctly during the fini callback.
|
|
As the close implicitly issues a line-to to the initial point, remove an
identical line-to if present.
|
|
Eliminate repeated line-to to the current point.
|
|
|
|
Avoid a small amount of unnecessary overhead by performing a simple
conversion of the path to traps when it consists solely of simple boxes.
|
|
This tidies the common case which was to call, for example,
_cairo_polygon_line_to(); _cairo_polygon_status();
|
|
Move the definition to a separate header file and allow callers to inline
the simple function.
|
|
Where it is unlikely that we will reuse the temporary clip surface,
combine the clip directly with the mask.
|
|
For the simple cases where the clip is an unaligned box (or boxes), apply
the clip directly to the geometry and avoid having to use an intermediate
clip-mask.
|
|
Add an interface to spans that accepts trapezoids. This allows backends
that have an efficient span-line interface but lack efficient handling
of boxes (partly due to the current poor compositor interface) to
redirect composite_trapezoids() to composite_polygon() and the
span-renderer.
|
|
|
|
Avoid assertion failures later that we have a valid region.
|
|
First perform a simple geometric clip to catch the majority of cases where
an unaligned clip has been set outside the operation extents that can be
discarded without having to use an image surface.
This causes a dramatic increase of over 13x for the poppler-bug-12266
trace and little impact elsewhere for more sensible clippers.
|
|
Another stress test for the fill/stroke and intersection finders.
|
|
Combine sequential collinear edges into a single edge, this benefits
immensely by feeding fewer edges into either the tessellator or spans.
|
|
|
|
I added an assert inside the tessellator to ensure that empty polygon were
not being propagated that far...
|
|
|
|
We can ensure that we always produce a clip region when possible by using
the rectilinear tessellator to convert complex, device-aligned polygons to
regions. Prior to using the tessellator, we relied on pixman's region code
which could only handle a union of rectangles.
|
|
If the path is empty, avoid redundant polygonisation and tessellation by
simply returning the empty extents.
|
|
For the frequent cases where we know in advance that we are dealing with a
rectilinear path, but can not use the simple region code, implement a
variant of the Bentley-Ottmann tessellator. The advantages here are that
edge comparison is very simple (we only have vertical edges) and there are
no intersection, though possible overlaps. The idea is the same, maintain
a y-x sorted queue of start/stop events that demarcate traps and sweep
through the active edges at each event, looking for completed traps.
The motivation for this was noticing a performance regression in
box-fill-outline with the self-intersection work:
1.9.2 to HEAD^: 3.66x slowdown
HEAD^ to HEAD: 5.38x speedup
1.9.2 to HEAD: 1.57x speedup
The cause of which was choosing to use spans instead of the region handling
code, as the complex polygon was no longer being tessellated.
|
|
Avoid the creation of temporary traps when generating a region, by calling
the to_region() directly.
|
|
|
|
The skip list was suffering from severe overhead, so though the search was
quick, the extra copies during insertion and deletion were slow.
|
|
The active edge list is typically short, and the skiplist adds significant
overhead that far outweigh the benefit of the O(n lg n) sort. Instead we
track the position of the last insertion edge, knowing that the start
events are lexicographically sorted, and begin a linear search from there.
|
|
Grow the traps more rapidly, as the allocations are very short-lived so
the over-allocation is less of an issue.
|
|
|
|
We refactor the surface fallbacks to convert full strokes and fills to the
intermediate polygon representation (as opposed to before where we
returned the trapezoidal representation). This allow greater flexibility
to choose how then to rasterize the polygon. Where possible we use the
local spans rasteriser for its increased performance, but still have the
option to use the tessellator instead (for example, with the current
Render protocol which does not yet have a polygon image).
In order to accommodate this, the spans interface is tweaked to accept
whole polygons instead of a path and the tessellator is tweaked for speed.
Performance Impact
==================
...
Still measuring, expecting some severe regressions.
...
|
|
Tidily destroy the font immediately after use.
|
|
In order to handle 'cairo-perf-trace benchmark', we need to perform the
can_run? test on the directory name as opposed to the individual trace
names. Make it so.
|
|
I'd disabled this to look at cairo-qt performance, then forgot about it.
Be clean, cleanup globals -- this should fix the huge performance loss
when running in series multiple backends that need separate font caches.
|
|
These traces run for much longer than the original synthetic benchmarks
and seek to replicate 'real-world' applications, so the warning that the
xserver and cairo-perf are not bound to any cpu is false.
|
|
cairo-perf-chart takes multiple runs (currently it is limited to
prefiltered data sets) and pretty-prints a chart showing performace
improvements/regressions (in either ASCII or HTML) along with a
cairo-perf-chart.png
|
|
We failed to reset the scale after each loop, eventually generating a vast
clip-mask that exceeded memory capacity.
|
|
Add a very similar 'spiral' path (really just concentric boxes) that hit
the rectangular optimisations so that we can compare how effective they
are.
|