fix FM svg harness

Without this we'd assert on empty container size.

Change-Id: I697d607af40ac6e62039be33aedb8ff1732d41b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364839
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2021-02-02 17:48:29 -06:00 committed by Skia Commit-Bot
parent f57207bfaf
commit d1131b6aa0

View File

@ -179,8 +179,10 @@ static void init(Source* source, std::shared_ptr<SkCodec> codec) {
}
static void init(Source* source, sk_sp<SkSVGDOM> svg) {
source->size = svg->containerSize().isEmpty() ? SkISize{1000,1000}
: svg->containerSize().toCeil();
if (svg->containerSize().isEmpty()) {
svg->setContainerSize({1000,1000});
}
source->size = svg->containerSize().toCeil();
source->draw = [svg](SkCanvas* canvas) {
svg->render(canvas);
return ok;