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 28 matching lines...) Expand all Loading... | |
| 39 kKTX_Format, | 39 kKTX_Format, |
| 40 | 40 |
| 41 kLastKnownFormat = kKTX_Format, | 41 kLastKnownFormat = kKTX_Format, |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 /** Return the format of image this decoder can decode. If this decoder can decode multiple | 44 /** Return the format of image this decoder can decode. If this decoder can decode multiple |
| 45 formats, kUnknown_Format will be returned. | 45 formats, kUnknown_Format will be returned. |
| 46 */ | 46 */ |
| 47 virtual Format getFormat() const; | 47 virtual Format getFormat() const; |
| 48 | 48 |
| 49 | |
| 50 /** Returns the sizes of each component of the image | |
| 51 */ | |
| 52 virtual bool getImageFormat(SkStream*, SkISize sizes[3]) { | |
|
scroggo
2014/07/18 21:52:40
This name doesn't seem to match what it does. A be
| |
| 53 return false; | |
| 54 } | |
| 55 | |
| 56 /* If the decoder wants to support YUV based decoding, this method must be o verridden. | |
| 57 */ | |
| 58 virtual void setYUVBuffers(void* yuv[3], size_t rowBytes[3]) {} | |
|
scroggo
2014/07/18 21:52:40
For both of these, why not have two functions:
vo
| |
| 59 | |
| 49 /** Return the format of the SkStreamRewindable or kUnknown_Format if it can not be determined. | 60 /** Return the format of the SkStreamRewindable or kUnknown_Format if it can not be determined. |
| 50 Rewinds the stream before returning. | 61 Rewinds the stream before returning. |
| 51 */ | 62 */ |
| 52 static Format GetStreamFormat(SkStreamRewindable*); | 63 static Format GetStreamFormat(SkStreamRewindable*); |
| 53 | 64 |
| 54 /** Return a readable string of the Format provided. | 65 /** Return a readable string of the Format provided. |
| 55 */ | 66 */ |
| 56 static const char* GetFormatName(Format); | 67 static const char* GetFormatName(Format); |
| 57 | 68 |
| 58 /** Return a readable string of the value returned by getFormat(). | 69 /** Return a readable string of the value returned by getFormat(). |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 525 DECLARE_DECODER_CREATOR(WEBPImageDecoder); | 536 DECLARE_DECODER_CREATOR(WEBPImageDecoder); |
| 526 DECLARE_DECODER_CREATOR(PKMImageDecoder); | 537 DECLARE_DECODER_CREATOR(PKMImageDecoder); |
| 527 DECLARE_DECODER_CREATOR(KTXImageDecoder); | 538 DECLARE_DECODER_CREATOR(KTXImageDecoder); |
| 528 | 539 |
| 529 // Typedefs to make registering decoder and formatter callbacks easier. | 540 // Typedefs to make registering decoder and formatter callbacks easier. |
| 530 // These have to be defined outside SkImageDecoder. :( | 541 // These have to be defined outside SkImageDecoder. :( |
| 531 typedef SkTRegistry<SkImageDecoder*(*)(SkStreamRewindable*)> SkImageDecod er_DecodeReg; | 542 typedef SkTRegistry<SkImageDecoder*(*)(SkStreamRewindable*)> SkImageDecod er_DecodeReg; |
| 532 typedef SkTRegistry<SkImageDecoder::Format(*)(SkStreamRewindable*)> SkImageDecod er_FormatReg; | 543 typedef SkTRegistry<SkImageDecoder::Format(*)(SkStreamRewindable*)> SkImageDecod er_FormatReg; |
| 533 | 544 |
| 534 #endif | 545 #endif |
| OLD | NEW |