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/ico/ICOImageDecoder.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/ico/ICOImageDecoder.h')
-rw-r--r-- | Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h index a909deb80..b1bc5ade6 100644 --- a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h +++ b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h @@ -28,8 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ICOImageDecoder_h -#define ICOImageDecoder_h +#pragma once #include "BMPImageReader.h" @@ -38,25 +37,25 @@ namespace WebCore { class PNGImageDecoder; // This class decodes the ICO and CUR image formats. - class ICOImageDecoder : public ImageDecoder { + class ICOImageDecoder final : public ImageDecoder { public: - ICOImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption); + ICOImageDecoder(AlphaOption, GammaAndColorProfileOption); virtual ~ICOImageDecoder(); // ImageDecoder - virtual String filenameExtension() const { return "ico"; } - virtual void setData(SharedBuffer*, bool allDataReceived); - virtual bool isSizeAvailable(); - virtual IntSize size() const; - virtual IntSize frameSizeAtIndex(size_t) const; - virtual bool setSize(unsigned width, unsigned height); - virtual size_t frameCount(); - virtual ImageFrame* frameBufferAtIndex(size_t); + String filenameExtension() const override { return "ico"; } + void setData(SharedBuffer&, bool allDataReceived) override; + bool isSizeAvailable() override; + IntSize size() override; + IntSize frameSizeAtIndex(size_t, SubsamplingLevel) override; + bool setSize(const IntSize&) override; + size_t frameCount() const override; + ImageFrame* frameBufferAtIndex(size_t) override; // CAUTION: setFailed() deletes all readers and decoders. Be careful to // avoid accessing deleted memory, especially when calling this from // inside BMPImageReader! - virtual bool setFailed(); - virtual bool hotSpot(IntPoint&) const; + bool setFailed() override; + std::optional<IntPoint> hotSpot() const override; private: enum ImageType { @@ -116,9 +115,8 @@ namespace WebCore { // could be decoded. bool processDirectoryEntries(); - // Stores the hot-spot for |index| in |hotSpot| and returns true, - // or returns false if there is none. - bool hotSpotAtIndex(size_t index, IntPoint& hotSpot) const; + // Returns the hot-spot for |index|, returns std::nullopt if there is none. + std::optional<IntPoint> hotSpotAtIndex(size_t) const; // Reads and returns a directory entry from the current offset into // |data|. @@ -141,9 +139,9 @@ namespace WebCore { IconDirectoryEntries m_dirEntries; // The image decoders for the various frames. - typedef Vector<OwnPtr<BMPImageReader> > BMPReaders; + typedef Vector<std::unique_ptr<BMPImageReader>> BMPReaders; BMPReaders m_bmpReaders; - typedef Vector<OwnPtr<PNGImageDecoder> > PNGDecoders; + typedef Vector<std::unique_ptr<PNGImageDecoder>> PNGDecoders; PNGDecoders m_pngDecoders; // Valid only while a BMPImageReader is decoding, this holds the size @@ -152,5 +150,3 @@ namespace WebCore { }; } // namespace WebCore - -#endif |