Bug 1103328 (Part 1) - Fire HAS_TRANSPARENCY for clear disposal methods. r=tn

This commit is contained in:
Seth Fowler 2014-11-24 23:42:43 -08:00
Родитель d73bc31eb2
Коммит caa45fe3ec
2 изменённых файлов: 18 добавлений и 0 удалений

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

@ -828,6 +828,18 @@ nsGIFDecoder2::WriteInternal(const char* aBuffer, uint32_t aCount,
if (mGIFStruct.disposal_method == 4) {
mGIFStruct.disposal_method = 3;
}
{
int32_t method =
FrameBlender::FrameDisposalMethod(mGIFStruct.disposal_method);
if (method == FrameBlender::kDisposeClearAll ||
method == FrameBlender::kDisposeClear) {
// We may have to display the background under this image during
// animation playback, so we regard it as transparent.
PostHasTransparency();
}
}
mGIFStruct.delay_time = GETINT16(q + 1) * 10;
GETN(1, gif_consume_block);
break;

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

@ -176,6 +176,12 @@ void nsPNGDecoder::CreateFrame(png_uint_32 x_offset, png_uint_32 y_offset,
#ifdef PNG_APNG_SUPPORTED
if (png_get_valid(mPNG, mInfo, PNG_INFO_acTL)) {
mAnimInfo = AnimFrameInfo(mPNG, mInfo);
if (mAnimInfo.mDispose == FrameBlender::kDisposeClear) {
// We may have to display the background under this image during
// animation playback, so we regard it as transparent.
PostHasTransparency();
}
}
#endif
}