Rework SVG path normalization code

This CL moves normalization code from the SVGPathParser::emit* methods,
into a emitSegment method on a new helper object NormalizingConsumer.
Normalization is a fairly uniform process, and with a more uniform
datastructure to work on (PathSegmentData), it can be simplified.
The new NormalizingConsumer::emitSegment accepts a non-normalized
segment, which it maps to a normalized segment in a few steps:
  1) Convert relative points to absolute.
  2) Convert smooth/quadratic/arc parametrizations to cubics.
  3) Convert non-normalized verbs to normalized.
  4) Update normalization state.

Normalization state (currentPoint, subPathPoint, etc.) is also moved to
the new helper class. The coordinate mode (SVGPathParser::m_mode) is no
longer needed and removed.
The checks for quadratic/cubic curve classes are turned into functions.

BUG=467592

Review URL: https://codereview.chromium.org/1033643003

git-svn-id: svn://svn.chromium.org/blink/trunk@192445 bbb929c8-8fbe-4397-9dbb-9b2b20218538
2 files changed
tree: 1760984203cf337c03912ba0d52769fd020edbfb
  1. third_party/