1. 13 Aug, 2019 1 commit
  2. 30 Jul, 2019 2 commits
  3. 29 Jul, 2019 3 commits
  4. 01 Jul, 2019 1 commit
    • Federico Mena Quintero's avatar
      (#481): Length::parse() - don't expect_exhausted() · b53df7d8
      Federico Mena Quintero authored
      This makes me somewhat concerned, since it means that somewhere in the
      callers we should probably do expect_exhausted(), but we aren't doing
      it currently.
      The specific problem here is that in an SVG with
        <tspan x="2209 2903 3394 3792 4190 4626 5117" y="18611" id="tspan1053">Current</tspan>
      i.e. a tspan with multiple positions in the "x" attribute, the whole
      attribute yields a parse error because there is extra stuff after the
      initial 2209.
      While the text-related elements should realy parse a list of Length
      for their x/y/dx/dy attributes, we'll use this little hack for now:
      let there be extra data after a length value, so at least the first
      value goes through.
      Fixes GNOME/librsvg#481
  5. 04 Jun, 2019 1 commit
  6. 31 May, 2019 1 commit
  7. 24 May, 2019 1 commit
  8. 09 May, 2019 1 commit
  9. 28 Mar, 2019 1 commit
  10. 27 Mar, 2019 2 commits
  11. 20 Mar, 2019 1 commit
  12. 08 Mar, 2019 1 commit
  13. 07 Mar, 2019 1 commit
    • Federico Mena Quintero's avatar
      (#433): Use the old logic when measuring geometries · d0b0da25
      Federico Mena Quintero authored
      The old logic of passing magic viewports/vboxes when measuring
      geometries is incompatible with the new logic of doing everything with
      respect to the caller's viewport.
      So, to keep the old-style geometries working, this makes *that* a
      special case.  DrawingCtx::new() now takes a "measuring" boolean
      argument, and NodeSvg::draw() checks it when setting up its
      This looks like a hack, but I want to think of it as
      behavior-preserving code that just hasn't been refactored yet.
      A bunch of test files jiggled a bit as a result of the new rendering
      logic; I verified them by hand and regenerated them.
      Fixes #433
  14. 06 Mar, 2019 1 commit
  15. 26 Feb, 2019 1 commit
    • Federico Mena Quintero's avatar
      render_to_pixbuf_at_size(): Handle a zero size by returning an empty pixbuf · c1e064b6
      Federico Mena Quintero authored
      SharedImageSurface: disallow creating with a zero-sized Cairo surface
      gdk_pixbuf_get_file_info() uses a GdkPixbufLoader, but in its
      "size-prepared" callback it saves the computed size, and then calls
      gdk_pixbuf_loader_set_size(loader, 0, 0).  Presumably it does to tell
      loaders that it only wanted to know the size, but that they shouldn't
      decode or render the image to a pixbuf buffer.
      Librsvg used to panic when getting (0, 0) from the size_callback:
      - Handle.get_dimensions() would return (0, 0)
      - Handle.get_pixbuf_sub() would create an ImageSurface of size (0, 0),
        which is valid in Cairo's terms.
      - But SharedImageSurface used to do
          data_ptr = NonNull::new(cairo_image_surface_get_data(...)).unwrap()
        which panics when cairo_image_surface_get_data() returs NULL.  This
        is not even guaranteed; I think cairo just passes the (0, 0) down to
        pixman, and pixman ends up doing malloc(0), whose result is
        implementation-defined.  Thus, we can't guarantee that NonNull will
        work.  The caller has to be responsible for not creating zero-sized
        shared surfaces.
  16. 23 Feb, 2019 2 commits
    • Paolo Borelli's avatar
      (#425) Use the test font map for the dimensions unit test · 3c84d67c
      Paolo Borelli authored
      Set up the test font map so that the test does not depend on the
      system settings. This avoids the test failure for the
      "/dimensions/sub/text_position" unit test on ubuntu.
    • Paolo Borelli's avatar
      (#425): set LANGUAGE for the tests · 1dd17e51
      Paolo Borelli authored
      The LC_ALL env var does not override LANGUAGE. Set them both for
      the test so that we have a known environement.
      This fixes the remaining systemLanguage test reported in gitlab#425.
      Also add the trailig ":" so that we test the same case.
  17. 22 Feb, 2019 1 commit
  18. 19 Feb, 2019 1 commit
    • Federico Mena Quintero's avatar
      Don't recurse into get_dimensions() from get_node_geometry() · bb68856d
      Federico Mena Quintero authored
      As an experiment to remove this recursion, this commit does a few
      * Makes get_node_geometry() not call get_dimensions().  This was a
        semi-recursive call when the toplevel SVG has
        width/height="100%" (or any other percentage-based size), and no
        viewBox.  Instead, start with a 1x1 viewport that matches the
        temporary surface used to run the rendering/measuring loop.
      * Make the case where an SVG has no dimensions (no width/height, no
        viewBox, no objects at all) *not* a rendering error.  Remove
        RenderingError::SvgHasNoSize and just render nothing.
      This also makes tests/render-crash not check the result of
      We are just checking whether the rendering doesn't crash; not that
      files actually render without errors.
      For the same reason, don't even try to figure out the SVG's
      dimensions; just render to a constant-sized surface.
  19. 15 Feb, 2019 2 commits
  20. 26 Jan, 2019 1 commit
    • Federico Mena Quintero's avatar
      Revert the subclass branch temporarily · 21efded1
      Federico Mena Quintero authored
      BuildStream's vendoring doesn't deal with arbitrarily referenced
      repositories; because of "cargo vendor" it depends on crates that come
      from crates.io.  Since the subclass branch depends on glib-rs master,
      we'll revert this whole branch temporarily until glib-rs makes a
      (I can't force-push to master a clean revert, hence this revert-changes commit)
      Reverts merge a8f9996e
  21. 24 Jan, 2019 1 commit
  22. 23 Jan, 2019 1 commit
  23. 10 Jan, 2019 1 commit
  24. 09 Jan, 2019 1 commit
  25. 08 Jan, 2019 3 commits
  26. 05 Jan, 2019 1 commit
    • Paolo Borelli's avatar
      handle: move the whole fontmap hack to tests · 2cb8f6ba
      Paolo Borelli authored
      There is no reason to set the default fontmap from within handle.
      Setting the default fontmap is part of setting up the text fixture
      and can live in test-utils. Beside we do not need to hold on to
      the fontmap pointer, since setting by the default pango keeps its
      own reference.
  27. 02 Jan, 2019 1 commit
  28. 01 Jan, 2019 1 commit
  29. 29 Dec, 2018 1 commit
  30. 28 Dec, 2018 3 commits
    • Paolo Borelli's avatar
      tests: test pixbuf contents · 77f94b29
      Paolo Borelli authored
      Compare the content returned by the pixbuf api with
      the one rendered with the cairo api. Since we do not
      want to depend on GDK, we copy an utility function from
    • Paolo Borelli's avatar
      tests: move compare_surfaces to test-utils · 9b1d2e47
      Paolo Borelli authored
      We will use it also in the rsvg_handle_get_pixbuf tests.
    • Federico Mena Quintero's avatar
      Move failing test to ignore-filters-displace-01-f.svg · 8f7d4f94
      Federico Mena Quintero authored
      This test fails because its rendered text is offset a bit from what it
      used to be.  This happens because xml:space normalization is a bit
      funky in this branch.
      "Funky" means that XML space handling is underspecified in the SVG 1.1
      spec.  The 2.0 spec makes it more complicated; not idea if it is
      I'll disable this test for now and take care of space handling later.
      I'd rather have the refactored text code instead of the old recursive