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