This is a meta ticket for a partial rewrite of the vector rendering subsystem which fixes #1656, #1631, #1431.
The attached patch makes the following changes:
- Only draw features in visible extent also for SVG (already introduced for VML in #1602). The performance test in tests/manual/vector-features-performance.html shows that performance will be better in most cases.
- Layer.Vector gets notified by the renderer of unrendered (or not rendered as intended) features. This includes all features that do not intersect the map extent, plus all features that had to be modified to meet the SVG renderer's inValidRange requirements. The layer stores these features in the unrenderedFeatures hash.
- When panning the map, the features from the unrenderedFeatures hash will be drawn. This was done to fix #1431 and #1656. It also ensures that only features that are not on the map yet need to be redrawn after panning, which improves performance significantly compared to the patches attached to #1656.
- Renderer.SVG modifies LineString and LinearRing geometries that have some vertices outside the valid range. These features get clipped at the inValidRange bounds (which is always outside the visible extent), so they can be rendered correctly. A new acceptance test in tests/manual/clip-features-svg.html shows the results. This fixes issues with features with a huge extent, of which only a part is visible in the map viewport.
- Renderer.SVG now uses a "translate" coordinate transformation instead of setting a new viewport for the renderer root when panning the map. This will give features that would be outside the valid range otherwise a chance to move inside the valid range when they get visible in the map viewport. According to the (sketchy) documentation of the Cairo issue referenced in #669, the valid coordinates range applies to the coordinates after transformation, which makes that possible.