From 54e073511a213039711276e99d8404e38a850a40 Mon Sep 17 00:00:00 2001 From: Job Bautista Date: Fri, 2 Dec 2022 14:17:10 +0800 Subject: [PATCH] Issue #2041 Follow-up - Remove opacity check from original patch. Per Issue #2033 we don't support expanding RGB to RGBA yet, so this opacity check will always return RGBX, which makes images with transparent backgrounds show up with a black background instead. Feel free to readd once we backport Mozilla bug 1551088. --- image/decoders/nsJXLDecoder.cpp | 6 +----- image/decoders/nsJXLDecoder.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/image/decoders/nsJXLDecoder.cpp b/image/decoders/nsJXLDecoder.cpp index 59ae91e855..10c4914323 100644 --- a/image/decoders/nsJXLDecoder.cpp +++ b/image/decoders/nsJXLDecoder.cpp @@ -63,7 +63,6 @@ nsJXLDecoder::nsJXLDecoder(RasterImage* aImage) JxlThreadParallelRunnerMake(nullptr, PreferredThreadCount())), mNumFrames(0), mTimeout(FrameTimeout::Forever()), - mSurfaceFormat(SurfaceFormat::B8G8R8X8), mContinue(false) { JxlDecoderSubscribeEvents(mDecoder.get(), JXL_DEC_BASIC_INFO | JXL_DEC_FRAME | @@ -250,10 +249,7 @@ nsJXLDecoder::ReadJXLData(const char* aData, size_t aLength) Some(invalidRect->mOutputSpaceRect)); } - Opacity opacity = mSurfaceFormat == SurfaceFormat::B8G8R8A8 - ? Opacity::SOME_TRANSPARENCY - : Opacity::FULLY_OPAQUE; - PostFrameStop(opacity); + PostFrameStop(); if (!IsFirstFrameDecode() && mInfo.have_animation && !mFrameHeader.is_last) { diff --git a/image/decoders/nsJXLDecoder.h b/image/decoders/nsJXLDecoder.h index 3cabcfb9b0..878ca044c8 100644 --- a/image/decoders/nsJXLDecoder.h +++ b/image/decoders/nsJXLDecoder.h @@ -48,7 +48,6 @@ class nsJXLDecoder final : public Decoder { uint32_t mNumFrames; FrameTimeout mTimeout; - gfx::SurfaceFormat mSurfaceFormat; SurfacePipe mPipe; bool mContinue; };