summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-08-29[script] Introduce cairo_script_context_tChris Wilson7-196/+145
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.
2009-08-29[trace] Fix emission of similar (track operands)Chris Wilson1-7/+6
2009-08-29[stroke] Only mark traps as having intersection if non-empty.Chris Wilson1-3/+2
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.
2009-08-29[clip] Cache intermediate clip masks.Chris Wilson2-64/+104
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...)
2009-08-29[trace] Emit an 'index' for an undefined surfaceChris Wilson1-11/+10
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.
2009-08-29[gstate] Convert simple mask() into a paint()Chris Wilson2-12/+98
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.
2009-08-29[script] Handle zero-length stringsChris Wilson1-1/+2
Not sure where the zero length string is coming from, but we should nevertheless handle it.
2009-08-29[script] Off-by-one in allocation of string length.Chris Wilson1-1/+1
We need pass in the real number of bytes in the string, excluding the NUL terminator which is already accounted for.
2009-08-29[script] A little utility to convert a trace into a traceChris Wilson2-0/+46
Replay the trace using the interpreter onto a script surface - useful for checking idempotency.
2009-08-29[script] Store the current stroke matrixChris Wilson1-9/+37
We can skip re-emitting stroke parameters if the values are unchanged and the scaling matrix is unaltered.
2009-08-29[script] Suppress resetting stroke-style elements after matrix switchChris Wilson1-16/+26
If the user is just using the default values, there is no point re-emitting them.
2009-08-29[script] Hide the implicit CLEAR for similar surfacesChris Wilson1-0/+43
Do emit the clear that is performed by the surface layer on similar surfaces.
2009-08-29[pattern] Ignore matrix/filter/extend when comparing solidsChris Wilson1-9/+16
Solid patterns do not use their matrices, filter or extend properties so ignore them for the purposes of comparing and hashing.
2009-08-29[script] Use a compact representation for horizontal offsets between glyphsChris Wilson2-23/+55
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.
2009-08-29[script] Preserve '{}' whilst translatingChris Wilson2-31/+37
2009-08-29[script] Fix list handling during font destructionChris Wilson1-20/+13
Use cairo_list to unhook the font correctly during the fini callback.
2009-08-29[path] Eliminate redundant line-to before a closeChris Wilson1-0/+22
As the close implicitly issues a line-to to the initial point, remove an identical line-to if present.
2009-08-29[path] Discard redundant line-toChris Wilson1-21/+28
Eliminate repeated line-to to the current point.
2009-08-29[debug] Path printerChris Wilson2-0/+70
2009-08-29[fill] Use trivial rectilinear_to_trapsChris Wilson3-0/+93
Avoid a small amount of unnecessary overhead by performing a simple conversion of the path to traps when it consists solely of simple boxes.
2009-08-29[polygon] Return status from path opsChris Wilson3-31/+19
This tidies the common case which was to call, for example, _cairo_polygon_line_to(); _cairo_polygon_status();
2009-08-29[slope] Inline _cairo_slope_init()Chris Wilson11-25/+79
Move the definition to a separate header file and allow callers to inline the simple function.
2009-08-29[clip] Combine directly onto targetChris Wilson3-32/+115
Where it is unlikely that we will reuse the temporary clip surface, combine the clip directly with the mask.
2009-08-29[clip] Use geometric clipping for unaligned clipsChris Wilson12-662/+830
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.
2009-08-29traps-as-spansChris Wilson3-1/+127
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.
2009-08-29[fill] Early check for empty path/polygonChris Wilson1-1/+4
2009-08-29[gstate] Discard trivial all-clipped regionsChris Wilson1-2/+6
Avoid assertion failures later that we have a valid region.
2009-08-29[clip] Eliminate redundant clipsChris Wilson5-106/+309
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.
2009-08-29[test] Stress the intersection handling by feeding spans/traps random curvesChris Wilson14-0/+175
Another stress test for the fill/stroke and intersection finders.
2009-08-29[polygon] Amalgamate collinear edgesChris Wilson2-7/+54
Combine sequential collinear edges into a single edge, this benefits immensely by feeding fewer edges into either the tessellator or spans.
2009-08-29[util] Show total edge length in show-edgesChris Wilson1-11/+43
2009-08-29[fallback] Avoid tessellating empty polygonsChris Wilson1-2/+8
I added an assert inside the tessellator to ensure that empty polygon were not being propagated that far...
2009-08-29[freelist] Lazy initialisation of poolsChris Wilson2-50/+56
2009-08-29[clip] Use the rectilinear tessellatorChris Wilson2-22/+66
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.
2009-08-29[fill] Short-circuit extents on an empty path.Chris Wilson1-0/+12
If the path is empty, avoid redundant polygonisation and tessellation by simply returning the empty extents.
2009-08-29[tessellator] Special case rectilinear tessellationChris Wilson11-116/+631
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.
2009-08-29[clip] Use special-purpose fill_to_region()Chris Wilson1-17/+9
Avoid the creation of temporary traps when generating a region, by calling the to_region() directly.
2009-08-29[fallback] Avoid going through traps for trivial regions.Chris Wilson3-46/+272
2009-08-29[tessellator] Use a priority queue for the eventsChris Wilson6-661/+212
The skip list was suffering from severe overhead, so though the search was quick, the extra copies during insertion and deletion were slow.
2009-08-29[tessellator] Remove the skiplist for the active edgesChris Wilson1-155/+75
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.
2009-08-29[traps] Increase exponential expansion factor.Chris Wilson2-10/+6
Grow the traps more rapidly, as the allocations are very short-lived so the over-allocation is less of an issue.
2009-08-29[traps] Compute extents on demand.Chris Wilson5-367/+144
2009-08-29Eliminate self-intersecting strokes.Chris Wilson177-2113/+6226
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. ...
2009-08-29[test] Minor tweak of ft-text-vertical-layoutChris Wilson2-7/+4
Tidily destroy the font immediately after use.
2009-08-29[perf] Match directory namesChris Wilson28-39/+68
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.
2009-08-29[perf] Reset global caches after every traceChris Wilson1-0/+5
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.
2009-08-29[perf] Remove cpuset warning for cairo-perf-traceChris Wilson1-47/+0
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.
2009-08-29[perf] Add charting utilityChris Wilson2-0/+755
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
2009-08-26[perf] Fix unaligned-clipChris Wilson1-1/+3
We failed to reset the scale after each loop, eventually generating a vast clip-mask that exceeded memory capacity.
2009-08-26[perf] Add a box mode to spiralChris Wilson1-0/+73
Add a very similar 'spiral' path (really just concentric boxes) that hit the rectangular optimisations so that we can compare how effective they are.