Loading image/Decoder.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -164,10 +164,6 @@ Decoder::Decode(NotNull<IResumable*> aOnResume) // Pass the data along to the implementation. terminalState = DoDecode(*mIterator); if (terminalState == Some(TerminalState::FAILURE)) { PostDataError(); } break; } Loading @@ -175,7 +171,12 @@ Decoder::Decode(NotNull<IResumable*> aOnResume) MOZ_ASSERT_UNREACHABLE("Unknown SourceBufferIterator state"); terminalState = Some(TerminalState::FAILURE); } } while (!GetDecodeDone() && !HasError()); } while (!GetDecodeDone() && !terminalState); // If decoding failed, record that fact. if (terminalState == Some(TerminalState::FAILURE)) { PostDataError(); } CompleteDecode(); return HasError() ? NS_ERROR_FAILURE : NS_OK; Loading image/decoders/nsBMPDecoder.cpp +13 −6 Original line number Diff line number Diff line Loading @@ -262,12 +262,19 @@ nsBMPDecoder::FinishInternal() nsIntRect r(0, 0, mH.mWidth, AbsoluteHeight()); PostInvalidation(r); if (mDoesHaveTransparency) { MOZ_ASSERT(mMayHaveTransparency); PostFrameStop(Opacity::SOME_TRANSPARENCY); } else { PostFrameStop(Opacity::FULLY_OPAQUE); } MOZ_ASSERT_IF(mDoesHaveTransparency, mMayHaveTransparency); // We have transparency if we either detected some in the image itself // (i.e., |mDoesHaveTransparency| is true) or we're in an ICO, which could // mean we have an AND mask that provides transparency (i.e., |mIsWithinICO| // is true). // XXX(seth): We can tell when we create the decoder if the AND mask is // present, so we could be more precise about this. const Opacity opacity = mDoesHaveTransparency || mIsWithinICO ? Opacity::SOME_TRANSPARENCY : Opacity::FULLY_OPAQUE; PostFrameStop(opacity); PostDecodeDone(); } Loading image/decoders/nsBMPDecoder.h +0 −7 Original line number Diff line number Diff line Loading @@ -142,13 +142,6 @@ public: /// bitmap has been fully decoded.) bool HasTransparency() const { return mDoesHaveTransparency; } /// Force transparency from outside. (Used by the ICO decoder.) void SetHasTransparency() { mMayHaveTransparency = true; mDoesHaveTransparency = true; } Maybe<TerminalState> DoDecode(SourceBufferIterator& aIterator) override; nsresult BeforeFinishInternal() override; nsresult FinishInternal() override; Loading image/decoders/nsICODecoder.cpp +0 −9 Original line number Diff line number Diff line Loading @@ -573,15 +573,6 @@ nsICODecoder::FinishMask() } } // If the mask contained any transparent pixels, record that fact. if (mHasMaskAlpha) { PostHasTransparency(); RefPtr<nsBMPDecoder> bmpDecoder = static_cast<nsBMPDecoder*>(mContainedDecoder.get()); bmpDecoder->SetHasTransparency(); } return Transition::To(ICOState::FINISHED_RESOURCE, 0); } Loading Loading
image/Decoder.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -164,10 +164,6 @@ Decoder::Decode(NotNull<IResumable*> aOnResume) // Pass the data along to the implementation. terminalState = DoDecode(*mIterator); if (terminalState == Some(TerminalState::FAILURE)) { PostDataError(); } break; } Loading @@ -175,7 +171,12 @@ Decoder::Decode(NotNull<IResumable*> aOnResume) MOZ_ASSERT_UNREACHABLE("Unknown SourceBufferIterator state"); terminalState = Some(TerminalState::FAILURE); } } while (!GetDecodeDone() && !HasError()); } while (!GetDecodeDone() && !terminalState); // If decoding failed, record that fact. if (terminalState == Some(TerminalState::FAILURE)) { PostDataError(); } CompleteDecode(); return HasError() ? NS_ERROR_FAILURE : NS_OK; Loading
image/decoders/nsBMPDecoder.cpp +13 −6 Original line number Diff line number Diff line Loading @@ -262,12 +262,19 @@ nsBMPDecoder::FinishInternal() nsIntRect r(0, 0, mH.mWidth, AbsoluteHeight()); PostInvalidation(r); if (mDoesHaveTransparency) { MOZ_ASSERT(mMayHaveTransparency); PostFrameStop(Opacity::SOME_TRANSPARENCY); } else { PostFrameStop(Opacity::FULLY_OPAQUE); } MOZ_ASSERT_IF(mDoesHaveTransparency, mMayHaveTransparency); // We have transparency if we either detected some in the image itself // (i.e., |mDoesHaveTransparency| is true) or we're in an ICO, which could // mean we have an AND mask that provides transparency (i.e., |mIsWithinICO| // is true). // XXX(seth): We can tell when we create the decoder if the AND mask is // present, so we could be more precise about this. const Opacity opacity = mDoesHaveTransparency || mIsWithinICO ? Opacity::SOME_TRANSPARENCY : Opacity::FULLY_OPAQUE; PostFrameStop(opacity); PostDecodeDone(); } Loading
image/decoders/nsBMPDecoder.h +0 −7 Original line number Diff line number Diff line Loading @@ -142,13 +142,6 @@ public: /// bitmap has been fully decoded.) bool HasTransparency() const { return mDoesHaveTransparency; } /// Force transparency from outside. (Used by the ICO decoder.) void SetHasTransparency() { mMayHaveTransparency = true; mDoesHaveTransparency = true; } Maybe<TerminalState> DoDecode(SourceBufferIterator& aIterator) override; nsresult BeforeFinishInternal() override; nsresult FinishInternal() override; Loading
image/decoders/nsICODecoder.cpp +0 −9 Original line number Diff line number Diff line Loading @@ -573,15 +573,6 @@ nsICODecoder::FinishMask() } } // If the mask contained any transparent pixels, record that fact. if (mHasMaskAlpha) { PostHasTransparency(); RefPtr<nsBMPDecoder> bmpDecoder = static_cast<nsBMPDecoder*>(mContainedDecoder.get()); bmpDecoder->SetHasTransparency(); } return Transition::To(ICOState::FINISHED_RESOURCE, 0); } Loading