| 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 bool onDimensionsSupported(const SkISize&) override; | 61 bool onDimensionsSupported(const SkISize&) override; |
| 62 | 62 |
| 63 private: | 63 private: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de
coderMgr); | 96 SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* de
coderMgr); |
| 97 | 97 |
| 98 /* | 98 /* |
| 99 * Checks if the conversion between the input image and the requested output | 99 * Checks if the conversion between the input image and the requested output |
| 100 * image has been implemented | 100 * image has been implemented |
| 101 * Sets the output color space | 101 * Sets the output color space |
| 102 */ | 102 */ |
| 103 bool setOutputColorSpace(const SkImageInfo& dst); | 103 bool setOutputColorSpace(const SkImageInfo& dst); |
| 104 | 104 |
| 105 // scanline decoding | 105 // scanline decoding |
| 106 SkSampler* getSampler() override; | 106 SkSampler* getSampler(bool createIfNecessary) override; |
| 107 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opti
ons, | 107 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opti
ons, |
| 108 SkPMColor ctable[], int* ctableCount) override; | 108 SkPMColor ctable[], int* ctableCount) override; |
| 109 Result onGetScanlines(void* dst, int count, size_t rowBytes) override; | 109 int onGetScanlines(void* dst, int count, size_t rowBytes) override; |
| 110 Result onSkipScanlines(int count) override; | 110 bool onSkipScanlines(int count) override; |
| 111 | 111 |
| 112 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; | 112 SkAutoTDelete<JpegDecoderMgr> fDecoderMgr; |
| 113 // We will save the state of the decompress struct after reading the header. | 113 // We will save the state of the decompress struct after reading the header. |
| 114 // This allows us to safely call onGetScaledDimensions() at any time. | 114 // This allows us to safely call onGetScaledDimensions() at any time. |
| 115 const int fReadyState; | 115 const int fReadyState; |
| 116 | 116 |
| 117 // scanline decoding | 117 // scanline decoding |
| 118 SkAutoMalloc fStorage; // Only used if sampling is needed | 118 SkAutoMalloc fStorage; // Only used if sampling is needed |
| 119 uint8_t* fSrcRow; // Only used if sampling is needed | 119 uint8_t* fSrcRow; // Only used if sampling is needed |
| 120 SkAutoTDelete<SkSwizzler> fSwizzler; | 120 SkAutoTDelete<SkSwizzler> fSwizzler; |
| 121 | 121 |
| 122 typedef SkCodec INHERITED; | 122 typedef SkCodec INHERITED; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 #endif | 125 #endif |
| OLD | NEW |