OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 2001 mozilla.org | 5 * Portions are Copyright (C) 2001 mozilla.org |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Stuart Parmenter <stuart@mozilla.com> | 8 * Stuart Parmenter <stuart@mozilla.com> |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void PNGAPI pngComplete(png_structp png, png_infop) | 72 void PNGAPI pngComplete(png_structp png, png_infop) |
73 { | 73 { |
74 imageDecoder(png)->complete(); | 74 imageDecoder(png)->complete(); |
75 } | 75 } |
76 | 76 |
77 void PNGAPI pngFailed(png_structp png, png_const_charp) | 77 void PNGAPI pngFailed(png_structp png, png_const_charp) |
78 { | 78 { |
79 longjmp(JMPBUF(png), 1); | 79 longjmp(JMPBUF(png), 1); |
80 } | 80 } |
81 | 81 |
82 } // anonymous | 82 } // namespace |
83 | 83 |
84 namespace blink { | 84 namespace blink { |
85 | 85 |
86 class PNGImageReader final { | 86 class PNGImageReader final { |
87 USING_FAST_MALLOC(PNGImageReader); | 87 USING_FAST_MALLOC(PNGImageReader); |
88 WTF_MAKE_NONCOPYABLE(PNGImageReader); | 88 WTF_MAKE_NONCOPYABLE(PNGImageReader); |
89 public: | 89 public: |
90 PNGImageReader(PNGImageDecoder* decoder, size_t readOffset) | 90 PNGImageReader(PNGImageDecoder* decoder, size_t readOffset) |
91 : m_decoder(decoder) | 91 : m_decoder(decoder) |
92 , m_readOffset(readOffset) | 92 , m_readOffset(readOffset) |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 // has failed. | 503 // has failed. |
504 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) | 504 if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived()) |
505 setFailed(); | 505 setFailed(); |
506 | 506 |
507 // If decoding is done or failed, we don't need the PNGImageReader anymore. | 507 // If decoding is done or failed, we don't need the PNGImageReader anymore. |
508 if (isComplete(this) || failed()) | 508 if (isComplete(this) || failed()) |
509 m_reader.clear(); | 509 m_reader.clear(); |
510 } | 510 } |
511 | 511 |
512 } // namespace blink | 512 } // namespace blink |
OLD | NEW |