1. 26 Sep, 2017 1 commit
  2. 06 Jun, 2017 1 commit
  3. 02 Jun, 2017 1 commit
  4. 31 May, 2017 1 commit
  5. 30 May, 2017 2 commits
  6. 23 May, 2017 1 commit
  7. 22 May, 2017 1 commit
    • Federico Mena Quintero's avatar
      pattern.rs: Fully implement NodePattern in Rust. Yay! · 3cf93f38
      Federico Mena Quintero authored
      We had an auxiliary Pattern structure, which is what the patterns
      machinery used to resolve patterns at rendering time.  However, the SVG
      data for patterns was still being kept in the C code.  Now we have a
      Rust NodePattern, as expected, and the C code does not have any patterns
      machinery anymore (other than RsvgPaintServer's to actually call up the
      pattern.)
      3cf93f38
  8. 20 May, 2017 1 commit
  9. 18 May, 2017 2 commits
  10. 22 Mar, 2017 1 commit
  11. 21 Mar, 2017 1 commit
  12. 01 Mar, 2017 1 commit
  13. 17 Feb, 2017 3 commits
  14. 08 Feb, 2017 3 commits
  15. 02 Feb, 2017 1 commit
  16. 27 Jan, 2017 1 commit
  17. 14 Dec, 2016 2 commits
    • Federico Mena Quintero's avatar
      Be explicit about how stop-color and stop-opacity are inherited · c32694be
      Federico Mena Quintero authored
      These can live in the <stop> element attributes, or in its style="..."
      attribute.
      
      Neither of them inherits by default; they have to be explicitly
      specified as "inherit" to do that.
      
      Inheritance is from the gradient's parent element, not from where it is
      referenced, hence the call to rsvg_state_reconstruct().
      
      Also, stop-color can be currentColor.
      
      We now have explicit enums to indicate all of these cases.  Previously,
      all the meanings were overloaded into state->has_stop_color and
      state->has_stop_opacity, and those didn't handle all cases correctly.
      
      Added the hexchat.svg icon to the tests, which is how I caught the lack
      of proper handling for style="stop-color: ...;".
      c32694be
    • Federico Mena Quintero's avatar
  18. 02 Dec, 2016 1 commit
  19. 01 Dec, 2016 1 commit
  20. 22 Nov, 2016 3 commits
  21. 18 Nov, 2016 1 commit
  22. 17 Nov, 2016 2 commits
    • Federico Mena Quintero's avatar
      Dispatch creation of new nodes from an array of element names, not a chain of strcmp() · 4b22ec83
      Federico Mena Quintero authored
      Also, the rsvg_new_SOME_NODE_TYPE () constructor functions now take the
      element name.
      
      This lets us:
      
      * Use bsearch() on the sorted array of element names, instead of an
        unordered chain of if (strcmp (...)).  We can replace this later with
        something better like a trie.
      
      * Port things to Rust more easily, since the constructor functions can
        dispatch on their own based on the element name.
      
      * Avoid special cases in the way
        rsvg_new_node_component_transfer_function() and
        rsvg_new_node_light_source() are called; now they dispatch on their
        own based on the element name.
      4b22ec83
    • Federico Mena Quintero's avatar
      node_set_atts(): Check here for the property bag being empty · 58a645cc
      Federico Mena Quintero authored
      Every ::set_atts() implementation used to check on its own whether the
      property bag is empty (common for "plain" SVG elements with no defined
      attributes?) before actually querying the property bag.
      
      Now we do that check in a single place, in the toplevel node_set_atts()
      helper, instead of having each node type do it on its own.
      
      This means that ::set_atts() implementation which do "validation" work
      or any other post-initialization after the attributes have been set,
      will have to support their ::set_atts() not being called at all if there
      are no attributes in the first place.
      58a645cc
  23. 11 Nov, 2016 4 commits
    • Federico Mena Quintero's avatar
      Do not inherit gradient stop color and opacity from the gradient's parent object · e28afe42
      Federico Mena Quintero authored
      Per the spec, stop-color and stop-opacity don't inherit from the
      parent object of a gradient, unless explicitly requested.
      
      This makes the test pservers-grad-18-b.svg pass.
      e28afe42
    • Federico Mena Quintero's avatar
      RsvgGradientStop: store whether the stop's values are valid · 4006aff6
      Federico Mena Quintero authored
      The spec mandates that values for stop offsets are only plain numbers or
      percentages.  We used to handle this more or less implicitly by calling
      _rsvg_css_hand_normalize_length(), using the resulting value, and
      dropping the units.  Now we actually ensure that we get plain numbers
      or percentages, and eliminate this one use of _rsvg_css_hand_normalize_length().
      
      Now, RsvgGradientStop has an is_valid field that says whether the stop
      has valid units.  At rendering time, we can decide what to do about
      gradients with invalid stops:  currently we don't add invalid stops to
      the gradient, but we still render it up to the last valid stop -
      hopefully to make it easier to debug SVG files.
      
      Also, we now ensure that stop offsets are actually in nondecreasing
      order, per the spec.
      
      (I really want to get rid of _rsvg_css_hand_normalize_length(), but
      found these things along the way...)
      4006aff6
    • Federico Mena Quintero's avatar
      Gradients: Don't store "current color" for gradient nodes · b491f38f
      Federico Mena Quintero authored
      Gradient nodes don't need to store a has_current_color flag nor the
      current color:  nodes for gradient stops already contain this
      information, and they already resolve the current color themselves.
      b491f38f
    • Federico Mena Quintero's avatar
      length.rs: New file with RsvgLength and a public rsvg_length_parse() · 03d7716b
      Federico Mena Quintero authored
      This is the parser for SVG length values, converted to Rust.
      
      The new rsvg_length_parse() replaces the old _rsvg_css_parse_length()
      throughout the code.
      03d7716b
  24. 09 Nov, 2016 4 commits
    • Federico Mena Quintero's avatar
      Make rsvg_state_new() / rsvg_state_free() the only way of getting new states · 468f9251
      Federico Mena Quintero authored
      Previously they were allocated on the stack, allocated by hand on the
      heap, allocated with g_slice by rsvg_state_push()...
      
      Make all of that consistent; rsvg_state_new() is the only way to get
      a new state now.
      468f9251
    • Federico Mena Quintero's avatar
      Register newly-created nodes in the defs as soon as possible · c8b08f1d
      Federico Mena Quintero authored
      Don't defer it until each node's implementation of ::set_atts().
      
      This reduces the amount of duplicated code in each implementation of
      ::set_atts().
      c8b08f1d
    • Federico Mena Quintero's avatar
      Rename function to rsvg_defs_register_node_by_id() · e478a290
      Federico Mena Quintero authored
      To make it more clear that the "id" is the XML's id="foo" attribute.
      
      Also, instead of the &something->super.super nonsense, use "self" or
      simply "node" where available.
      e478a290
    • Federico Mena Quintero's avatar
      Make RsvgLength carry its own direction for normalization · 5a85e7cf
      Federico Mena Quintero authored
      This is the pattern that was there before:
      
        foo.some_len = _rsvg_css_parse_length (str);   /* at creation time */
      
        ...
      
        double real_len = _rsvg_css_normalize_length (&foo.some_len, ctx, LENGTH_DIR_HORIZONTAL); /* at rendering time */
      
      This led to a few inconsistencies in the way directions got used -
      sometimes cut&paste errors could creep in and a vertical direction
      would be used for a horizontal length, for example.
      
      This change makes the pattern be
      
        foo.some_len = _rsvg_css_parse_length (str, LENGTH_DIR_HORIZONTAL);   /* at creation time */
      
        ...
      
        double real_len = _rsvg_css_normalize_length (&foo.some_len, ctx); /* at rendering time */
      
      I.e. lengths get their direction-to-be-resolved-as at creation time,
      during parse_length(); this gets stored in a new field length.dir.
      Later, normalize_length() knows which direction to use.
      5a85e7cf