-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
nirvn
approved these changes
Jun 24, 2024
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport #57799
Authored by: @nyalldawson