Commit 917d8817 authored by Andrey Kraynov's avatar Andrey Kraynov Committed by Commit Bot

Rearrange includes and use more forward declarations for classes in

platform/image-decoders

Re-order includes to match git cl format rules, add forward
declarations where possible.

No change in behavior, no new tests.

Bug:439655

Change-Id: Id80b3f4321e4ff4ef73e0cf3721f08d42a839fe0
Reviewed-on: https://chromium-review.googlesource.com/538674
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480274}
parent 206f5f0f
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "platform/image-decoders/FastSharedBufferReader.h" #include "platform/image-decoders/FastSharedBufferReader.h"
#include "platform/image-decoders/SegmentReader.h" #include "platform/image-decoders/SegmentReader.h"
#include "third_party/skia/include/core/SkRWBuffer.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#define ImageDecoder_h #define ImageDecoder_h
#include <memory> #include <memory>
#include "SkColorPriv.h"
#include "SkColorSpaceXform.h"
#include "platform/PlatformExport.h" #include "platform/PlatformExport.h"
#include "platform/SharedBuffer.h" #include "platform/SharedBuffer.h"
#include "platform/graphics/ColorBehavior.h" #include "platform/graphics/ColorBehavior.h"
...@@ -39,10 +37,10 @@ ...@@ -39,10 +37,10 @@
#include "platform/image-decoders/SegmentReader.h" #include "platform/image-decoders/SegmentReader.h"
#include "platform/wtf/Assertions.h" #include "platform/wtf/Assertions.h"
#include "platform/wtf/RefPtr.h" #include "platform/wtf/RefPtr.h"
#include "platform/wtf/Threading.h"
#include "platform/wtf/Vector.h" #include "platform/wtf/Vector.h"
#include "platform/wtf/text/WTFString.h" #include "platform/wtf/text/WTFString.h"
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
#include "third_party/skia/include/core/SkColorSpaceXform.h"
namespace blink { namespace blink {
...@@ -100,10 +98,10 @@ class PLATFORM_EXPORT ImageDecoder { ...@@ -100,10 +98,10 @@ class PLATFORM_EXPORT ImageDecoder {
static std::unique_ptr<ImageDecoder> Create( static std::unique_ptr<ImageDecoder> Create(
PassRefPtr<SharedBuffer> data, PassRefPtr<SharedBuffer> data,
bool data_complete, bool data_complete,
AlphaOption alphaoption, AlphaOption alpha_option,
const ColorBehavior& color_behavior) { const ColorBehavior& color_behavior) {
return Create(SegmentReader::CreateFromSharedBuffer(std::move(data)), return Create(SegmentReader::CreateFromSharedBuffer(std::move(data)),
data_complete, alphaoption, color_behavior); data_complete, alpha_option, color_behavior);
} }
virtual String FilenameExtension() const = 0; virtual String FilenameExtension() const = 0;
......
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
#include "platform/geometry/IntRect.h" #include "platform/geometry/IntRect.h"
#include "platform/wtf/Allocator.h" #include "platform/wtf/Allocator.h"
#include "platform/wtf/Assertions.h" #include "platform/wtf/Assertions.h"
#include "platform/wtf/PassRefPtr.h"
#include "public/platform/WebVector.h" #include "public/platform/WebVector.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColorPriv.h" #include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkImage.h"
class SkImage;
namespace blink { namespace blink {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "platform/wtf/RefPtr.h" #include "platform/wtf/RefPtr.h"
#include "platform/wtf/ThreadingPrimitives.h" #include "platform/wtf/ThreadingPrimitives.h"
#include "third_party/skia/include/core/SkData.h" #include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkRWBuffer.h"
namespace blink { namespace blink {
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#include "platform/wtf/Noncopyable.h" #include "platform/wtf/Noncopyable.h"
#include "platform/wtf/PassRefPtr.h" #include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/ThreadSafeRefCounted.h" #include "platform/wtf/ThreadSafeRefCounted.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkRWBuffer.h" class SkData;
#include "third_party/skia/include/core/SkRefCnt.h" class SkROBuffer;
namespace blink { namespace blink {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "platform/image-decoders/bmp/BMPImageDecoder.h" #include "platform/image-decoders/bmp/BMPImageDecoder.h"
#include "platform/image-decoders/FastSharedBufferReader.h" #include "platform/image-decoders/FastSharedBufferReader.h"
#include "platform/image-decoders/bmp/BMPImageReader.h"
#include "platform/wtf/PtrUtil.h" #include "platform/wtf/PtrUtil.h"
namespace blink { namespace blink {
...@@ -46,6 +47,8 @@ BMPImageDecoder::BMPImageDecoder(AlphaOption alpha_option, ...@@ -46,6 +47,8 @@ BMPImageDecoder::BMPImageDecoder(AlphaOption alpha_option,
: ImageDecoder(alpha_option, color_behavior, max_decoded_bytes), : ImageDecoder(alpha_option, color_behavior, max_decoded_bytes),
decoded_offset_(0) {} decoded_offset_(0) {}
BMPImageDecoder::~BMPImageDecoder() = default;
void BMPImageDecoder::OnSetData(SegmentReader* data) { void BMPImageDecoder::OnSetData(SegmentReader* data) {
if (reader_) if (reader_)
reader_->SetData(data); reader_->SetData(data);
......
...@@ -31,16 +31,20 @@ ...@@ -31,16 +31,20 @@
#ifndef BMPImageDecoder_h #ifndef BMPImageDecoder_h
#define BMPImageDecoder_h #define BMPImageDecoder_h
#include "platform/image-decoders/bmp/BMPImageReader.h"
#include <memory> #include <memory>
#include "platform/image-decoders/ImageDecoder.h"
namespace blink { namespace blink {
class BMPImageReader;
// This class decodes the BMP image format. // This class decodes the BMP image format.
class PLATFORM_EXPORT BMPImageDecoder final : public ImageDecoder { class PLATFORM_EXPORT BMPImageDecoder final : public ImageDecoder {
public: public:
BMPImageDecoder(AlphaOption, const ColorBehavior&, size_t max_decoded_bytes); BMPImageDecoder(AlphaOption, const ColorBehavior&, size_t max_decoded_bytes);
~BMPImageDecoder() override;
// ImageDecoder: // ImageDecoder:
String FilenameExtension() const override { return "bmp"; } String FilenameExtension() const override { return "bmp"; }
void OnSetData(SegmentReader*) override; void OnSetData(SegmentReader*) override;
......
...@@ -75,6 +75,7 @@ mailing address. ...@@ -75,6 +75,7 @@ mailing address.
#include "platform/image-decoders/gif/GIFImageReader.h" #include "platform/image-decoders/gif/GIFImageReader.h"
#include <string.h> #include <string.h>
#include "platform/image-decoders/FastSharedBufferReader.h"
#include "platform/wtf/PtrUtil.h" #include "platform/wtf/PtrUtil.h"
namespace blink { namespace blink {
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
// Define ourselves as the clientPtr. Mozilla just hacked their C++ callback // Define ourselves as the clientPtr. Mozilla just hacked their C++ callback
// class into this old C decoder, so we will too. // class into this old C decoder, so we will too.
#include <memory> #include <memory>
#include "platform/image-decoders/FastSharedBufferReader.h"
#include "platform/image-decoders/gif/GIFImageDecoder.h" #include "platform/image-decoders/gif/GIFImageDecoder.h"
#include "platform/wtf/Allocator.h" #include "platform/wtf/Allocator.h"
#include "platform/wtf/Noncopyable.h" #include "platform/wtf/Noncopyable.h"
...@@ -49,6 +48,8 @@ ...@@ -49,6 +48,8 @@
namespace blink { namespace blink {
class FastSharedBufferReader;
const int kCLoopCountNotSeen = -2; const int kCLoopCountNotSeen = -2;
// List of possible parsing states. // List of possible parsing states.
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "platform/image-decoders/webp/WEBPImageDecoder.h" #include "platform/image-decoders/webp/WEBPImageDecoder.h"
#include "third_party/skia/include/core/SkData.h"
#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN) #if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)
#error Blink assumes a little-endian target. #error Blink assumes a little-endian target.
#endif #endif
......
...@@ -30,10 +30,11 @@ ...@@ -30,10 +30,11 @@
#define WEBPImageDecoder_h #define WEBPImageDecoder_h
#include "platform/image-decoders/ImageDecoder.h" #include "platform/image-decoders/ImageDecoder.h"
#include "third_party/skia/include/core/SkData.h"
#include "webp/decode.h" #include "webp/decode.h"
#include "webp/demux.h" #include "webp/demux.h"
class SkData;
namespace blink { namespace blink {
class PLATFORM_EXPORT WEBPImageDecoder final : public ImageDecoder { class PLATFORM_EXPORT WEBPImageDecoder final : public ImageDecoder {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment