Bug 1516761 - Only use OS_RGBA for the first frame of animated GIFs. r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D58821

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Osmond 2020-01-06 19:03:41 +00:00
Родитель 8a5439976d
Коммит dc7128f82b
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -190,7 +190,12 @@ nsresult nsGIFDecoder2::BeginImageFrame(const IntRect& aFrameRect,
// The first frame may be displayed progressively.
pipeFlags |= SurfacePipeFlags::PROGRESSIVE_DISPLAY;
format = hasTransparency ? SurfaceFormat::OS_RGBA : SurfaceFormat::OS_RGBX;
// Only allow opaque surfaces if we are decoding a single image without
// transparency. For an animation, there isn't much benefit to RGBX given
// the current frame is constantly changing, and there are many risks
// since BlendAnimationFilter is able to clear rows of data.
format = hasTransparency || animParams ? SurfaceFormat::OS_RGBA
: SurfaceFormat::OS_RGBX;
} else {
format = SurfaceFormat::OS_RGBA;
}