Do not allow setting too small or big scale factors #109
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.
Add a check to constraint the allowed device scale factors to the [0.05, 5.0] range, ignoring values outside the interval. For debug builds, an assertion will also make it easier for developers to fix bugs in code that calls the function with invalid values.
Setting the device scale factor to unreasonably low values can result in divisions by zero, wrong rendering, and/or odd behaviour in general; while for too big values graphics buffers will consume unreasonably big amounts of memory or the maximum usable size for them will result in failure to allocate buffers and content being partially rendered (if at all).
While at it, document the
wpe_view_backend_dispatch_set_device_scale_factor()
function.Fixes #89