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 mozilla.org | 4 * Portions are Copyright (C) 2001 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 30 matching lines...) Expand all Loading... |
41 #include "assert.h" | 41 #include "assert.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 // Gamma constants. | 45 // Gamma constants. |
46 const double cMaxGamma = 21474.83; | 46 const double cMaxGamma = 21474.83; |
47 const double cDefaultGamma = 2.2; | 47 const double cDefaultGamma = 2.2; |
48 const double cInverseGamma = 0.45455; | 48 const double cInverseGamma = 0.45455; |
49 | 49 |
50 // Protect against large PNGs. See Mozilla's bug #251381 for more info. | 50 // Protect against large PNGs. See Mozilla's bug #251381 for more info. |
51 const long cMaxPNGSize = 1000000L; | 51 const unsigned long cMaxPNGSize = 1000000UL; |
52 | 52 |
53 // Called if the decoding of the image fails. | 53 // Called if the decoding of the image fails. |
54 static void PNGAPI decodingFailed(png_structp png_ptr, png_const_charp error_msg
); | 54 static void PNGAPI decodingFailed(png_structp png_ptr, png_const_charp error_msg
); |
55 | 55 |
56 // Callbacks given to the read struct. The first is for warnings (we want to tr
eat a particular warning | 56 // Callbacks given to the read struct. The first is for warnings (we want to tr
eat a particular warning |
57 // as an error, which is why we have to register this callback. | 57 // as an error, which is why we have to register this callback. |
58 static void PNGAPI decodingWarning(png_structp png_ptr, png_const_charp warning_
msg); | 58 static void PNGAPI decodingWarning(png_structp png_ptr, png_const_charp warning_
msg); |
59 | 59 |
60 // Called when we have obtained the header information (including the size). | 60 // Called when we have obtained the header information (including the size). |
61 static void PNGAPI headerAvailable(png_structp png_ptr, png_infop info_ptr); | 61 static void PNGAPI headerAvailable(png_structp png_ptr, png_infop info_ptr); |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 { | 402 { |
403 if (m_frameBufferCache.isEmpty()) | 403 if (m_frameBufferCache.isEmpty()) |
404 return; | 404 return; |
405 | 405 |
406 // Hand back an appropriately sized buffer, even if the image ended up being
empty. | 406 // Hand back an appropriately sized buffer, even if the image ended up being
empty. |
407 RGBA32Buffer& buffer = m_frameBufferCache[0]; | 407 RGBA32Buffer& buffer = m_frameBufferCache[0]; |
408 buffer.setStatus(RGBA32Buffer::FrameComplete); | 408 buffer.setStatus(RGBA32Buffer::FrameComplete); |
409 } | 409 } |
410 | 410 |
411 } | 411 } |
OLD | NEW |