Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Unified Diff: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h

Issue 2777683002: Move JPEGImageDecoder to SkCodec
Patch Set: Use shared SegmentStream Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/BUILD.gn ('k') | third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h
index d65014a47dfd5271cdd252e7c1605af4a30552be..729b88cf5bb0ad37e7f8732346b1762d22815dc8 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h
@@ -26,13 +26,14 @@
#ifndef JPEGImageDecoder_h
#define JPEGImageDecoder_h
-#include "platform/image-decoders/ImageDecoder.h"
#include <memory>
+#include "third_party/skia/include/codec/SkCodec.h"
+#include "wtf/Noncopyable.h"
+#include "platform/image-decoders/ImageDecoder.h"
+#include "platform/image-decoders/SegmentStream.h"
namespace blink {
-class JPEGImageReader;
-
class PLATFORM_EXPORT JPEGImageDecoder final : public ImageDecoder {
WTF_MAKE_NONCOPYABLE(JPEGImageDecoder);
@@ -51,10 +52,10 @@ class PLATFORM_EXPORT JPEGImageDecoder final : public ImageDecoder {
bool decodeToYUV() override;
void setImagePlanes(std::unique_ptr<ImagePlanes>) override;
bool hasImagePlanes() const { return m_imagePlanes.get(); }
+ bool frameIsCompleteAtIndex(size_t) const override;
bool outputScanlines();
unsigned desiredScaleNumerator() const;
- void complete();
void setOrientation(ImageOrientation orientation) {
m_orientation = orientation;
@@ -63,15 +64,15 @@ class PLATFORM_EXPORT JPEGImageDecoder final : public ImageDecoder {
private:
// ImageDecoder:
- void decodeSize() override { decode(true); }
- void decode(size_t) override { decode(false); }
-
- // Decodes the image. If |onlySize| is true, stops decoding after
- // calculating the image size. If decoding fails but there is no more
- // data coming, sets the "decode failure" flag.
- void decode(bool onlySize);
+ void decodeSize() override {}
+ void initializeNewFrame(size_t index) override;
+ void decode(size_t) override;
- std::unique_ptr<JPEGImageReader> m_reader;
+ std::unique_ptr<SkCodec> m_codec;
+ // m_segmentStream is a raw pointer because it passes ownership to
+ // m_codec when m_codec is created. However, we still need the
+ // pointer so we can append more data as it arrives.
+ SegmentStream* m_segmentStream;
std::unique_ptr<ImagePlanes> m_imagePlanes;
IntSize m_decodedSize;
};
« no previous file with comments | « skia/BUILD.gn ('k') | third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698