mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
e7598ed521
`rsvg_handle_get_dimensions()` and `rsvg_handle_render_cairo()` are deprecated, and the replacement librsvg functions as specified in the migration guide are `rsvg_handle_get_intrinsic_size_in_pixels()` and `rsvg_handle_render_document()`. However, those are not drop-in replacements, and actually have breaking semantics for our use-case: 1. `intrinsic_size_in_pixels()` requires SVGs to have width+height or the viewBox attribute, but `get_dimensions()` does not. It will calculate the geometry based on element extents recursively. 2. `render_cairo()` simply renders the SVG at its intrinsic size on the specified surface starting at the top-left, maintaining whatever transformations have been applied to the cairo surface, including distorted aspect ratio. However, `render_document()` does not do that, it is specifically for rendering at the specified aspect ratio inside the specified viewport, and if you specify a viewPort that does not match the aspect ratio of the SVG, librsvg will center it. Matching the old behaviour with the new APIs is a lot of work for no benefit. We'd be duplicating code that is already there in librsvg in one case and undoing work that librsvg is doing in the other case. The aspect ratio handling in this element is also kinda atrocious. There is no option to scale the SVG while maintaining the aspect ratio. Overall, element needs a rewrite. Let's just disable deprecations. The API is not going anywhere. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6726> |
||
---|---|---|
.. | ||
gstrsvg.c | ||
gstrsvgdec.c | ||
gstrsvgdec.h | ||
gstrsvgoverlay.c | ||
gstrsvgoverlay.h | ||
meson.build |