| 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 #ifndef SkSampledCodec_DEFINED | 7 #ifndef SkSampledCodec_DEFINED |
| 8 #define SkSampledCodec_DEFINED | 8 #define SkSampledCodec_DEFINED |
| 9 | 9 |
| 10 #include "SkAndroidCodec.h" | 10 #include "SkAndroidCodec.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 SkEncodedFormat onGetEncodedFormat() const override { return fCodec->getEnco
dedFormat(); }; | 26 SkEncodedFormat onGetEncodedFormat() const override { return fCodec->getEnco
dedFormat(); }; |
| 27 | 27 |
| 28 SkISize onGetSampledDimensions(int sampleSize) const override; | 28 SkISize onGetSampledDimensions(int sampleSize) const override; |
| 29 | 29 |
| 30 bool onGetSupportedSubset(SkIRect* desiredSubset) const override { return tr
ue; } | 30 bool onGetSupportedSubset(SkIRect* desiredSubset) const override { return tr
ue; } |
| 31 | 31 |
| 32 SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, si
ze_t rowBytes, | 32 SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, si
ze_t rowBytes, |
| 33 const AndroidOptions& options) override; | 33 const AndroidOptions& options) override; |
| 34 | 34 |
| 35 bool onReallyHasAlpha() const override { return fCodec->reallyHasAlpha(); } |
| 36 |
| 35 private: | 37 private: |
| 36 /** | 38 /** |
| 37 * Find the best way to account for native scaling. | 39 * Find the best way to account for native scaling. |
| 38 * | 40 * |
| 39 * Return a size that fCodec can scale to, and adjust sampleSize to finish
scaling. | 41 * Return a size that fCodec can scale to, and adjust sampleSize to finish
scaling. |
| 40 * | 42 * |
| 41 * @param sampleSize As an input, the requested sample size. | 43 * @param sampleSize As an input, the requested sample size. |
| 42 * As an output, sampling needed after letting fCodec | 44 * As an output, sampling needed after letting fCodec |
| 43 * scale to the returned dimensions. | 45 * scale to the returned dimensions. |
| 44 * @param nativeSampleSize Optional output parameter. Will be set to the | 46 * @param nativeSampleSize Optional output parameter. Will be set to the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 55 * provide the scale by sampling. | 57 * provide the scale by sampling. |
| 56 */ | 58 */ |
| 57 SkCodec::Result sampledDecode(const SkImageInfo& info, void* pixels, size_t
rowBytes, | 59 SkCodec::Result sampledDecode(const SkImageInfo& info, void* pixels, size_t
rowBytes, |
| 58 const AndroidOptions& options); | 60 const AndroidOptions& options); |
| 59 | 61 |
| 60 SkAutoTDelete<SkCodec> fCodec; | 62 SkAutoTDelete<SkCodec> fCodec; |
| 61 | 63 |
| 62 typedef SkAndroidCodec INHERITED; | 64 typedef SkAndroidCodec INHERITED; |
| 63 }; | 65 }; |
| 64 #endif // SkSampledCodec_DEFINED | 66 #endif // SkSampledCodec_DEFINED |
| OLD | NEW |