| 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 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkBitmapRegionDecoderInterface.h" | 9 #include "SkBitmapRegionDecoderInterface.h" |
| 10 #include "SkAndroidCodec.h" | 10 #include "SkAndroidCodec.h" |
| 11 | 11 |
| 12 /* | 12 /* |
| 13 * This class implements SkBitmapRegionDecoder using an SkAndroidCodec. | 13 * This class implements SkBitmapRegionDecoder using an SkAndroidCodec. |
| 14 */ | 14 */ |
| 15 class SkBitmapRegionCodec : public SkBitmapRegionDecoderInterface { | 15 class SkBitmapRegionCodec : public SkBitmapRegionDecoderInterface { |
| 16 public: | 16 public: |
| 17 | 17 |
| 18 /* | 18 /* |
| 19 * Takes ownership of pointer to codec | 19 * Takes ownership of pointer to codec |
| 20 */ | 20 */ |
| 21 SkBitmapRegionCodec(SkAndroidCodec* codec); | 21 SkBitmapRegionCodec(SkAndroidCodec* codec); |
| 22 | 22 |
| 23 /* | 23 bool decodeRegion(SkBitmap* bitmap, SkBitmap::Allocator* allocator, |
| 24 * Three differences from the Android version: | 24 const SkIRect& desiredSubset, int sampleSize, |
| 25 * Returns a Skia bitmap instead of an Android bitmap. | 25 SkColorType colorType, bool requireUnpremul) override; |
| 26 * Android version attempts to reuse a recycled bitmap. | |
| 27 * Removed the options object and used parameters for color type and | |
| 28 * sample size. | |
| 29 */ | |
| 30 SkBitmap* decodeRegion(int start_x, int start_y, int width, int height, | |
| 31 int sampleSize, SkColorType prefColorType) override; | |
| 32 | 26 |
| 33 bool conversionSupported(SkColorType colorType) override; | 27 bool conversionSupported(SkColorType colorType) override; |
| 34 | 28 |
| 35 private: | 29 private: |
| 36 | 30 |
| 37 SkAutoTDelete<SkAndroidCodec> fCodec; | 31 SkAutoTDelete<SkAndroidCodec> fCodec; |
| 38 | 32 |
| 39 typedef SkBitmapRegionDecoderInterface INHERITED; | 33 typedef SkBitmapRegionDecoderInterface INHERITED; |
| 40 | 34 |
| 41 }; | 35 }; |
| OLD | NEW |