| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkJpegCodec_DEFINED | 8 #ifndef SkJpegCodec_DEFINED |
| 9 #define SkJpegCodec_DEFINED | 9 #define SkJpegCodec_DEFINED |
| 10 | 10 |
| 11 #include "SkCodec.h" | 11 #include "SkCodec.h" |
| 12 #include "SkImageInfo.h" | 12 #include "SkImageInfo.h" |
| 13 #include "SkJpegDecoderMgr.h" | 13 #include "SkJpegDecoderMgr.h" |
| 14 #include "SkJpegUtility_codec.h" | 14 #include "SkJpegUtility_codec.h" |
| 15 #include "SkStream.h" | 15 #include "SkStream.h" |
| 16 #include "SkTemplates.h" |
| 16 | 17 |
| 17 extern "C" { | 18 extern "C" { |
| 18 #include "jpeglib.h" | 19 #include "jpeglib.h" |
| 19 } | 20 } |
| 20 | 21 |
| 21 /* | 22 /* |
| 22 * | 23 * |
| 23 * This class implements the decoding for jpeg images | 24 * This class implements the decoding for jpeg images |
| 24 * | 25 * |
| 25 */ | 26 */ |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 SkPMColor ctable[], int* ctableCount) override; | 105 SkPMColor ctable[], int* ctableCount) override; |
| 105 int onGetScanlines(void* dst, int count, size_t rowBytes) override; | 106 int onGetScanlines(void* dst, int count, size_t rowBytes) override; |
| 106 bool onSkipScanlines(int count) override; | 107 bool onSkipScanlines(int count) override; |
| 107 | 108 |
| 108 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; | 109 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; |
| 109 // We will save the state of the decompress struct after reading the header. | 110 // We will save the state of the decompress struct after reading the header. |
| 110 // This allows us to safely call onGetScaledDimensions() at any time. | 111 // This allows us to safely call onGetScaledDimensions() at any time. |
| 111 const int fReadyState; | 112 const int fReadyState; |
| 112 | 113 |
| 113 // scanline decoding | 114 // scanline decoding |
| 114 SkAutoMalloc fStorage; // Only used if sampling is needed | 115 SkAutoTMalloc<uint8_t> fStorage; // Only used if sampling is needed |
| 115 uint8_t* fSrcRow; // Only used if sampling is needed | 116 uint8_t* fSrcRow; // Only used if sampling is needed |
| 116 SkAutoTDelete<SkSwizzler> fSwizzler; | 117 SkAutoTDelete<SkSwizzler> fSwizzler; |
| 117 | 118 |
| 118 typedef SkCodec INHERITED; | 119 typedef SkCodec INHERITED; |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 #endif | 122 #endif |
| OLD | NEW |