split getPaint()

SkPictureData::getPaint() is now SkPictureData::optionalPaint(),
and it's got a sibling requiredPaint() that returns a const SkPaint&.

This means we don't have to remember to null check the paints,
and we can signal a bad .skp when a paint should be present but is
missing.  No way to know that for optional paints, of course; the only
part of that function I changed is its name.

Moved these methods out of line.   I never know how that interacts with
function local statics.  They're complex enough to move out anyway.

PS3 implements requiredPaint() with optionalPaint(), I think clearer.

Change-Id: If8ef479262faa80be65eb98e2aef8b769cfa8aa6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308763
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
3 files changed