- QgsFeature owns QgsFields (otherwise the assigned QgsFields may get deleted)
- updated QgsRenderChecker to use map settings + map renderer job
- fixed DPI issue in map renderer to map settings conversion
- fixed vector layer cache (failing file operations)
There are still few tests that keep failing compared to master branch,
but the reason for failure are tiny pixel diffs and we should probably just
update the expected images.
As a bonus, spatial index is a bit faster (10%) as we do not use random eviction buffer
anymore (which makes sense only when using disk storage manager).
Added basic tests for spatial index
Feature sources of providers/layers should act as immutable
snapshots of the state of provider or layer, not being affected
by any concurrent changes to provider or layer while the source is in use.
Currently working just with OGR, Postgres, SpatiaLite providers.
Previously there was a problem that if user panned too quickly,
the map item could get completely out of the view of the graphics
view and no new paint events would be created for some time.
More changes:
- few improvements to map renderer job API
- added basic unit test for map renderer job
- map canvas uses P key to switch parallel/sequential rendering
This is an important change: new class (QgsMapLayerRenderer) is introduced
and it keeps all information from layer which is necessary for rendering.
Thanks to that, any changes to map layer will have no impact on rendering that
may be currently underway: if the user changes renderer, rendering will
not crash because it is using a different instance.
Work in progress: only vector layers, no labeling, no diagrams, iterator
still uses some bits from QgsVectorLayer.
Another change: QgsFeatureRendererV2, QgsSymbolV2 do not get access
to QgsVectorLayer - only to fields they need. Point displacement renderer
did more extensive use of QgsVectorLayer - currently it is not functional.
That caching mechanism is too coarse - it is expected that there is only one map renderer.
Instead, caching would need to be done on higher level, e.g. in QgsMapCanvas
QgsMapCanvasMap is now just a simple map canvas item storing an image,
all rendering logic has been moved to QgsMapCanvas.
Restored functionality of map decorations and cancellation of rendering.
When map is going to be refreshed, the old rendered map stays visible
for a small amount of time (scaled) and then it is replaced by the new map.
The idea was not to expose the labeling engine instance used for rendering
to other parts of the application and keep it as an implementation
detail within renderer jobs.
Resulting placement is kept in a newly created class QgsLabelingResults
which is passed from the renderer job's labeling engine to map canvas
where it is available for map tools.
Global labeling settings are now kept only in QgsProject (there is
no instance of QgsPalLabeling which would stay alive all the time).
- scene and painter DPI are always the same
- raster scale factor is always 1
- scale factor always means pixels per milimeter
- no need to force of custom-computed scale
- no "output units" - map settings always use pixels as units
The logic used previously was getting too complex:
- scene DPI vs painter DPI
- enforcing custom scale in composer
- unclear logic behind scale factor and raster scale factor settings
This is resolved by doing composer-specific tweaks inside composer:
- set map cache image's DPI (to get correct scale)
- scale printer's painter to switch from mm to pixels (dots)