| 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 "SkImageDecoder.h" | 10 #include "SkImageDecoder.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 SkColorType colorType, bool requireUnpremul) override; | 27 SkColorType colorType, bool requireUnpremul) override; |
| 28 | 28 |
| 29 bool conversionSupported(SkColorType colorType) override { | 29 bool conversionSupported(SkColorType colorType) override { |
| 30 // SkBitmapRegionSampler does not allow the client to check if the conve
rsion | 30 // SkBitmapRegionSampler does not allow the client to check if the conve
rsion |
| 31 // is supported. We will return true as a default. If the conversion i
s in | 31 // is supported. We will return true as a default. If the conversion i
s in |
| 32 // fact not supported, decodeRegion() will ignore the prefColorType and
choose | 32 // fact not supported, decodeRegion() will ignore the prefColorType and
choose |
| 33 // its own color type. We catch this and fail non-fatally in our test c
ode. | 33 // its own color type. We catch this and fail non-fatally in our test c
ode. |
| 34 return true; | 34 return true; |
| 35 } | 35 } |
| 36 | 36 |
| 37 SkEncodedFormat getEncodedFormat() override { return (SkEncodedFormat) fDeco
der->getFormat(); } |
| 38 |
| 37 private: | 39 private: |
| 38 | 40 |
| 39 SkAutoTDelete<SkImageDecoder> fDecoder; | 41 SkAutoTDelete<SkImageDecoder> fDecoder; |
| 40 | 42 |
| 41 typedef SkBitmapRegionDecoderInterface INHERITED; | 43 typedef SkBitmapRegionDecoderInterface INHERITED; |
| 42 | 44 |
| 43 }; | 45 }; |
| OLD | NEW |