| 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 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 * Called only by NewFromStream | 88 * Called only by NewFromStream |
| 89 * | 89 * |
| 90 * @param srcInfo contains the source width and height | 90 * @param srcInfo contains the source width and height |
| 91 * @param stream the encoded image data | 91 * @param stream the encoded image data |
| 92 * @param decoderMgr holds decompress struct, src manager, and error manager | 92 * @param decoderMgr holds decompress struct, src manager, and error manager |
| 93 * takes ownership | 93 * takes ownership |
| 94 */ | 94 */ |
| 95 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de
coderMgr); | 95 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de
coderMgr); |
| 96 | 96 |
| 97 /* | 97 /* |
| 98 * Explicit destructor is used to ensure that the scanline decoder is delete
d |
| 99 * before the decode manager. |
| 100 */ |
| 101 ~SkJpegCodec() override; |
| 102 |
| 103 /* |
| 98 * Handles rewinding the input stream if it is necessary | 104 * Handles rewinding the input stream if it is necessary |
| 99 */ | 105 */ |
| 100 bool handleRewind(); | 106 bool handleRewind(); |
| 101 | 107 |
| 102 /* | 108 /* |
| 103 * Checks if we can scale to the requested dimensions and scales the dimensi
ons | 109 * Checks if we can scale to the requested dimensions and scales the dimensi
ons |
| 104 * if possible | 110 * if possible |
| 105 */ | 111 */ |
| 106 bool scaleToDimensions(uint32_t width, uint32_t height); | 112 bool scaleToDimensions(uint32_t width, uint32_t height); |
| 107 | 113 |
| 108 /* | 114 /* |
| 109 * Create the swizzler based on the encoded format | 115 * Create the swizzler based on the encoded format |
| 110 */ | 116 */ |
| 111 void initializeSwizzler(const SkImageInfo& dstInfo, void* dst, size_t dstRow
Bytes, | 117 void initializeSwizzler(const SkImageInfo& dstInfo, void* dst, size_t dstRow
Bytes, |
| 112 const Options& options); | 118 const Options& options); |
| 113 | 119 |
| 114 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; | 120 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; |
| 115 SkAutoTDelete<SkSwizzler> fSwizzler; | 121 SkAutoTDelete<SkSwizzler> fSwizzler; |
| 116 size_t fSrcRowBytes; | 122 size_t fSrcRowBytes; |
| 117 | 123 |
| 118 friend class SkJpegScanlineDecoder; | 124 friend class SkJpegScanlineDecoder; |
| 119 | 125 |
| 120 typedef SkCodec INHERITED; | 126 typedef SkCodec INHERITED; |
| 121 }; | 127 }; |
| 122 | 128 |
| 123 #endif | 129 #endif |
| OLD | NEW |