Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 SkImageDecoder_DEFINED | 8 #ifndef SkImageDecoder_DEFINED |
| 9 #define SkImageDecoder_DEFINED | 9 #define SkImageDecoder_DEFINED |
| 10 | 10 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 void setPrefConfigTable(const PrefConfigTable&); | 198 void setPrefConfigTable(const PrefConfigTable&); |
| 199 | 199 |
| 200 /** | 200 /** |
| 201 * Do not use a PrefConfigTable to determine the output config. This | 201 * Do not use a PrefConfigTable to determine the output config. This |
| 202 * is the default, so there is no need to call unless a PrefConfigTable | 202 * is the default, so there is no need to call unless a PrefConfigTable |
| 203 * was previously set. | 203 * was previously set. |
| 204 */ | 204 */ |
| 205 void resetPrefConfigTable() { fUsePrefTable = false; } | 205 void resetPrefConfigTable() { fUsePrefTable = false; } |
| 206 #endif | 206 #endif |
| 207 | 207 |
| 208 /** | |
| 209 * By default, the codec will try to comply with the "pref" colortype | |
| 210 * that is passed to decode() or decodeSubset(). However, this can be calle d | |
| 211 * from a peeker to change that, causing the codec to try to match the | |
|
scroggo
2014/07/08 17:31:07
The only caller is from a Peeker (I suppose so tha
reed1
2014/07/08 17:41:24
Done.
| |
| 212 * src depth instead (as shown below). This is a replacement for calling | |
| 213 * setPrefConfigTable(). | |
|
scroggo
2014/07/08 17:31:07
Do we really need this reference to a deprecated (
reed1
2014/07/08 17:41:24
Done.
| |
| 214 * | |
| 215 * src_8Index -> kIndex_8_SkColorType | |
| 216 * src_8Gray -> kN32_SkColorType | |
| 217 * src_8bpc -> kN32_SkColorType | |
| 218 */ | |
| 219 void setPreserveSrcDepth(bool preserve) { | |
| 220 fPreserveSrcDepth = preserve; | |
| 221 } | |
| 222 | |
| 208 SkBitmap::Allocator* getAllocator() const { return fAllocator; } | 223 SkBitmap::Allocator* getAllocator() const { return fAllocator; } |
| 209 SkBitmap::Allocator* setAllocator(SkBitmap::Allocator*); | 224 SkBitmap::Allocator* setAllocator(SkBitmap::Allocator*); |
| 210 | 225 |
| 211 // sample-size, if set to > 1, tells the decoder to return a smaller than | 226 // sample-size, if set to > 1, tells the decoder to return a smaller than |
| 212 // original bitmap, sampling 1 pixel for every size pixels. e.g. if sample | 227 // original bitmap, sampling 1 pixel for every size pixels. e.g. if sample |
| 213 // size is set to 3, then the returned bitmap will be 1/3 as wide and high, | 228 // size is set to 3, then the returned bitmap will be 1/3 as wide and high, |
| 214 // and will contain 1/9 as many pixels as the original. | 229 // and will contain 1/9 as many pixels as the original. |
| 215 // Note: this is a hint, and the codec may choose to ignore this, or only | 230 // Note: this is a hint, and the codec may choose to ignore this, or only |
| 216 // approximate the sample size. | 231 // approximate the sample size. |
| 217 int getSampleSize() const { return fSampleSize; } | 232 int getSampleSize() const { return fSampleSize; } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 #ifdef SK_SUPPORT_LEGACY_IMAGEDECODER_CHOOSER | 464 #ifdef SK_SUPPORT_LEGACY_IMAGEDECODER_CHOOSER |
| 450 Chooser* fChooser; | 465 Chooser* fChooser; |
| 451 #endif | 466 #endif |
| 452 SkBitmap::Allocator* fAllocator; | 467 SkBitmap::Allocator* fAllocator; |
| 453 int fSampleSize; | 468 int fSampleSize; |
| 454 SkColorType fDefaultPref; // use if fUsePrefTable is false | 469 SkColorType fDefaultPref; // use if fUsePrefTable is false |
| 455 #ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG | 470 #ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG |
| 456 PrefConfigTable fPrefTable; // use if fUsePrefTable is true | 471 PrefConfigTable fPrefTable; // use if fUsePrefTable is true |
| 457 bool fUsePrefTable; | 472 bool fUsePrefTable; |
| 458 #endif | 473 #endif |
| 474 bool fPreserveSrcDepth; | |
| 459 bool fDitherImage; | 475 bool fDitherImage; |
| 460 bool fSkipWritingZeroes; | 476 bool fSkipWritingZeroes; |
| 461 mutable bool fShouldCancelDecode; | 477 mutable bool fShouldCancelDecode; |
| 462 bool fPreferQualityOverSpeed; | 478 bool fPreferQualityOverSpeed; |
| 463 bool fRequireUnpremultipliedColors; | 479 bool fRequireUnpremultipliedColors; |
| 464 }; | 480 }; |
| 465 | 481 |
| 466 /** Calling newDecoder with a stream returns a new matching imagedecoder | 482 /** Calling newDecoder with a stream returns a new matching imagedecoder |
| 467 instance, or NULL if none can be found. The caller must manage its ownership | 483 instance, or NULL if none can be found. The caller must manage its ownership |
| 468 of the stream as usual, calling unref() when it is done, as the returned | 484 of the stream as usual, calling unref() when it is done, as the returned |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 510 DECLARE_DECODER_CREATOR(WEBPImageDecoder); | 526 DECLARE_DECODER_CREATOR(WEBPImageDecoder); |
| 511 DECLARE_DECODER_CREATOR(PKMImageDecoder); | 527 DECLARE_DECODER_CREATOR(PKMImageDecoder); |
| 512 DECLARE_DECODER_CREATOR(KTXImageDecoder); | 528 DECLARE_DECODER_CREATOR(KTXImageDecoder); |
| 513 | 529 |
| 514 // Typedefs to make registering decoder and formatter callbacks easier. | 530 // Typedefs to make registering decoder and formatter callbacks easier. |
| 515 // These have to be defined outside SkImageDecoder. :( | 531 // These have to be defined outside SkImageDecoder. :( |
| 516 typedef SkTRegistry<SkImageDecoder*(*)(SkStreamRewindable*)> SkImageDecod er_DecodeReg; | 532 typedef SkTRegistry<SkImageDecoder*(*)(SkStreamRewindable*)> SkImageDecod er_DecodeReg; |
| 517 typedef SkTRegistry<SkImageDecoder::Format(*)(SkStreamRewindable*)> SkImageDecod er_FormatReg; | 533 typedef SkTRegistry<SkImageDecoder::Format(*)(SkStreamRewindable*)> SkImageDecod er_FormatReg; |
| 518 | 534 |
| 519 #endif | 535 #endif |
| OLD | NEW |