OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
5 * | 5 * |
6 * Portions are Copyright (C) 2001 mozilla.org | 6 * Portions are Copyright (C) 2001 mozilla.org |
7 * | 7 * |
8 * Other contributors: | 8 * Other contributors: |
9 * Stuart Parmenter <stuart@mozilla.com> | 9 * Stuart Parmenter <stuart@mozilla.com> |
10 * | 10 * |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // Gamma constants. | 60 // Gamma constants. |
61 const double cMaxGamma = 21474.83; | 61 const double cMaxGamma = 21474.83; |
62 const double cDefaultGamma = 2.2; | 62 const double cDefaultGamma = 2.2; |
63 const double cInverseGamma = 0.45455; | 63 const double cInverseGamma = 0.45455; |
64 | 64 |
65 // Protect against large PNGs. See Mozilla's bug #251381 for more info. | 65 // Protect against large PNGs. See Mozilla's bug #251381 for more info. |
66 const unsigned long cMaxPNGSize = 1000000UL; | 66 const unsigned long cMaxPNGSize = 1000000UL; |
67 | 67 |
68 // Called if the decoding of the image fails. | 68 // Called if the decoding of the image fails. |
69 #if PLATFORM(QT) | |
70 static void PNGAPI decodingFailed(png_structp, png_const_charp) NO_RETURN; | |
71 #endif | |
72 static void PNGAPI decodingFailed(png_structp png, png_const_charp) | 69 static void PNGAPI decodingFailed(png_structp png, png_const_charp) |
73 { | 70 { |
74 longjmp(JMPBUF(png), 1); | 71 longjmp(JMPBUF(png), 1); |
75 } | 72 } |
76 | 73 |
77 // Callbacks given to the read struct. The first is for warnings (we want to | 74 // Callbacks given to the read struct. The first is for warnings (we want to |
78 // treat a particular warning as an error, which is why we have to register this | 75 // treat a particular warning as an error, which is why we have to register this |
79 // callback). | 76 // callback). |
80 static void PNGAPI decodingWarning(png_structp png, png_const_charp warningMsg) | 77 static void PNGAPI decodingWarning(png_structp png, png_const_charp warningMsg) |
81 { | 78 { |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // has failed. | 539 // has failed. |
543 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) | 540 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) |
544 setFailed(); | 541 setFailed(); |
545 // If we're done decoding the image, we don't need the PNGImageReader | 542 // If we're done decoding the image, we don't need the PNGImageReader |
546 // anymore. (If we failed, |m_reader| has already been cleared.) | 543 // anymore. (If we failed, |m_reader| has already been cleared.) |
547 else if (isComplete()) | 544 else if (isComplete()) |
548 m_reader.clear(); | 545 m_reader.clear(); |
549 } | 546 } |
550 | 547 |
551 } // namespace WebCore | 548 } // namespace WebCore |
OLD | NEW |