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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // This method indicates whether the provided frame has enough data to decode | 374 // This method indicates whether the provided frame has enough data to decode |
375 // successive frames that depend on it. It is used by clearCacheExceptFrame | 375 // successive frames that depend on it. It is used by clearCacheExceptFrame |
376 // to determine which frame to keep in cache when the indicated frame is not | 376 // to determine which frame to keep in cache when the indicated frame is not |
377 // yet sufficiently decoded. | 377 // yet sufficiently decoded. |
378 // | 378 // |
379 // The default condition is that the frame status needs to be FramePartial or | 379 // The default condition is that the frame status needs to be FramePartial or |
380 // FrameComplete, since the data of previous frames is copied in | 380 // FrameComplete, since the data of previous frames is copied in |
381 // initFrameBuffer() before setting the status to FramePartial. For WebP, | 381 // initFrameBuffer() before setting the status to FramePartial. For WebP, |
382 // however, the status needs to be FrameComplete since the complete buffer is | 382 // however, the status needs to be FrameComplete since the complete buffer is |
383 // used to do alpha blending in WEBPImageDecoder::applyPostProcessing(). | 383 // used to do alpha blending in WEBPImageDecoder::applyPostProcessing(). |
| 384 // And gif is also treated differently, since it relies on SkCodec which |
| 385 // requires the complete required previous frame. |
384 // | 386 // |
385 // Before calling this, verify that frame |index| exists by checking that | 387 // Before calling this, verify that frame |index| exists by checking that |
386 // |index| is smaller than |m_frameBufferCache|.size(). | 388 // |index| is smaller than |m_frameBufferCache|.size(). |
387 virtual bool frameStatusSufficientForSuccessors(size_t index) { | 389 virtual bool frameStatusSufficientForSuccessors(size_t index) { |
388 DCHECK(index < m_frameBufferCache.size()); | 390 DCHECK(index < m_frameBufferCache.size()); |
389 return m_frameBufferCache[index].getStatus() != ImageFrame::FrameEmpty; | 391 return m_frameBufferCache[index].getStatus() != ImageFrame::FrameEmpty; |
390 } | 392 } |
391 | 393 |
392 private: | 394 private: |
393 enum class SniffResult { JPEG, PNG, GIF, WEBP, ICO, BMP, Invalid }; | 395 enum class SniffResult { JPEG, PNG, GIF, WEBP, ICO, BMP, Invalid }; |
(...skipping 25 matching lines...) Expand all Loading... |
419 bool m_hasHistogrammedColorSpace = false; | 421 bool m_hasHistogrammedColorSpace = false; |
420 | 422 |
421 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr; | 423 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr; |
422 bool m_sourceToTargetColorTransformNeedsUpdate = false; | 424 bool m_sourceToTargetColorTransformNeedsUpdate = false; |
423 std::unique_ptr<SkColorSpaceXform> m_sourceToTargetColorTransform; | 425 std::unique_ptr<SkColorSpaceXform> m_sourceToTargetColorTransform; |
424 }; | 426 }; |
425 | 427 |
426 } // namespace blink | 428 } // namespace blink |
427 | 429 |
428 #endif | 430 #endif |
OLD | NEW |