| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "platform/image-decoders/gif/GIFImageReader.h" | 28 #include "platform/image-decoders/gif/GIFImageReader.h" |
| 29 #include "wtf/NotFound.h" | 29 #include "wtf/NotFound.h" |
| 30 #include "wtf/PtrUtil.h" | 30 #include "wtf/PtrUtil.h" |
| 31 #include <limits> | 31 #include <limits> |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 GIFImageDecoder::GIFImageDecoder(AlphaOption alphaOption, | 35 GIFImageDecoder::GIFImageDecoder(AlphaOption alphaOption, |
| 36 ColorSpaceOption colorOptions, | 36 ColorSpaceOption colorOptions, |
| 37 sk_sp<SkColorSpace> targetColorSpace, |
| 37 size_t maxDecodedBytes) | 38 size_t maxDecodedBytes) |
| 38 : ImageDecoder(alphaOption, colorOptions, maxDecodedBytes), | 39 : ImageDecoder(alphaOption, |
| 40 colorOptions, |
| 41 std::move(targetColorSpace), |
| 42 maxDecodedBytes), |
| 39 m_repetitionCount(cAnimationLoopOnce) {} | 43 m_repetitionCount(cAnimationLoopOnce) {} |
| 40 | 44 |
| 41 GIFImageDecoder::~GIFImageDecoder() {} | 45 GIFImageDecoder::~GIFImageDecoder() {} |
| 42 | 46 |
| 43 void GIFImageDecoder::onSetData(SegmentReader* data) { | 47 void GIFImageDecoder::onSetData(SegmentReader* data) { |
| 44 if (m_reader) | 48 if (m_reader) |
| 45 m_reader->setData(data); | 49 m_reader->setData(data); |
| 46 } | 50 } |
| 47 | 51 |
| 48 int GIFImageDecoder::repetitionCount() const { | 52 int GIFImageDecoder::repetitionCount() const { |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 m_currentBufferSawAlpha = false; | 343 m_currentBufferSawAlpha = false; |
| 340 } | 344 } |
| 341 | 345 |
| 342 bool GIFImageDecoder::canReusePreviousFrameBuffer(size_t frameIndex) const { | 346 bool GIFImageDecoder::canReusePreviousFrameBuffer(size_t frameIndex) const { |
| 343 DCHECK(frameIndex < m_frameBufferCache.size()); | 347 DCHECK(frameIndex < m_frameBufferCache.size()); |
| 344 return m_frameBufferCache[frameIndex].getDisposalMethod() != | 348 return m_frameBufferCache[frameIndex].getDisposalMethod() != |
| 345 ImageFrame::DisposeOverwritePrevious; | 349 ImageFrame::DisposeOverwritePrevious; |
| 346 } | 350 } |
| 347 | 351 |
| 348 } // namespace blink | 352 } // namespace blink |
| OLD | NEW |