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/jpeg/JPEGImageDecoder.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/jpeg/JPEGImageDecoder.h')
-rw-r--r-- | Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h index b1f61a14d..2d79532af 100644 --- a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h +++ b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2006 Apple Inc. All rights reserved. * Copyright (C) 2008-2009 Torch Mobile, Inc. * * Redistribution and use in source and binary forms, with or without @@ -11,10 +11,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 @@ -24,22 +24,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef JPEGImageDecoder_h -#define JPEGImageDecoder_h +#pragma once #include "ImageDecoder.h" #include <stdio.h> // Needed by jpeglib.h for FILE. -#include <wtf/OwnPtr.h> - -#if OS(WINCE) -// Remove warning: 'FAR' macro redefinition -#undef FAR - -// jmorecfg.h in libjpeg checks for XMD_H with the comment: "X11/xmd.h correctly defines INT32" -// fix INT32 redefinition error by pretending we are X11/xmd.h -#define XMD_H -#endif +// ICU defines TRUE and FALSE macros, breaking libjpeg v9 headers +#undef TRUE +#undef FALSE extern "C" { #include "jpeglib.h" } @@ -49,20 +41,20 @@ namespace WebCore { class JPEGImageReader; // This class decodes the JPEG image format. - class JPEGImageDecoder : public ImageDecoder { + class JPEGImageDecoder final : public ImageDecoder { public: - JPEGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption); + JPEGImageDecoder(AlphaOption, GammaAndColorProfileOption); virtual ~JPEGImageDecoder(); // ImageDecoder - virtual String filenameExtension() const { return "jpg"; } - virtual bool isSizeAvailable(); - virtual bool setSize(unsigned width, unsigned height); - virtual ImageFrame* frameBufferAtIndex(size_t index); + String filenameExtension() const override { return "jpg"; } + bool isSizeAvailable() override; + bool setSize(const IntSize&) 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 // JPEGImageReader! - virtual bool setFailed(); + bool setFailed() override; bool willDownSample() { @@ -73,7 +65,6 @@ namespace WebCore { bool outputScanlines(); void jpegComplete(); - void setColorProfile(const ColorProfile& colorProfile) { m_colorProfile = colorProfile; } void setOrientation(ImageOrientation orientation) { m_orientation = orientation; } private: @@ -88,9 +79,7 @@ namespace WebCore { template <J_COLOR_SPACE colorSpace, bool isScaled> bool outputScanlines(ImageFrame& buffer); - OwnPtr<JPEGImageReader> m_reader; + std::unique_ptr<JPEGImageReader> m_reader; }; } // namespace WebCore - -#endif |