diff --git a/image/decoders/nsJXLDecoder.cpp b/image/decoders/nsJXLDecoder.cpp index ce83937490..e0e3407557 100644 --- a/image/decoders/nsJXLDecoder.cpp +++ b/image/decoders/nsJXLDecoder.cpp @@ -66,8 +66,9 @@ size_t nsJXLDecoder::PreferredThreadCount() { return JxlThreadParallelRunnerDefaultNumWorkerThreads(); } -LexerResult nsJXLDecoder::DoDecode(SourceBufferIterator& aIterator, - IResumable* aOnResume) { +LexerResult +nsJXLDecoder::DoDecode(SourceBufferIterator& aIterator, IResumable* aOnResume) +{ // return LexerResult(TerminalState::FAILURE); MOZ_ASSERT(!HasError(), "Shouldn't call DoDecode after error!"); @@ -83,8 +84,9 @@ LexerResult nsJXLDecoder::DoDecode(SourceBufferIterator& aIterator, }); }; -LexerTransition nsJXLDecoder::ReadJXLData( - const char* aData, size_t aLength) { +LexerTransition +nsJXLDecoder::ReadJXLData(const char* aData, size_t aLength) +{ const uint8_t* input = (const uint8_t*)aData; size_t length = aLength; if (mBuffer.length() != 0) { @@ -133,10 +135,9 @@ LexerTransition nsJXLDecoder::ReadJXLData( } case JXL_DEC_FULL_IMAGE: { - OrientedIntSize size(mInfo.xsize, mInfo.ysize); Maybe pipe = SurfacePipeFactory::CreateSurfacePipe( - this, size, OutputSize(), FullFrame(), SurfaceFormat::R8G8B8A8, - SurfaceFormat::OS_RGBA, Nothing(), nullptr, SurfacePipeFlags()); + this, Size(), OutputSize(), FullFrame(), SurfaceFormat::B8G8R8A8, + Nothing(), SurfacePipeFlags()); for (uint8_t* rowPtr = mOutBuffer.begin(); rowPtr < mOutBuffer.end(); rowPtr += mInfo.xsize * 4) { pipe->WriteBuffer(reinterpret_cast(rowPtr)); @@ -154,7 +155,9 @@ LexerTransition nsJXLDecoder::ReadJXLData( } } -LexerTransition nsJXLDecoder::FinishedJXLData() { +LexerTransition +nsJXLDecoder::FinishedJXLData() +{ MOZ_ASSERT_UNREACHABLE("Read the entire address space?"); return Transition::TerminateFailure(); } diff --git a/image/decoders/nsJXLDecoder.h b/image/decoders/nsJXLDecoder.h index 0b723878ae..d4a1abe7f8 100644 --- a/image/decoders/nsJXLDecoder.h +++ b/image/decoders/nsJXLDecoder.h @@ -8,7 +8,6 @@ #define mozilla_image_decoders_nsJXLDecoder_h #include "Decoder.h" -#include "mp4parse.h" #include "SurfacePipe.h" #include "jxl/decode_cxx.h" @@ -21,8 +20,6 @@ class nsJXLDecoder final : public Decoder { public: virtual ~nsJXLDecoder(); - DecoderType GetType() const override { return DecoderType::JXL; } - protected: LexerResult DoDecode(SourceBufferIterator& aIterator, IResumable* aOnResume) override;