Scanline decoding for bmp

Redesigns SkScanlineDecoder.h to indicate the ordering
in which the scanlines are provided

Refactors SkSwizzler::Fill() to include the zeroInit check
and to actually be correct.

BUG=skia:3257
BUG=skia:4198

Review URL: https://codereview.chromium.org/1287423002
diff --git a/src/codec/SkBmpStandardCodec.h b/src/codec/SkBmpStandardCodec.h
index a7d48c8..fcc246f 100644
--- a/src/codec/SkBmpStandardCodec.h
+++ b/src/codec/SkBmpStandardCodec.h
@@ -36,8 +36,9 @@
      * @param rowOrder indicates whether rows are ordered top-down or bottom-up
      */
     SkBmpStandardCodec(const SkImageInfo& srcInfo, SkStream* stream,
-               uint16_t bitsPerPixel, uint32_t numColors, uint32_t bytesPerColor,
-               uint32_t offset, SkBmpCodec::RowOrder rowOrder, bool isIco);
+            uint16_t bitsPerPixel, uint32_t numColors, uint32_t bytesPerColor,
+            uint32_t offset, SkScanlineDecoder::SkScanlineOrder rowOrder,
+            bool isIco);
 
 protected:
 
@@ -48,6 +49,11 @@
     bool onInIco() const override {
         return fInIco;
     }
+
+    SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo,
+            const SkCodec::Options& options, SkPMColor inputColorPtr[],
+            int* inputColorCount) override;
+
 private:
 
     /*
@@ -58,13 +64,17 @@
 
     bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts);
 
-    Result decode(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, const Options& opts);
+    Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes,
+                      const Options& opts) override;
+
+    Result decodeIcoMask(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes);
 
     SkAutoTUnref<SkColorTable>          fColorTable;     // owned
     const uint32_t                      fNumColors;
     const uint32_t                      fBytesPerColor;
     const uint32_t                      fOffset;
     SkAutoTDelete<SkSwizzler>           fSwizzler;
+    const size_t                        fSrcRowBytes;
     SkAutoTDeleteArray<uint8_t>         fSrcBuffer;
     const bool                          fInIco;