| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> | 3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> |
| 4 * Copyright (C) 2008, Google Inc. All rights reserved. | 4 * Copyright (C) 2008, Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 size_t ImageSource::clearCacheExceptFrame(size_t clearExceptFrame) | 48 size_t ImageSource::clearCacheExceptFrame(size_t clearExceptFrame) |
| 49 { | 49 { |
| 50 return m_decoder ? m_decoder->clearCacheExceptFrame(clearExceptFrame) : 0; | 50 return m_decoder ? m_decoder->clearCacheExceptFrame(clearExceptFrame) : 0; |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool ImageSource::initialized() const | 53 bool ImageSource::initialized() const |
| 54 { | 54 { |
| 55 return m_decoder; | 55 return m_decoder; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ImageSource::setData(SharedBuffer* data, bool allDataReceived) | 58 void ImageSource::setData(SharedBuffer& data, bool allDataReceived) |
| 59 { | 59 { |
| 60 // Make the decoder by sniffing the bytes. | 60 // Make the decoder by sniffing the bytes. |
| 61 // This method will examine the data and instantiate an instance of the appr
opriate decoder plugin. | 61 // This method will examine the data and instantiate an instance of the appr
opriate decoder plugin. |
| 62 // If insufficient bytes are available to determine the image type, no decod
er plugin will be | 62 // If insufficient bytes are available to determine the image type, no decod
er plugin will be |
| 63 // made. | 63 // made. |
| 64 if (!m_decoder) | 64 if (!m_decoder) |
| 65 m_decoder = DeferredImageDecoder::create(*data, m_alphaOption, m_gammaAn
dColorProfileOption); | 65 m_decoder = DeferredImageDecoder::create(data, m_alphaOption, m_gammaAnd
ColorProfileOption); |
| 66 | 66 |
| 67 if (m_decoder) | 67 if (m_decoder) |
| 68 m_decoder->setData(data, allDataReceived); | 68 m_decoder->setData(data, allDataReceived); |
| 69 } | 69 } |
| 70 | 70 |
| 71 String ImageSource::filenameExtension() const | 71 String ImageSource::filenameExtension() const |
| 72 { | 72 { |
| 73 return m_decoder ? m_decoder->filenameExtension() : String(); | 73 return m_decoder ? m_decoder->filenameExtension() : String(); |
| 74 } | 74 } |
| 75 | 75 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 unsigned ImageSource::frameBytesAtIndex(size_t index) const | 162 unsigned ImageSource::frameBytesAtIndex(size_t index) const |
| 163 { | 163 { |
| 164 if (!m_decoder) | 164 if (!m_decoder) |
| 165 return 0; | 165 return 0; |
| 166 return m_decoder->frameBytesAtIndex(index); | 166 return m_decoder->frameBytesAtIndex(index); |
| 167 } | 167 } |
| 168 | 168 |
| 169 } | 169 } |
| OLD | NEW |