[svg] Cleanup: drop the presentation attribute SkPaint cache
Instead of attempting to keep fill & stroke SkPaints synchronized with
the current presentation attributes throughout the DAG walk, build the
SkPaints on the fly, only when needed.
This simplifies presentation attribute handling and enables further
/future refactoring.
Change-Id: I3791b4244530644e7e4b983d93b3c966ea7a1b22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355096
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
diff --git a/modules/svg/src/SkSVGText.cpp b/modules/svg/src/SkSVGText.cpp
index b7398d7..17ed02c 100644
--- a/modules/svg/src/SkSVGText.cpp
+++ b/modules/svg/src/SkSVGText.cpp
@@ -440,8 +440,8 @@
fRuns.push_back({
ri.fFont,
- fCurrentFill ? std::make_unique<SkPaint>(*fCurrentFill) : nullptr,
- fCurrentStroke ? std::make_unique<SkPaint>(*fCurrentStroke) : nullptr,
+ fCurrentFill.isValid() ? std::make_unique<SkPaint>(*fCurrentFill) : nullptr,
+ fCurrentStroke.isValid() ? std::make_unique<SkPaint>(*fCurrentStroke) : nullptr,
std::make_unique<SkGlyphID[] >(ri.glyphCount),
std::make_unique<SkPoint[] >(ri.glyphCount),
std::make_unique<PositionAdjustment[]>(ri.glyphCount),