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/GIFImageDecoder.h | |
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/GIFImageDecoder.h')
-rw-r--r-- | Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h b/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h index f9e1b84d3..56a4010cc 100644 --- a/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h +++ b/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2006 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,10 +10,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR @@ -23,41 +23,40 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef GIFImageDecoder_h -#define GIFImageDecoder_h +#pragma once #include "ImageDecoder.h" -#include <wtf/OwnPtr.h> +#include <wtf/Lock.h> class GIFImageReader; namespace WebCore { // This class decodes the GIF image format. - class GIFImageDecoder : public ImageDecoder { + class GIFImageDecoder final : public ImageDecoder { public: - GIFImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption); + GIFImageDecoder(AlphaOption, GammaAndColorProfileOption); virtual ~GIFImageDecoder(); enum GIFQuery { GIFFullQuery, GIFSizeQuery, GIFFrameCountQuery }; // ImageDecoder - virtual String filenameExtension() const { return "gif"; } - virtual void setData(SharedBuffer* data, bool allDataReceived); - virtual bool isSizeAvailable(); - virtual bool setSize(unsigned width, unsigned height); - virtual size_t frameCount(); - virtual int repetitionCount() const; - virtual ImageFrame* frameBufferAtIndex(size_t index); + String filenameExtension() const override { return "gif"; } + void setData(SharedBuffer& data, bool allDataReceived) override; + bool isSizeAvailable() override; + bool setSize(const IntSize&) override; + size_t frameCount() const override; + RepetitionCount repetitionCount() const override; + ImageFrame* frameBufferAtIndex(size_t index) override; // CAUTION: setFailed() deletes |m_reader|. Be careful to avoid // accessing deleted memory, especially when calling this from inside // GIFImageReader! - virtual bool setFailed(); - virtual void clearFrameBufferCache(size_t clearBeforeFrame); + bool setFailed() override; + void clearFrameBufferCache(size_t clearBeforeFrame) override; // Callbacks from the GIF reader. bool haveDecodedRow(unsigned frameIndex, const Vector<unsigned char>& rowBuffer, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels); - bool frameComplete(unsigned frameIndex, unsigned frameDuration, ImageFrame::FrameDisposalMethod disposalMethod); + bool frameComplete(unsigned frameIndex, unsigned frameDuration, ImageFrame::DisposalMethod); void gifComplete(); private: @@ -73,10 +72,9 @@ namespace WebCore { bool initFrameBuffer(unsigned frameIndex); bool m_currentBufferSawAlpha; - mutable int m_repetitionCount; - OwnPtr<GIFImageReader> m_reader; + mutable RepetitionCount m_repetitionCount { RepetitionCountOnce }; + std::unique_ptr<GIFImageReader> m_reader; + Lock m_decodeLock; }; } // namespace WebCore - -#endif |