Reland "[svg] Relocate out of experimental"

Move the SVG rendering code to modules/svg, and componentize.
Also split into include/src/utils.

As external clients still reference the old header locations,
introduce temporary forwarding headers to facilitate the migration.

This reverts commit d6cf56fd3400f16aed443807390340c8efdcce1c.

TBR=

Change-Id: Ibadd7c8dc0464ec0c27841530ade0c2098305d20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327344
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 1021b43..eeaa984 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1801,8 +1801,8 @@
       defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
     }
     deps = [
-      ":experimental_svg_model",
       ":flags",
+      "modules/svg",
     ]
     public_deps = [ ":gpu_tool_utils" ]
   }
@@ -1866,7 +1866,6 @@
       sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
     }
     deps = [
-      ":experimental_svg_model",
       ":flags",
       ":skia",
       ":skvm_builders",
@@ -1876,6 +1875,7 @@
       "modules/skparagraph:tests",
       "modules/sksg:tests",
       "modules/skshaper",
+      "modules/svg",
       "//third_party/absl",
       "//third_party/libpng",
       "//third_party/libwebp",
@@ -1901,52 +1901,6 @@
     ]
   }
 
-  # TODO(fmalita): componentize & relocate
-  test_lib("experimental_svg_model") {
-    if (skia_use_expat) {
-      sources = [
-        "experimental/svg/model/SkSVGAttribute.cpp",
-        "experimental/svg/model/SkSVGAttributeParser.cpp",
-        "experimental/svg/model/SkSVGCircle.cpp",
-        "experimental/svg/model/SkSVGClipPath.cpp",
-        "experimental/svg/model/SkSVGContainer.cpp",
-        "experimental/svg/model/SkSVGDOM.cpp",
-        "experimental/svg/model/SkSVGEllipse.cpp",
-        "experimental/svg/model/SkSVGGradient.cpp",
-        "experimental/svg/model/SkSVGLine.cpp",
-        "experimental/svg/model/SkSVGLinearGradient.cpp",
-        "experimental/svg/model/SkSVGNode.cpp",
-        "experimental/svg/model/SkSVGPath.cpp",
-        "experimental/svg/model/SkSVGPattern.cpp",
-        "experimental/svg/model/SkSVGPoly.cpp",
-        "experimental/svg/model/SkSVGRadialGradient.cpp",
-        "experimental/svg/model/SkSVGRect.cpp",
-        "experimental/svg/model/SkSVGRenderContext.cpp",
-        "experimental/svg/model/SkSVGSVG.cpp",
-        "experimental/svg/model/SkSVGShape.cpp",
-        "experimental/svg/model/SkSVGStop.cpp",
-        "experimental/svg/model/SkSVGText.cpp",
-        "experimental/svg/model/SkSVGTransformableNode.cpp",
-        "experimental/svg/model/SkSVGUse.cpp",
-        "experimental/svg/model/SkSVGValue.cpp",
-      ]
-      deps = [
-        ":skia",
-        ":xml",
-      ]
-    }
-  }
-
-  if (skia_use_expat && !skia_use_wuffs) {
-    test_app("svg_tool") {
-      sources = [ "experimental/svg/utils/SvgTool.cpp" ]
-      deps = [
-        ":experimental_svg_model",
-        ":flags",
-      ]
-    }
-  }
-
   test_lib("experimental_xform") {
     sources = [
       "experimental/xform/SkShape.cpp",
@@ -1960,6 +1914,9 @@
     test_app("skottie_tool") {
       deps = [ "modules/skottie:tool" ]
     }
+    test_app("svg_tool") {
+      deps = [ "modules/svg:tool" ]
+    }
   }
 
   test_app("make_skqp_model") {
@@ -1975,13 +1932,13 @@
     }
     public_deps = [ ":tool_utils" ]
     deps = [
-      ":experimental_svg_model",
       ":flags",
       ":gpu_tool_utils",
       ":xml",
       "modules/audioplayer",
       "modules/skparagraph:samples",
       "modules/skshaper",
+      "modules/svg",
     ]
   }
   test_lib("hash_and_encode") {
@@ -2015,7 +1972,6 @@
       deps = [
         ":common_flags_aa",
         ":common_flags_gpu",
-        ":experimental_svg_model",
         ":flags",
         ":gm",
         ":gpu_tool_utils",
@@ -2026,6 +1982,7 @@
         ":trace",
         "modules/skottie",
         "modules/skottie:utils",
+        "modules/svg",
       ]
     }
     test_app("dm") {
@@ -2040,7 +1997,6 @@
         ":common_flags_config",
         ":common_flags_gpu",
         ":common_flags_images",
-        ":experimental_svg_model",
         ":flags",
         ":gm",
         ":gpu_tool_utils",
@@ -2052,6 +2008,7 @@
         "experimental/skrive",
         "modules/skottie",
         "modules/skottie:utils",
+        "modules/svg",
       ]
     }
   }
@@ -2078,7 +2035,6 @@
       ":common_flags_config",
       ":common_flags_gpu",
       ":common_flags_images",
-      ":experimental_svg_model",
       ":flags",
       ":gm",
       ":gpu_tool_utils",
@@ -2087,6 +2043,7 @@
       ":trace",
       "modules/skparagraph",
       "modules/skshaper",
+      "modules/svg",
     ]
   }
 
@@ -2578,7 +2535,6 @@
 
       deps = [
         ":common_flags_gpu",
-        ":experimental_svg_model",
         ":flags",
         ":gm",
         ":gpu_tool_utils",
@@ -2593,6 +2549,7 @@
         "modules/skottie",
         "modules/skottie:utils",
         "modules/sksg:samples",
+        "modules/svg",
         "//third_party/imgui",
       ]
       if (skia_use_experimental_xform) {
@@ -2783,7 +2740,7 @@
         "tools/fonts/TestSVGTypeface.cpp",
         "tools/fonts/TestTypeface.cpp",
       ]
-      deps = [ ":experimental_svg_model" ]
+      deps = [ "modules/svg" ]
     }
 
     libfuzzer_app("region_set_path") {
@@ -2803,7 +2760,7 @@
         "tools/fonts/TestSVGTypeface.cpp",
         "tools/fonts/TestTypeface.cpp",
       ]
-      deps = [ ":experimental_svg_model" ]
+      deps = [ "modules/svg" ]
     }
 
     libfuzzer_app("path_deserialize") {
@@ -2840,7 +2797,7 @@
         "tools/fonts/TestTypeface.cpp",
       ]
       deps = [
-        ":experimental_svg_model",
+        "modules/svg",
         "//third_party/libpng",
       ]
     }
@@ -2914,7 +2871,7 @@
         "tools/fonts/TestTypeface.cpp",
       ]
       deps = [
-        ":experimental_svg_model",
+        "modules/svg",
         "//third_party/libpng",
       ]
     }
@@ -2941,7 +2898,7 @@
           "tools/fonts/TestTypeface.cpp",
         ]
         deps = [
-          ":experimental_svg_model",
+          "modules/svg",
           "//third_party/libpng",
         ]
       }
@@ -2967,7 +2924,7 @@
         "tools/fonts/TestTypeface.cpp",
       ]
       deps = [
-        ":experimental_svg_model",
+        "modules/svg",
         "//third_party/libpng",
       ]
     }
@@ -2991,7 +2948,7 @@
         "tools/fonts/TestTypeface.cpp",
       ]
       deps = [
-        ":experimental_svg_model",
+        "modules/svg",
         "//third_party/libpng",
       ]
     }
@@ -3029,8 +2986,8 @@
         "tools/fonts/TestTypeface.cpp",
       ]
       deps = [
-        ":experimental_svg_model",
         "modules/skottie:skottie",
+        "modules/svg",
       ]
     }
 
@@ -3084,7 +3041,7 @@
 
     libfuzzer_app("svg_dom") {
       sources = [ "fuzz/oss_fuzz/FuzzSVG.cpp" ]
-      deps = [ ":experimental_svg_model" ]
+      deps = [ "modules/svg" ]
     }
 
     libfuzzer_app("skruntimeeffect") {