diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp')
-rw-r--r-- | Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp b/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp index b21bbf65c..0965859fe 100644 --- a/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp +++ b/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp @@ -21,7 +21,7 @@ * * Contributor(s): * Chris Saari <saari@netscape.com> - * Apple Computer + * Apple Inc. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -77,7 +77,6 @@ mailing address. #include <string.h> #include "GIFImageDecoder.h" -#include "ImageSource.h" using WebCore::GIFImageDecoder; @@ -322,9 +321,9 @@ bool GIFFrameContext::decode(const unsigned char* data, size_t length, WebCore:: if (!isDataSizeDefined() || !isHeaderDefined()) return true; - m_lzwContext = adoptPtr(new GIFLZWContext(client, this)); + m_lzwContext = std::make_unique<GIFLZWContext>(client, this); if (!m_lzwContext->prepareToDecode()) { - m_lzwContext.clear(); + m_lzwContext = nullptr; return false; } @@ -346,7 +345,7 @@ bool GIFFrameContext::decode(const unsigned char* data, size_t length, WebCore:: // There will be no more decoding for this frame so it's time to cleanup. if (isComplete()) { *frameDecoded = true; - m_lzwContext.clear(); + m_lzwContext = nullptr; } return true; } @@ -447,7 +446,7 @@ bool GIFImageReader::parse(size_t dataPosition, size_t len, bool parseSizeOnly) // CALLBACK: Inform the decoderplugin of our size. // Note: A subsequent frame might have dimensions larger than the "screen" dimensions. - if (m_client && !m_client->setSize(m_screenWidth, m_screenHeight)) + if (m_client && !m_client->setSize(WebCore::IntSize(m_screenWidth, m_screenHeight))) return false; m_screenBgcolor = currentComponent[5]; @@ -568,14 +567,14 @@ bool GIFImageReader::parse(size_t dataPosition, size_t len, bool parseSizeOnly) // We ignore the "user input" bit. - // NOTE: This relies on the values in the FrameDisposalMethod enum + // NOTE: This relies on the values in the DisposalMethod enum // matching those in the GIF spec! int disposalMethod = ((*currentComponent) >> 2) & 0x7; - currentFrame->disposalMethod = static_cast<WebCore::ImageFrame::FrameDisposalMethod>(disposalMethod); + currentFrame->disposalMethod = static_cast<WebCore::ImageFrame::DisposalMethod>(disposalMethod); // Some specs say that disposal method 3 is "overwrite previous", others that setting // the third bit of the field (i.e. method 4) is. We map both to the same value. if (disposalMethod == 4) - currentFrame->disposalMethod = WebCore::ImageFrame::DisposeOverwritePrevious; + currentFrame->disposalMethod = WebCore::ImageFrame::DisposalMethod::RestoreToPrevious; currentFrame->delayTime = GETINT16(currentComponent + 1) * 10; GETN(1, GIFConsumeBlock); break; @@ -624,7 +623,7 @@ bool GIFImageReader::parse(size_t dataPosition, size_t len, bool parseSizeOnly) // Zero loop count is infinite animation loop request. if (!m_loopCount) - m_loopCount = WebCore::cAnimationLoopInfinite; + m_loopCount = WebCore::RepetitionCountInfinite; GETN(1, GIFNetscapeExtensionBlock); } else if (netscapeExtension == 2) { @@ -664,7 +663,7 @@ bool GIFImageReader::parse(size_t dataPosition, size_t len, bool parseSizeOnly) yOffset = 0; // CALLBACK: Inform the decoderplugin of our size. - if (m_client && !m_client->setSize(m_screenWidth, m_screenHeight)) + if (m_client && !m_client->setSize(WebCore::IntSize(m_screenWidth, m_screenHeight))) return false; } @@ -781,7 +780,7 @@ void GIFImageReader::setRemainingBytes(size_t remainingBytes) void GIFImageReader::addFrameIfNecessary() { if (m_frames.isEmpty() || m_frames.last()->isComplete()) - m_frames.append(adoptPtr(new GIFFrameContext(m_frames.size()))); + m_frames.append(std::make_unique<GIFFrameContext>(m_frames.size())); } // FIXME: Move this method to close to doLZW(). |