| 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) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (!m_sizeAvailable) | 154 if (!m_sizeAvailable) |
| 155 decodeSize(); | 155 decodeSize(); |
| 156 return isDecodedSizeAvailable(); | 156 return isDecodedSizeAvailable(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool isDecodedSizeAvailable() const | 159 bool isDecodedSizeAvailable() const |
| 160 { | 160 { |
| 161 return !m_failed && m_sizeAvailable; | 161 return !m_failed && m_sizeAvailable; |
| 162 } | 162 } |
| 163 | 163 |
| 164 // Whether the requested frame is fully decoded. |
| 165 inline bool frameIsCompleteAtIndex(size_t frameIndex) const |
| 166 { |
| 167 return (frameIndex < m_frameBufferCache.size()) && (m_frameBufferCache[f
rameIndex].getStatus() == ImageFrame::FrameComplete); |
| 168 } |
| 169 |
| 164 virtual IntSize size() const { return m_size; } | 170 virtual IntSize size() const { return m_size; } |
| 165 | 171 |
| 166 // Decoders which downsample images should override this method to | 172 // Decoders which downsample images should override this method to |
| 167 // return the actual decoded size. | 173 // return the actual decoded size. |
| 168 virtual IntSize decodedSize() const { return size(); } | 174 virtual IntSize decodedSize() const { return size(); } |
| 169 | 175 |
| 170 // Image decoders that support YUV decoding must override this to | 176 // Image decoders that support YUV decoding must override this to |
| 171 // provide the size of each component. | 177 // provide the size of each component. |
| 172 virtual IntSize decodedYUVSize(int component) const | 178 virtual IntSize decodedYUVSize(int component) const |
| 173 { | 179 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 virtual int repetitionCount() const { return cAnimationNone; } | 219 virtual int repetitionCount() const { return cAnimationNone; } |
| 214 | 220 |
| 215 // Decodes as much of the requested frame as possible, and returns an | 221 // Decodes as much of the requested frame as possible, and returns an |
| 216 // ImageDecoder-owned pointer. | 222 // ImageDecoder-owned pointer. |
| 217 ImageFrame* frameBufferAtIndex(size_t); | 223 ImageFrame* frameBufferAtIndex(size_t); |
| 218 | 224 |
| 219 // Whether the requested frame has alpha. | 225 // Whether the requested frame has alpha. |
| 220 virtual bool frameHasAlphaAtIndex(size_t) const; | 226 virtual bool frameHasAlphaAtIndex(size_t) const; |
| 221 | 227 |
| 222 // Whether or not the frame is fully received. | 228 // Whether or not the frame is fully received. |
| 223 virtual bool frameIsCompleteAtIndex(size_t) const; | 229 virtual bool frameIsFullyReceivedAtIndex(size_t) const; |
| 224 | 230 |
| 225 // Duration for displaying a frame in seconds. This method is only used by | 231 // Duration for displaying a frame in seconds. This method is only used by |
| 226 // animated images. | 232 // animated images. |
| 227 virtual float frameDurationAtIndex(size_t) const { return 0; } | 233 virtual float frameDurationAtIndex(size_t) const { return 0; } |
| 228 | 234 |
| 229 // Number of bytes in the decoded frame. Returns 0 if the decoder doesn't | 235 // Number of bytes in the decoded frame. Returns 0 if the decoder doesn't |
| 230 // have this frame cached (either because it hasn't been decoded, or because | 236 // have this frame cached (either because it hasn't been decoded, or because |
| 231 // it has been cleared). | 237 // it has been cleared). |
| 232 virtual size_t frameBytesAtIndex(size_t) const; | 238 virtual size_t frameBytesAtIndex(size_t) const; |
| 233 | 239 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 bool m_failed; | 353 bool m_failed; |
| 348 | 354 |
| 349 #if USE(QCMSLIB) | 355 #if USE(QCMSLIB) |
| 350 OwnPtr<qcms_transform> m_sourceToOutputDeviceColorTransform; | 356 OwnPtr<qcms_transform> m_sourceToOutputDeviceColorTransform; |
| 351 #endif | 357 #endif |
| 352 }; | 358 }; |
| 353 | 359 |
| 354 } // namespace blink | 360 } // namespace blink |
| 355 | 361 |
| 356 #endif | 362 #endif |
| OLD | NEW |