DM: add Via abstract class

BUG=skia:

Review URL: https://codereview.chromium.org/1117183007
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 4a3808a..840936c 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -533,7 +533,7 @@
     return SkISize::Make(SkScalarRoundToInt(bounds.width()), SkScalarRoundToInt(bounds.height()));
 }
 
-ViaMatrix::ViaMatrix(SkMatrix matrix, Sink* sink) : fMatrix(matrix), fSink(sink) {}
+ViaMatrix::ViaMatrix(SkMatrix matrix, Sink* sink) : Via(sink), fMatrix(matrix) {}
 
 Error ViaMatrix::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
     SkMatrix matrix = fMatrix;
@@ -546,7 +546,7 @@
 
 // Undoes any flip or 90 degree rotate without changing the scale of the bitmap.
 // This should be pixel-preserving.
-ViaUpright::ViaUpright(SkMatrix matrix, Sink* sink) : fMatrix(matrix), fSink(sink) {}
+ViaUpright::ViaUpright(SkMatrix matrix, Sink* sink) : Via(sink), fMatrix(matrix) {}
 
 Error ViaUpright::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
     Error err = fSink->draw(src, bitmap, stream, log);
@@ -581,8 +581,6 @@
 
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
-ViaPipe::ViaPipe(Sink* sink) : fSink(sink) {}
-
 Error ViaPipe::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
     auto size = src.size();
     return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) {
@@ -595,8 +593,6 @@
 
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
-ViaDeferred::ViaDeferred(Sink* sink) : fSink(sink) {}
-
 Error ViaDeferred::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
     // We draw via a deferred canvas into a surface that's compatible with the original canvas,
     // then snap that surface as an image and draw it into the original canvas.
@@ -621,8 +617,6 @@
 
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
-ViaSerialization::ViaSerialization(Sink* sink) : fSink(sink) {}
-
 Error ViaSerialization::draw(
         const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
     // Record our Src into a picture.
@@ -650,10 +644,10 @@
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 ViaTiles::ViaTiles(int w, int h, SkBBHFactory* factory, Sink* sink)
-    : fW(w)
+    : Via(sink)
+    , fW(w)
     , fH(h)
-    , fFactory(factory)
-    , fSink(sink) {}
+    , fFactory(factory) {}
 
 Error ViaTiles::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
     auto size = src.size();
@@ -703,8 +697,6 @@
 
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
-ViaSecondPicture::ViaSecondPicture(Sink* sink) : fSink(sink) {}
-
 // Draw the Src into two pictures, then draw the second picture into the wrapped Sink.
 // This tests that any shortcuts we may take while recording that second picture are legal.
 Error ViaSecondPicture::draw(
@@ -760,8 +752,6 @@
     void operator()(const SkRecords::SaveLayer& op)            { this->draw(op, fCanvas); }
 };
 
-ViaSingletonPictures::ViaSingletonPictures(Sink* sink) : fSink(sink) {}
-
 // Record Src into a picture, then record it into a macro picture with a sub-picture for each draw.
 // Then play back that macro picture into our wrapped sink.
 Error ViaSingletonPictures::draw(