diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-11-21 13:34:01 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-11-21 13:34:01 +0100 |
commit | 3417e581ce76662131e8089de19b05af20a7fe19 (patch) | |
tree | 82022858bd64d6ca4b1023d0317355b621d8b0aa /image/decoders/nsGIFDecoder2.cpp | |
parent | 622098073e132995994fac4d61e3629d08ee1801 (diff) | |
download | UXP-3417e581ce76662131e8089de19b05af20a7fe19.tar UXP-3417e581ce76662131e8089de19b05af20a7fe19.tar.gz UXP-3417e581ce76662131e8089de19b05af20a7fe19.tar.lz UXP-3417e581ce76662131e8089de19b05af20a7fe19.tar.xz UXP-3417e581ce76662131e8089de19b05af20a7fe19.zip |
Bug 1462355 - Part 1c. Make individual image decoders to use updated Decoder/SurfacePipe methods.
Extend this change to nsWebPDecoder.cpp
Diffstat (limited to 'image/decoders/nsGIFDecoder2.cpp')
-rw-r--r-- | image/decoders/nsGIFDecoder2.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/image/decoders/nsGIFDecoder2.cpp b/image/decoders/nsGIFDecoder2.cpp index 7955438e4..efa145144 100644 --- a/image/decoders/nsGIFDecoder2.cpp +++ b/image/decoders/nsGIFDecoder2.cpp @@ -187,6 +187,14 @@ nsGIFDecoder2::BeginImageFrame(const IntRect& aFrameRect, // Make sure there's no animation if we're downscaling. MOZ_ASSERT_IF(Size() != OutputSize(), !GetImageMetadata().HasAnimation()); + AnimationParams animParams { + aFrameRect, + FrameTimeout::FromRawMilliseconds(mGIFStruct.delay_time), + uint32_t(mGIFStruct.images_decoded), + BlendMethod::OVER, + DisposalMethod(mGIFStruct.disposal_method) + }; + SurfacePipeFlags pipeFlags = aIsInterlaced ? SurfacePipeFlags::DEINTERLACE : SurfacePipeFlags(); @@ -198,17 +206,18 @@ nsGIFDecoder2::BeginImageFrame(const IntRect& aFrameRect, // The first frame is always decoded into an RGB surface. pipe = - SurfacePipeFactory::CreateSurfacePipe(this, mGIFStruct.images_decoded, - Size(), OutputSize(), - aFrameRect, format, pipeFlags); + SurfacePipeFactory::CreateSurfacePipe(this, Size(), OutputSize(), + aFrameRect, format, + Some(animParams), pipeFlags); } else { // This is an animation frame (and not the first). To minimize the memory // usage of animations, the image data is stored in paletted form. MOZ_ASSERT(Size() == OutputSize()); pipe = - SurfacePipeFactory::CreatePalettedSurfacePipe(this, mGIFStruct.images_decoded, - Size(), aFrameRect, format, - aDepth, pipeFlags); + SurfacePipeFactory::CreatePalettedSurfacePipe(this, Size(), aFrameRect, + format, + aDepth, Some(animParams), + pipeFlags); } mCurrentFrameIndex = mGIFStruct.images_decoded; @@ -249,9 +258,7 @@ nsGIFDecoder2::EndImageFrame() mGIFStruct.images_decoded++; // Tell the superclass we finished a frame - PostFrameStop(opacity, - DisposalMethod(mGIFStruct.disposal_method), - FrameTimeout::FromRawMilliseconds(mGIFStruct.delay_time)); + PostFrameStop(opacity); // Reset the transparent pixel if (mOldColor) { |