OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
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 * Portions are Copyright (C) 2001 mozilla.org | 5 * Portions are Copyright (C) 2001 mozilla.org |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Stuart Parmenter <stuart@mozilla.com> | 8 * Stuart Parmenter <stuart@mozilla.com> |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 longjmp(JMPBUF(reader_->PngPtr()), 1); | 461 longjmp(JMPBUF(reader_->PngPtr()), 1); |
462 return; | 462 return; |
463 } | 463 } |
464 | 464 |
465 if (!current_buffer_saw_alpha_) | 465 if (!current_buffer_saw_alpha_) |
466 CorrectAlphaWhenFrameBufferSawNoAlpha(current_frame_); | 466 CorrectAlphaWhenFrameBufferSawNoAlpha(current_frame_); |
467 | 467 |
468 buffer.SetStatus(ImageFrame::kFrameComplete); | 468 buffer.SetStatus(ImageFrame::kFrameComplete); |
469 } | 469 } |
470 | 470 |
471 bool PNGImageDecoder::FrameIsCompleteAtIndex(size_t index) const { | 471 bool PNGImageDecoder::FrameIsReceivedAtIndex(size_t index) const { |
472 if (!IsDecodedSizeAvailable()) | 472 if (!IsDecodedSizeAvailable()) |
473 return false; | 473 return false; |
474 | 474 |
475 DCHECK(!Failed() && reader_); | 475 DCHECK(!Failed() && reader_); |
476 | 476 |
477 // For non-animated images, return whether the status of the frame is | 477 // For non-animated images, return ImageDecoder::FrameIsReceivedAtIndex. |
478 // ImageFrame::FrameComplete with ImageDecoder::FrameIsCompleteAtIndex. | |
479 // This matches the behavior of WEBPImageDecoder. | 478 // This matches the behavior of WEBPImageDecoder. |
480 if (reader_->ParseCompleted() && reader_->FrameCount() == 1) | 479 if (reader_->ParseCompleted() && reader_->FrameCount() == 1) |
481 return ImageDecoder::FrameIsCompleteAtIndex(index); | 480 return ImageDecoder::FrameIsReceivedAtIndex(index); |
482 | 481 |
483 return reader_->FrameIsReceivedAtIndex(index); | 482 return reader_->FrameIsReceivedAtIndex(index); |
484 } | 483 } |
485 | 484 |
486 float PNGImageDecoder::FrameDurationAtIndex(size_t index) const { | 485 float PNGImageDecoder::FrameDurationAtIndex(size_t index) const { |
487 if (index < frame_buffer_cache_.size()) | 486 if (index < frame_buffer_cache_.size()) |
488 return frame_buffer_cache_[index].Duration(); | 487 return frame_buffer_cache_[index].Duration(); |
489 return 0; | 488 return 0; |
490 } | 489 } |
491 | 490 |
492 } // namespace blink | 491 } // namespace blink |
OLD | NEW |