-
-
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
Force use of raster masking in layout designer preview #49302
Conversation
The vector masking (while great for output quality) is much slower, so for the layout designer preview renders we just use the faster raster approach.
Qgis.MapSettingsFlag.__doc__ = 'Flags which adjust the way maps are rendered.\n\n.. versionadded:: 3.22\n\n' + '* ``Antialiasing``: ' + Qgis.MapSettingsFlag.Antialiasing.__doc__ + '\n' + '* ``DrawEditingInfo``: ' + Qgis.MapSettingsFlag.DrawEditingInfo.__doc__ + '\n' + '* ``ForceVectorOutput``: ' + Qgis.MapSettingsFlag.ForceVectorOutput.__doc__ + '\n' + '* ``UseAdvancedEffects``: ' + Qgis.MapSettingsFlag.UseAdvancedEffects.__doc__ + '\n' + '* ``DrawLabeling``: ' + Qgis.MapSettingsFlag.DrawLabeling.__doc__ + '\n' + '* ``UseRenderingOptimization``: ' + Qgis.MapSettingsFlag.UseRenderingOptimization.__doc__ + '\n' + '* ``DrawSelection``: ' + Qgis.MapSettingsFlag.DrawSelection.__doc__ + '\n' + '* ``DrawSymbolBounds``: ' + Qgis.MapSettingsFlag.DrawSymbolBounds.__doc__ + '\n' + '* ``RenderMapTile``: ' + Qgis.MapSettingsFlag.RenderMapTile.__doc__ + '\n' + '* ``RenderPartialOutput``: ' + Qgis.MapSettingsFlag.RenderPartialOutput.__doc__ + '\n' + '* ``RenderPreviewJob``: ' + Qgis.MapSettingsFlag.RenderPreviewJob.__doc__ + '\n' + '* ``RenderBlocking``: ' + Qgis.MapSettingsFlag.RenderBlocking.__doc__ + '\n' + '* ``LosslessImageRendering``: ' + Qgis.MapSettingsFlag.LosslessImageRendering.__doc__ + '\n' + '* ``Render3DMap``: ' + Qgis.MapSettingsFlag.Render3DMap.__doc__ + '\n' + '* ``HighQualityImageTransforms``: ' + Qgis.MapSettingsFlag.HighQualityImageTransforms.__doc__ + '\n' + '* ``SkipSymbolRendering``: ' + Qgis.MapSettingsFlag.SkipSymbolRendering.__doc__ | ||
QgsMapSettings.ForceRasterMasks = Qgis.MapSettingsFlag.ForceRasterMasks | ||
QgsMapSettings.ForceRasterMasks.is_monkey_patched = True | ||
QgsMapSettings.ForceRasterMasks.__doc__ = "Force symbol masking to be applied using a raster method. This is considerably faster when compared to the vector method, but results in a inferior quality output. (since QGIS 3.26.1)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QgsMapSettings.ForceRasterMasks.__doc__ = "Force symbol masking to be applied using a raster method. This is considerably faster when compared to the vector method, but results in a inferior quality output. (since QGIS 3.26.1)" | |
QgsMapSettings.ForceRasterMasks.__doc__ = "Force symbol masking to be applied using a raster method. This is considerably faster when compared to the vector method, but results in an inferior quality output. (since QGIS 3.26.1)" |
?
@@ -1334,6 +1334,7 @@ class CORE_EXPORT Qgis | |||
Render3DMap = 0x2000, //!< Render is for a 3D map | |||
HighQualityImageTransforms = 0x4000, //!< Enable high quality image transformations, which results in better appearance of scaled or rotated raster components of a map (since QGIS 3.24) | |||
SkipSymbolRendering = 0x8000, //!< Disable symbol rendering while still drawing labels if enabled (since QGIS 3.24) | |||
ForceRasterMasks = 0x10000, //!< Force symbol masking to be applied using a raster method. This is considerably faster when compared to the vector method, but results in a inferior quality output. (since QGIS 3.26.1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ForceRasterMasks = 0x10000, //!< Force symbol masking to be applied using a raster method. This is considerably faster when compared to the vector method, but results in a inferior quality output. (since QGIS 3.26.1) | |
ForceRasterMasks = 0x10000, //!< Force symbol masking to be applied using a raster method. This is considerably faster when compared to the vector method, but results in an inferior quality output. (since QGIS 3.26.1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we wouldn't want to force raster mask on map canvas drawing? Much like the layout designer preview, we don't care that map canvas draws non-vector outputs.
Or are raster masks not looking as good as vector masks?
That's already the case. The reason why layouts use vector is because the map settings flag "ForceVector" is set (so that we don't use rasterised markers, etc). So the new flag overrides ForceVector for the masking functionality alone and forces it back to raster |
@nyalldawson , cool cool. |
Sorry to come back late at this but I try to fix #50543 and I think we should have a way to disable completely vectorization of rendering (and so the selective masking vector way which is really slow)
But, why is it useful to have non-rasterized markers when we export to an image ? or to a pdf where the user didn't check Always export as vectors. Because in that cases we force it to true here and there Should we:
|
The vector masking (while great for output quality) is much slower,
so for the layout designer preview renders we just use the faster
raster approach.