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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 // This method indicates whether the provided frame has enough data to decode | 379 // This method indicates whether the provided frame has enough data to decode |
| 380 // successive frames that depend on it. It is used by clearCacheExceptFrame | 380 // successive frames that depend on it. It is used by clearCacheExceptFrame |
| 381 // to determine which frame to keep in cache when the indicated frame is not | 381 // to determine which frame to keep in cache when the indicated frame is not |
| 382 // yet sufficiently decoded. | 382 // yet sufficiently decoded. |
| 383 // | 383 // |
| 384 // The default condition is that the frame status needs to be FramePartial or | 384 // The default condition is that the frame status needs to be FramePartial or |
| 385 // FrameComplete, since the data of previous frames is copied in | 385 // FrameComplete, since the data of previous frames is copied in |
| 386 // initFrameBuffer() before setting the status to FramePartial. For WebP, | 386 // initFrameBuffer() before setting the status to FramePartial. For WebP, |
| 387 // however, the status needs to be FrameComplete since the complete buffer is | 387 // however, the status needs to be FrameComplete since the complete buffer is |
| 388 // used to do alpha blending in WEBPImageDecoder::applyPostProcessing(). | 388 // used to do alpha blending in WEBPImageDecoder::applyPostProcessing(). |
| 389 // And gif is also treated differently, since it relies on SkCodec which | |
|
scroggo_chromium
2017/04/17 20:04:55
IIUC, previously, GIF and APNG required at least k
cblume
2017/04/20 03:42:26
Your understanding is correct.
The way I understan
scroggo_chromium
2017/04/21 20:09:31
It will help if you take a look at the two callsit
cblume
2017/04/21 23:47:38
Okay, I think I follow now.
So I understood that
scroggo_chromium
2017/04/24 15:06:53
I'm not sure that's the case. If this frame is par
| |
| 390 // requires the complete required previous frame. | |
| 389 // | 391 // |
| 390 // Before calling this, verify that frame |index| exists by checking that | 392 // Before calling this, verify that frame |index| exists by checking that |
| 391 // |index| is smaller than |m_frameBufferCache|.size(). | 393 // |index| is smaller than |m_frameBufferCache|.size(). |
| 392 virtual bool FrameStatusSufficientForSuccessors(size_t index) { | 394 virtual bool FrameStatusSufficientForSuccessors(size_t index) { |
| 393 DCHECK(index < frame_buffer_cache_.size()); | 395 DCHECK(index < frame_buffer_cache_.size()); |
| 394 return frame_buffer_cache_[index].GetStatus() != ImageFrame::kFrameEmpty; | 396 return frame_buffer_cache_[index].GetStatus() != ImageFrame::kFrameEmpty; |
| 395 } | 397 } |
| 396 | 398 |
| 397 private: | 399 private: |
| 398 enum class SniffResult { JPEG, PNG, GIF, WEBP, ICO, BMP, kInvalid }; | 400 enum class SniffResult { JPEG, PNG, GIF, WEBP, ICO, BMP, kInvalid }; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 424 bool has_histogrammed_color_space_ = false; | 426 bool has_histogrammed_color_space_ = false; |
| 425 | 427 |
| 426 sk_sp<SkColorSpace> embedded_color_space_ = nullptr; | 428 sk_sp<SkColorSpace> embedded_color_space_ = nullptr; |
| 427 bool source_to_target_color_transform_needs_update_ = false; | 429 bool source_to_target_color_transform_needs_update_ = false; |
| 428 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_; | 430 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_; |
| 429 }; | 431 }; |
| 430 | 432 |
| 431 } // namespace blink | 433 } // namespace blink |
| 432 | 434 |
| 433 #endif | 435 #endif |
| OLD | NEW |