| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 /* | 44 /* |
| 45 * Recommend a set of destination dimensions given a requested scale | 45 * Recommend a set of destination dimensions given a requested scale |
| 46 */ | 46 */ |
| 47 SkISize onGetScaledDimensions(float desiredScale) const override; | 47 SkISize onGetScaledDimensions(float desiredScale) const override; |
| 48 | 48 |
| 49 /* | 49 /* |
| 50 * Initiates the jpeg decode | 50 * Initiates the jpeg decode |
| 51 */ | 51 */ |
| 52 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes
, const Options&, | 52 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes
, const Options&, |
| 53 SkPMColor*, int*) override; | 53 SkPMColor*, int*, int*) override; |
| 54 | 54 |
| 55 SkEncodedFormat onGetEncodedFormat() const override { | 55 SkEncodedFormat onGetEncodedFormat() const override { |
| 56 return kJPEG_SkEncodedFormat; | 56 return kJPEG_SkEncodedFormat; |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool onRewind() override; | 59 bool onRewind() override; |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 | 62 |
| 63 /* | 63 /* |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 /* | 105 /* |
| 106 * Checks if we can natively scale to the requested dimensions and natively
scales the | 106 * Checks if we can natively scale to the requested dimensions and natively
scales the |
| 107 * dimensions if possible | 107 * dimensions if possible |
| 108 */ | 108 */ |
| 109 bool nativelyScaleToDimensions(uint32_t width, uint32_t height); | 109 bool nativelyScaleToDimensions(uint32_t width, uint32_t height); |
| 110 | 110 |
| 111 // scanline decoding | 111 // scanline decoding |
| 112 Result initializeSwizzler(const SkImageInfo&, const SkCodec::Options&); | 112 Result initializeSwizzler(const SkImageInfo&, const SkCodec::Options&); |
| 113 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opti
ons, | 113 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opti
ons, |
| 114 SkPMColor ctable[], int* ctableCount) override; | 114 SkPMColor ctable[], int* ctableCount) override; |
| 115 Result onGetScanlines(void* dst, int count, size_t rowBytes) override; | 115 uint32_t onGetScanlines(void* dst, int count, size_t rowBytes) override; |
| 116 Result onSkipScanlines(int count) override; | 116 bool onSkipScanlines(int count) override; |
| 117 | 117 |
| 118 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; | 118 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; |
| 119 // We will save the state of the decompress struct after reading the header. | 119 // We will save the state of the decompress struct after reading the header. |
| 120 // This allows us to safely call onGetScaledDimensions() at any time. | 120 // This allows us to safely call onGetScaledDimensions() at any time. |
| 121 const int fReadyState; | 121 const int fReadyState; |
| 122 | 122 |
| 123 // scanline decoding | 123 // scanline decoding |
| 124 SkAutoMalloc fStorage; // Only used if sampling is needed | 124 SkAutoMalloc fStorage; // Only used if sampling is needed |
| 125 uint8_t* fSrcRow; // Only used if sampling is needed | 125 uint8_t* fSrcRow; // Only used if sampling is needed |
| 126 SkAutoTDelete<SkSwizzler> fSwizzler; | 126 SkAutoTDelete<SkSwizzler> fSwizzler; |
| 127 | 127 |
| 128 typedef SkCodec INHERITED; | 128 typedef SkCodec INHERITED; |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 #endif | 131 #endif |
| OLD | NEW |