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 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // stream. In these cases we should just loop once. | 72 // stream. In these cases we should just loop once. |
73 if (IsAllDataReceived() && ParseCompleted() && reader_->ImagesCount() == 1) | 73 if (IsAllDataReceived() && ParseCompleted() && reader_->ImagesCount() == 1) |
74 repetition_count_ = kAnimationNone; | 74 repetition_count_ = kAnimationNone; |
75 else if (Failed() || (reader_ && (!reader_->ImagesCount()))) | 75 else if (Failed() || (reader_ && (!reader_->ImagesCount()))) |
76 repetition_count_ = kAnimationLoopOnce; | 76 repetition_count_ = kAnimationLoopOnce; |
77 else if (reader_ && reader_->LoopCount() != kCLoopCountNotSeen) | 77 else if (reader_ && reader_->LoopCount() != kCLoopCountNotSeen) |
78 repetition_count_ = reader_->LoopCount(); | 78 repetition_count_ = reader_->LoopCount(); |
79 return repetition_count_; | 79 return repetition_count_; |
80 } | 80 } |
81 | 81 |
82 bool GIFImageDecoder::FrameIsCompleteAtIndex(size_t index) const { | 82 bool GIFImageDecoder::FrameIsReceivedAtIndex(size_t index) const { |
83 return reader_ && (index < reader_->ImagesCount()) && | 83 return reader_ && (index < reader_->ImagesCount()) && |
84 reader_->FrameContext(index)->IsComplete(); | 84 reader_->FrameContext(index)->IsComplete(); |
85 } | 85 } |
86 | 86 |
87 float GIFImageDecoder::FrameDurationAtIndex(size_t index) const { | 87 float GIFImageDecoder::FrameDurationAtIndex(size_t index) const { |
88 return (reader_ && (index < reader_->ImagesCount()) && | 88 return (reader_ && (index < reader_->ImagesCount()) && |
89 reader_->FrameContext(index)->IsHeaderDefined()) | 89 reader_->FrameContext(index)->IsHeaderDefined()) |
90 ? reader_->FrameContext(index)->DelayTime() | 90 ? reader_->FrameContext(index)->DelayTime() |
91 : 0; | 91 : 0; |
92 } | 92 } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 current_buffer_saw_alpha_ = false; | 273 current_buffer_saw_alpha_ = false; |
274 } | 274 } |
275 | 275 |
276 bool GIFImageDecoder::CanReusePreviousFrameBuffer(size_t frame_index) const { | 276 bool GIFImageDecoder::CanReusePreviousFrameBuffer(size_t frame_index) const { |
277 DCHECK(frame_index < frame_buffer_cache_.size()); | 277 DCHECK(frame_index < frame_buffer_cache_.size()); |
278 return frame_buffer_cache_[frame_index].GetDisposalMethod() != | 278 return frame_buffer_cache_[frame_index].GetDisposalMethod() != |
279 ImageFrame::kDisposeOverwritePrevious; | 279 ImageFrame::kDisposeOverwritePrevious; |
280 } | 280 } |
281 | 281 |
282 } // namespace blink | 282 } // namespace blink |
OLD | NEW |