| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 | 306 |
| 307 @param format On success, if format is non-null, it is set to the format | 307 @param format On success, if format is non-null, it is set to the format |
| 308 of the decoded buffer. On failure it is ignored. | 308 of the decoded buffer. On failure it is ignored. |
| 309 */ | 309 */ |
| 310 static bool DecodeMemory(const void* buffer, size_t size, SkBitmap* bitmap,
SkColorType pref, | 310 static bool DecodeMemory(const void* buffer, size_t size, SkBitmap* bitmap,
SkColorType pref, |
| 311 Mode, Format* format = NULL); | 311 Mode, Format* format = NULL); |
| 312 static bool DecodeMemory(const void* buffer, size_t size, SkBitmap* bitmap){ | 312 static bool DecodeMemory(const void* buffer, size_t size, SkBitmap* bitmap){ |
| 313 return DecodeMemory(buffer, size, bitmap, kUnknown_SkColorType, kDecodeP
ixels_Mode, NULL); | 313 return DecodeMemory(buffer, size, bitmap, kUnknown_SkColorType, kDecodeP
ixels_Mode, NULL); |
| 314 } | 314 } |
| 315 | 315 |
| 316 /** | |
| 317 * Struct containing information about a pixel destination. | |
| 318 */ | |
| 319 struct Target { | |
| 320 /** | |
| 321 * Pre-allocated memory. | |
| 322 */ | |
| 323 void* fAddr; | |
| 324 | |
| 325 /** | |
| 326 * Rowbytes of the allocated memory. | |
| 327 */ | |
| 328 size_t fRowBytes; | |
| 329 }; | |
| 330 | |
| 331 /** Decode the image stored in the specified SkStreamRewindable, and store t
he result | 316 /** Decode the image stored in the specified SkStreamRewindable, and store t
he result |
| 332 in bitmap. Return true for success or false on failure. | 317 in bitmap. Return true for success or false on failure. |
| 333 | 318 |
| 334 @param pref Prefer this colortype. | 319 @param pref Prefer this colortype. |
| 335 | 320 |
| 336 @param format On success, if format is non-null, it is set to the format | 321 @param format On success, if format is non-null, it is set to the format |
| 337 of the decoded stream. On failure it is ignored. | 322 of the decoded stream. On failure it is ignored. |
| 338 */ | 323 */ |
| 339 static bool DecodeStream(SkStreamRewindable* stream, SkBitmap* bitmap, SkCol
orType pref, Mode, | 324 static bool DecodeStream(SkStreamRewindable* stream, SkBitmap* bitmap, SkCol
orType pref, Mode, |
| 340 Format* format = NULL); | 325 Format* format = NULL); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 DECLARE_DECODER_CREATOR(PKMImageDecoder); | 493 DECLARE_DECODER_CREATOR(PKMImageDecoder); |
| 509 DECLARE_DECODER_CREATOR(KTXImageDecoder); | 494 DECLARE_DECODER_CREATOR(KTXImageDecoder); |
| 510 DECLARE_DECODER_CREATOR(ASTCImageDecoder); | 495 DECLARE_DECODER_CREATOR(ASTCImageDecoder); |
| 511 | 496 |
| 512 // Typedefs to make registering decoder and formatter callbacks easier. | 497 // Typedefs to make registering decoder and formatter callbacks easier. |
| 513 // These have to be defined outside SkImageDecoder. :( | 498 // These have to be defined outside SkImageDecoder. :( |
| 514 typedef SkTRegistry<SkImageDecoder*(*)(SkStreamRewindable*)> SkImageDecod
er_DecodeReg; | 499 typedef SkTRegistry<SkImageDecoder*(*)(SkStreamRewindable*)> SkImageDecod
er_DecodeReg; |
| 515 typedef SkTRegistry<SkImageDecoder::Format(*)(SkStreamRewindable*)> SkImageDecod
er_FormatReg; | 500 typedef SkTRegistry<SkImageDecoder::Format(*)(SkStreamRewindable*)> SkImageDecod
er_FormatReg; |
| 516 | 501 |
| 517 #endif | 502 #endif |
| OLD | NEW |