| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 2001-6 mozilla.org | 4 * Portions are Copyright (C) 2001-6 mozilla.org |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Stuart Parmenter <stuart@mozilla.com> | 7 * Stuart Parmenter <stuart@mozilla.com> |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 ->reader->fillBuffer(); | 703 ->reader->fillBuffer(); |
| 704 } | 704 } |
| 705 | 705 |
| 706 void term_source(j_decompress_ptr jd) { | 706 void term_source(j_decompress_ptr jd) { |
| 707 reinterpret_cast_ptr<decoder_source_mgr*>(jd->src) | 707 reinterpret_cast_ptr<decoder_source_mgr*>(jd->src) |
| 708 ->reader->decoder() | 708 ->reader->decoder() |
| 709 ->complete(); | 709 ->complete(); |
| 710 } | 710 } |
| 711 | 711 |
| 712 JPEGImageDecoder::JPEGImageDecoder(AlphaOption alphaOption, | 712 JPEGImageDecoder::JPEGImageDecoder(AlphaOption alphaOption, |
| 713 ColorSpaceOption colorOptions, | 713 const ColorBehavior& colorBehavior, |
| 714 sk_sp<SkColorSpace> targetColorSpace, | |
| 715 size_t maxDecodedBytes) | 714 size_t maxDecodedBytes) |
| 716 : ImageDecoder(alphaOption, | 715 : ImageDecoder(alphaOption, colorBehavior, maxDecodedBytes) {} |
| 717 colorOptions, | |
| 718 std::move(targetColorSpace), | |
| 719 maxDecodedBytes) {} | |
| 720 | 716 |
| 721 JPEGImageDecoder::~JPEGImageDecoder() {} | 717 JPEGImageDecoder::~JPEGImageDecoder() {} |
| 722 | 718 |
| 723 bool JPEGImageDecoder::setSize(unsigned width, unsigned height) { | 719 bool JPEGImageDecoder::setSize(unsigned width, unsigned height) { |
| 724 if (!ImageDecoder::setSize(width, height)) | 720 if (!ImageDecoder::setSize(width, height)) |
| 725 return false; | 721 return false; |
| 726 | 722 |
| 727 if (!desiredScaleNumerator()) | 723 if (!desiredScaleNumerator()) |
| 728 return setFailed(); | 724 return setFailed(); |
| 729 | 725 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 // has failed. | 1005 // has failed. |
| 1010 if (!m_reader->decode(onlySize) && isAllDataReceived()) | 1006 if (!m_reader->decode(onlySize) && isAllDataReceived()) |
| 1011 setFailed(); | 1007 setFailed(); |
| 1012 | 1008 |
| 1013 // If decoding is done or failed, we don't need the JPEGImageReader anymore. | 1009 // If decoding is done or failed, we don't need the JPEGImageReader anymore. |
| 1014 if (isComplete(this, onlySize) || failed()) | 1010 if (isComplete(this, onlySize) || failed()) |
| 1015 m_reader.reset(); | 1011 m_reader.reset(); |
| 1016 } | 1012 } |
| 1017 | 1013 |
| 1018 } // namespace blink | 1014 } // namespace blink |
| OLD | NEW |