gstreamer/subprojects/gst-plugins-bad/ext/rsvg
Nirbheek Chauhan e7598ed521 rsvg: Disable deprecations instead of porting to new librsvg API
`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>
2024-04-25 12:43:07 +00:00
..
gstrsvg.c
gstrsvgdec.c rsvg: Disable deprecations instead of porting to new librsvg API 2024-04-25 12:43:07 +00:00
gstrsvgdec.h Revert "rsvgdec: Fix uses of librsvg functions deprecated since 2.52" 2024-04-25 12:43:07 +00:00
gstrsvgoverlay.c rsvg: Disable deprecations instead of porting to new librsvg API 2024-04-25 12:43:07 +00:00
gstrsvgoverlay.h
meson.build rsvg: Add direct dependency on cairo 2024-03-08 19:01:30 +02:00