Hook up pinch-zoom and swipe gestures.

Sets UIPinchGestureRecognizer and UISwipeGestureRecognizers and
passes the result down to the sk_app::Window. To simplify detection,
swipes take precedence over pans, and pans require a single touch.
This is less flexible for the app, but in most cases I think is
what we want.

Bug: skia:8737
Change-Id: Ib031b6ad465d3a353da29d7e0b48a666d4ff8b9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239776
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/tools/viewer/SKPSlide.cpp b/tools/viewer/SKPSlide.cpp
index 5b4d312..1c03a5e 100644
--- a/tools/viewer/SKPSlide.cpp
+++ b/tools/viewer/SKPSlide.cpp
@@ -49,7 +49,9 @@
 
 void SKPSlide::load(SkScalar, SkScalar) {
     fPic = read_picture(fPath.c_str());
-    fCullRect = fPic->cullRect().roundOut();
+    if (fPic) {
+        fCullRect = fPic->cullRect().roundOut();
+    }
 }
 
 void SKPSlide::unload() {