[shaper] Ensure empty lines produce an empty run

Users of SkShaper need to be able to handle empty lines and runs. Test
that the shaper implementations begin a line, commit the empty run, and
end the line when given empty input.

Update SkShaper_primitive to pass this test and also produce output more
like a user would expect.

Update SkUTF::CountUTF8 to allow nullptr when the size is 0.

Change-Id: Id2dfb0ea7f26eec7c59beee381a50327fd026c95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/593965
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
3 files changed