mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-19 00:04:45 -05:00
progress preview render results while drawing the layer, which differ from the final layer render The immediate use case here is for rendering tiled scene layers. In order to generate the actual final render for these layers, we need to first fetch ALL content for the render and then sort the primitives by z value. But this means that the layer renders can be extremely slow, with no visible changes on the map until all the content fetching is complete. Not great user experience! Instead, here we add the infrastructure so that a layer renderer can get a temporary image to paint to for any partial renders. This image gets used during map composition up until the layer finally finishes rendering, at which time the layer's actual destination image will be used for the composition. This means that tiled scene renderers can now draw all tiles (with unsorted primitives, and the artifacts which come with that) as soon as we fetch each tile. This gives the user an immediate visual reflection that the tiles are being fetched and that how quickly (or slowly) that is happening. As soon as we've got all tiles, the layer render will be immediately switched to the version in which all content is rendered in the correct z order. As a bonus, we draw these temporary in progress renders over any previously transformed cache version of the layer available. So eg when you zoom in, you'll get a zoomed in pixelated version of the last render which gets progressively drawn over with each tile as it is fetched. This same API could be used in future eg with point cloud rendering when points are being sorted by z value to give timely visual feedback.