aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/images/SkImageDecoder_libpng.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/images/SkImageDecoder_libpng.cpp b/src/images/SkImageDecoder_libpng.cpp
index 67214e9fc7..cefbe5e71c 100644
--- a/src/images/SkImageDecoder_libpng.cpp
+++ b/src/images/SkImageDecoder_libpng.cpp
@@ -702,6 +702,11 @@ static inline int pack_palette(SkColorTable* ctable,
class SkPNGImageEncoder : public SkImageEncoder {
protected:
virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality);
+private:
+ bool doEncode(SkWStream* stream, const SkBitmap& bm,
+ const bool& hasAlpha, int colorType,
+ int bitDepth, SkBitmap::Config config,
+ png_color_8& sig_bit);
};
bool SkPNGImageEncoder::onEncode(SkWStream* stream, const SkBitmap& bitmap,
@@ -764,6 +769,15 @@ bool SkPNGImageEncoder::onEncode(SkWStream* stream, const SkBitmap& bitmap,
bitDepth = computeBitDepth(ctable->count());
}
+ return doEncode(stream, bitmap, hasAlpha, colorType,
+ bitDepth, config, sig_bit);
+}
+
+bool SkPNGImageEncoder::doEncode(SkWStream* stream, const SkBitmap& bitmap,
+ const bool& hasAlpha, int colorType,
+ int bitDepth, SkBitmap::Config config,
+ png_color_8& sig_bit) {
+
png_structp png_ptr;
png_infop info_ptr;