| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 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 | 8 |
| 9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
| 10 #include "SkImageEncoder.h" | 10 #include "SkImageEncoder.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 cinfo.err->msg_code, buffer, caller, width, height); | 338 cinfo.err->msg_code, buffer, caller, width, height); |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 | 341 |
| 342 static bool return_false(const jpeg_decompress_struct& cinfo, | 342 static bool return_false(const jpeg_decompress_struct& cinfo, |
| 343 const char caller[]) { | 343 const char caller[]) { |
| 344 print_jpeg_decoder_errors(cinfo, 0, 0, caller); | 344 print_jpeg_decoder_errors(cinfo, 0, 0, caller); |
| 345 return false; | 345 return false; |
| 346 } | 346 } |
| 347 | 347 |
| 348 #ifdef SK_BUILD_FOR_ANDROID |
| 348 static bool return_false(const jpeg_decompress_struct& cinfo, | 349 static bool return_false(const jpeg_decompress_struct& cinfo, |
| 349 const SkBitmap& bm, const char caller[]) { | 350 const SkBitmap& bm, const char caller[]) { |
| 350 print_jpeg_decoder_errors(cinfo, bm.width(), bm.height(), caller); | 351 print_jpeg_decoder_errors(cinfo, bm.width(), bm.height(), caller); |
| 351 return false; | 352 return false; |
| 352 } | 353 } |
| 354 #endif |
| 353 | 355 |
| 354 static SkImageDecoder::Result return_failure(const jpeg_decompress_struct& cinfo
, | 356 static SkImageDecoder::Result return_failure(const jpeg_decompress_struct& cinfo
, |
| 355 const SkBitmap& bm, const char call
er[]) { | 357 const SkBitmap& bm, const char call
er[]) { |
| 356 print_jpeg_decoder_errors(cinfo, bm.width(), bm.height(), caller); | 358 print_jpeg_decoder_errors(cinfo, bm.width(), bm.height(), caller); |
| 357 return SkImageDecoder::kFailure; | 359 return SkImageDecoder::kFailure; |
| 358 } | 360 } |
| 359 | 361 |
| 360 /////////////////////////////////////////////////////////////////////////////// | 362 /////////////////////////////////////////////////////////////////////////////// |
| 361 | 363 |
| 362 // Convert a scanline of CMYK samples to RGBX in place. Note that this | 364 // Convert a scanline of CMYK samples to RGBX in place. Note that this |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1445 return SkImageDecoder::kUnknown_Format; | 1447 return SkImageDecoder::kUnknown_Format; |
| 1446 } | 1448 } |
| 1447 | 1449 |
| 1448 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { | 1450 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { |
| 1449 return (SkImageEncoder::kJPEG_Type == t) ? SkNEW(SkJPEGImageEncoder) : NULL; | 1451 return (SkImageEncoder::kJPEG_Type == t) ? SkNEW(SkJPEGImageEncoder) : NULL; |
| 1450 } | 1452 } |
| 1451 | 1453 |
| 1452 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); | 1454 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); |
| 1453 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); | 1455 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); |
| 1454 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); | 1456 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); |
| OLD | NEW |