Use shared code for verifying SkSL/child-ptr match.

This logic is about to get used a third time, so it deserved to be
factored out to a helper function. I changed it to use switch instead of
if/else to enforce that all enum values are visited.

Change-Id: I8b55f034cbe62fd1fb396d262bfbc68e9324d740
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430657
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
1 file changed