Fix Op tests when default typeface is empty.

While testing on Linux with a configuration like

skia_enable_fontmgr_custom_directory=false
skia_enable_fontmgr_custom_embedded=false
skia_enable_fontmgr_custom_empty=true
skia_enable_gpu=true
skia_use_fontconfig=false
skia_use_freetype=true
skia_use_system_freetype2=false

the default typeface will be an empty typeface with no glyphs. This of
course leads to many test failures, which is fine.

However, this also leads to crashes when testing GPU Ops since the Op
factories may return nullptr to indicate no-op but the callers of those
factories currently do not expect nullptr or handle it as a no-op.

Change the callers of Op factories to treat nullptr as no-op.

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