Chromium Code Reviews| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 if (!m_sizeAvailable) | 146 if (!m_sizeAvailable) |
| 147 decodeSize(); | 147 decodeSize(); |
| 148 return isDecodedSizeAvailable(); | 148 return isDecodedSizeAvailable(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool isDecodedSizeAvailable() const | 151 bool isDecodedSizeAvailable() const |
| 152 { | 152 { |
| 153 return !m_failed && m_sizeAvailable; | 153 return !m_failed && m_sizeAvailable; |
| 154 } | 154 } |
| 155 | 155 |
| 156 // Whether the requested frame is fully decoded. | |
| 157 inline bool frameIsCompleteAtIndex(size_t frameIndex) const | |
|
scroggo_chromium
2016/05/09 21:54:33
Should there be tests for this new method?
Also,
aleksandar.stojiljkovic
2016/05/10 21:59:31
It is public because it is called from PNGImageRea
| |
| 158 { | |
| 159 return (frameIndex < m_frameBufferCache.size()) && (m_frameBufferCache[f rameIndex].getStatus() == ImageFrame::FrameComplete); | |
| 160 } | |
| 161 | |
| 156 virtual IntSize size() const { return m_size; } | 162 virtual IntSize size() const { return m_size; } |
| 157 | 163 |
| 158 // Decoders which downsample images should override this method to | 164 // Decoders which downsample images should override this method to |
| 159 // return the actual decoded size. | 165 // return the actual decoded size. |
| 160 virtual IntSize decodedSize() const { return size(); } | 166 virtual IntSize decodedSize() const { return size(); } |
| 161 | 167 |
| 162 // Image decoders that support YUV decoding must override this to | 168 // Image decoders that support YUV decoding must override this to |
| 163 // provide the size of each component. | 169 // provide the size of each component. |
| 164 virtual IntSize decodedYUVSize(int component) const | 170 virtual IntSize decodedYUVSize(int component) const |
| 165 { | 171 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 virtual int repetitionCount() const { return cAnimationNone; } | 211 virtual int repetitionCount() const { return cAnimationNone; } |
| 206 | 212 |
| 207 // Decodes as much of the requested frame as possible, and returns an | 213 // Decodes as much of the requested frame as possible, and returns an |
| 208 // ImageDecoder-owned pointer. | 214 // ImageDecoder-owned pointer. |
| 209 ImageFrame* frameBufferAtIndex(size_t); | 215 ImageFrame* frameBufferAtIndex(size_t); |
| 210 | 216 |
| 211 // Whether the requested frame has alpha. | 217 // Whether the requested frame has alpha. |
| 212 virtual bool frameHasAlphaAtIndex(size_t) const; | 218 virtual bool frameHasAlphaAtIndex(size_t) const; |
| 213 | 219 |
| 214 // Whether or not the frame is fully received. | 220 // Whether or not the frame is fully received. |
| 215 virtual bool frameIsCompleteAtIndex(size_t) const; | 221 virtual bool frameIsFullyReceivedAtIndex(size_t) const; |
| 216 | 222 |
| 217 // Duration for displaying a frame in seconds. This method is only used by | 223 // Duration for displaying a frame in seconds. This method is only used by |
| 218 // animated images. | 224 // animated images. |
| 219 virtual float frameDurationAtIndex(size_t) const { return 0; } | 225 virtual float frameDurationAtIndex(size_t) const { return 0; } |
| 220 | 226 |
| 221 // Number of bytes in the decoded frame. Returns 0 if the decoder doesn't | 227 // Number of bytes in the decoded frame. Returns 0 if the decoder doesn't |
| 222 // have this frame cached (either because it hasn't been decoded, or because | 228 // have this frame cached (either because it hasn't been decoded, or because |
| 223 // it has been cleared). | 229 // it has been cleared). |
| 224 size_t frameBytesAtIndex(size_t) const; | 230 size_t frameBytesAtIndex(size_t) const; |
| 225 | 231 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 bool m_failed; | 345 bool m_failed; |
| 340 | 346 |
| 341 #if USE(QCMSLIB) | 347 #if USE(QCMSLIB) |
| 342 OwnPtr<qcms_transform> m_sourceToOutputDeviceColorTransform; | 348 OwnPtr<qcms_transform> m_sourceToOutputDeviceColorTransform; |
| 343 #endif | 349 #endif |
| 344 }; | 350 }; |
| 345 | 351 |
| 346 } // namespace blink | 352 } // namespace blink |
| 347 | 353 |
| 348 #endif | 354 #endif |
| OLD | NEW |