Move all knowledge of X sampling into SkScaledCodec

Prior to this CL, each SkCodec subclass that allows sampling does an
extra check in onStartScanlineDecode to determine whether the X dimension
is supported for sampling. Remove this check, and provide a way for
SkScaledCodec to directly access the SkSwizzler, and update it to do
sampling. This way, the SkCodec knows nothing of sampling, but we can
still save the extra step of sampling afterwards.

FIXME: SkBmpRLECodec still calls SkScaledCodec::DimensionsSupported. It
seems like it could directly support sampling, rather than dealing with
SkScaledCodec (partially).

Add a new base class for SkSwizzler. It allows updating the swizzler
after it was created, which is done by SkScaledCodec. Modify SkSwizzler's
constructor/factory function to stop taking any info about sampling,
assume the sample size is one, and move modifying that into a virtual
function overridden from the base class.

BUG=skia:4284

Review URL: https://codereview.chromium.org/1372973002
diff --git a/src/codec/SkSampler.h b/src/codec/SkSampler.h
new file mode 100644
index 0000000..d7b4c98
--- /dev/null
+++ b/src/codec/SkSampler.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SkSampler_DEFINED
+#define SkSampler_DEFINED
+
+#include "SkTypes.h"
+
+class SkSampler : public SkNoncopyable {
+public:
+    /**
+     *  Update the sampler to sample every sampleX'th pixel. Returns the
+     *  width after sampling.
+     */
+    int setSampleX(int sampleX) {
+        return this->onSetSampleX(sampleX);
+    }
+
+    virtual ~SkSampler() {}
+private:
+    virtual int onSetSampleX(int) = 0;
+};
+
+#endif // SkSampler_DEFINED