| 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 15 matching lines...) Expand all Loading... |
| 26 #include "platform/image-decoders/gif/GIFImageDecoder.h" | 26 #include "platform/image-decoders/gif/GIFImageDecoder.h" |
| 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 const ColorBehavior& colorBehavior, |
| 37 sk_sp<SkColorSpace> targetColorSpace, | |
| 38 size_t maxDecodedBytes) | 37 size_t maxDecodedBytes) |
| 39 : ImageDecoder(alphaOption, | 38 : ImageDecoder(alphaOption, colorBehavior, maxDecodedBytes), |
| 40 colorOptions, | |
| 41 std::move(targetColorSpace), | |
| 42 maxDecodedBytes), | |
| 43 m_repetitionCount(cAnimationLoopOnce) {} | 39 m_repetitionCount(cAnimationLoopOnce) {} |
| 44 | 40 |
| 45 GIFImageDecoder::~GIFImageDecoder() {} | 41 GIFImageDecoder::~GIFImageDecoder() {} |
| 46 | 42 |
| 47 void GIFImageDecoder::onSetData(SegmentReader* data) { | 43 void GIFImageDecoder::onSetData(SegmentReader* data) { |
| 48 if (m_reader) | 44 if (m_reader) |
| 49 m_reader->setData(data); | 45 m_reader->setData(data); |
| 50 } | 46 } |
| 51 | 47 |
| 52 int GIFImageDecoder::repetitionCount() const { | 48 int GIFImageDecoder::repetitionCount() const { |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 m_currentBufferSawAlpha = false; | 272 m_currentBufferSawAlpha = false; |
| 277 } | 273 } |
| 278 | 274 |
| 279 bool GIFImageDecoder::canReusePreviousFrameBuffer(size_t frameIndex) const { | 275 bool GIFImageDecoder::canReusePreviousFrameBuffer(size_t frameIndex) const { |
| 280 DCHECK(frameIndex < m_frameBufferCache.size()); | 276 DCHECK(frameIndex < m_frameBufferCache.size()); |
| 281 return m_frameBufferCache[frameIndex].getDisposalMethod() != | 277 return m_frameBufferCache[frameIndex].getDisposalMethod() != |
| 282 ImageFrame::DisposeOverwritePrevious; | 278 ImageFrame::DisposeOverwritePrevious; |
| 283 } | 279 } |
| 284 | 280 |
| 285 } // namespace blink | 281 } // namespace blink |
| OLD | NEW |