Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-3_38] Greatly optimise selective masking vector exports #57839

Merged
merged 13 commits into from
Jun 24, 2024

Conversation

qgis-bot
Copy link
Collaborator

Backport #57799
Authored by: @nyalldawson

Allows us to know in startRender whether the symbol is actually
a subsymbol for a QgsSymbolLayer. Currently unused.
Optimise the logic used when the new geometry backend for
selective masking is in effect:

Whenever its SAFE, instead of calculating an "entire map" clipping
path and then applying this for every feature being rendered,
we now defer the calculation of the clipping path until we
are rendering individual features. Then, we create a clipping path
which contains ONLY the mask paths which are within the area
being drawn over.

This avoids having the entire map clipping path being used for
EVERY feature being rendered, which results in huge PDF/SVG
exports when masks are in effect, and instead results in
clipping paths which are confined just to a sensible area
around each rendered feature.

In some complex test projects this reduces the PDF export
size by a factor of 0.01!! (and results in PDFs/SVGs which
open much quicker in viewers and editors, and don't grind
their operation to a halt).
These are the symbol layer classes where there's no special logic
required relating to feature rendering and features are rendered
one-by-one, with no sub symbols.
This is a new opt-in flag for map settings/render context/layouts.
If set, then when applying clipping paths for selective masking,
we always use global ("entire map") paths, instead of calculating
local clipping paths per rendered feature. This results in
considerably more complex vector exports in all current Qt versions,
but gives us a way to force this IF/when a future Qt version adds
optimisations which make global masks desirable.
Instead of the extra argument to startRender
@github-actions github-actions bot added this to the 3.38.1 milestone Jun 23, 2024
Copy link

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 6d50d6f)

@nyalldawson nyalldawson merged commit 8a0d9ac into release-3_38 Jun 24, 2024
34 checks passed
@nyalldawson nyalldawson deleted the backport-57799-to-release-3_38 branch June 24, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants