[sksg] Fix paint inval

Paint nodes contribute to invalidation.  Hoist the inval logic from
geometry nodes to draw nodes.

TBR=
Change-Id: Iab33086c377ef4940a84dae3cdccb2c9bdbee99c
Reviewed-on: https://skia-review.googlesource.com/89901
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/samplecode/SampleSGInval.cpp b/samplecode/SampleSGInval.cpp
index 08bfd64..44cdcb9 100644
--- a/samplecode/SampleSGInval.cpp
+++ b/samplecode/SampleSGInval.cpp
@@ -62,6 +62,10 @@
     }
 
     bool onAnimate(const SkAnimTimer& timer) override {
+        if (!fRoot) {
+            return true;
+        }
+
         static constexpr SkScalar kSize = 50;
         static constexpr SkScalar kRate = 1.0f / 500;
         const auto t = timer.msec() * kRate;