mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Issue #2073 - m-c 523950: Discard decoded frames of very large GIF animations (squashed)
Controlled by image.animated.decode-on-demand.threshold-kb, default 256MB Includes squashed bugfixes/regressions: - m-c 1444537: Shutting down the decode pool should make animated decoders bail early - m-c 1628606: Make sure to mark the surface cache entry available before sending the frame complete notification - m-c 1502275: Skip recreating the decoder after redecode errors if an animated image is reset - m-c 1443232: Don't insert frames into our AnimationFrameBuffer that we consider in error and unusable
This commit is contained in:
parent
eac8afce35
commit
e96122ede2
25 changed files with 925 additions and 63 deletions
|
|
@ -200,6 +200,11 @@ public:
|
|||
mIterator.emplace(Move(aIterator));
|
||||
}
|
||||
|
||||
SourceBuffer* GetSourceBuffer() const
|
||||
{
|
||||
return mIterator->Owner();
|
||||
}
|
||||
|
||||
/**
|
||||
* Should this decoder send partial invalidations?
|
||||
*/
|
||||
|
|
@ -244,6 +249,12 @@ public:
|
|||
/// Are we in the middle of a frame right now? Used for assertions only.
|
||||
bool InFrame() const { return mInFrame; }
|
||||
|
||||
/// Type of decoder.
|
||||
virtual DecoderType GetType() const
|
||||
{
|
||||
return DecoderType::UNKNOWN;
|
||||
}
|
||||
|
||||
enum DecodeStyle {
|
||||
PROGRESSIVE, // produce intermediate frames representing the partial
|
||||
// state of the image
|
||||
|
|
@ -339,6 +350,11 @@ public:
|
|||
: RawAccessFrameRef();
|
||||
}
|
||||
|
||||
bool HasFrameToTake() const { return mHasFrameToTake; }
|
||||
void ClearHasFrameToTake() {
|
||||
MOZ_ASSERT(mHasFrameToTake);
|
||||
mHasFrameToTake = false;
|
||||
}
|
||||
|
||||
protected:
|
||||
friend class nsICODecoder;
|
||||
|
|
@ -493,6 +509,10 @@ private:
|
|||
bool mInFrame : 1;
|
||||
bool mFinishedNewFrame : 1; // True if PostFrameStop() has been called since
|
||||
// the last call to TakeCompleteFrameCount().
|
||||
// Has a new frame that AnimationSurfaceProvider can take. Unfortunately this
|
||||
// has to be separate from mFinishedNewFrame because the png decoder yields a
|
||||
// new frame before calling PostFrameStop().
|
||||
bool mHasFrameToTake : 1;
|
||||
bool mReachedTerminalState : 1;
|
||||
bool mDecodeDone : 1;
|
||||
bool mError : 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue