Bug 1210745. Change image progress asserts to allow transparency to be posted after the size is posted. r=seth

The PNG decoder posts the size almost immediately, and later posts transparency (even for non-animated images).

It would be nice to still assert what this assert is intending (that transparency of non-animated images is posted during the metadata decode) but we don't have any easy way of telling when a metadata finishes here.
This commit is contained in:
Timothy Nikkel 2016-03-21 16:15:20 -05:00
parent 3822e4c6c4
commit 417ecff3c2

View File

@ -53,12 +53,8 @@ CheckProgressConsistency(Progress aOldProgress, Progress aNewProgress)
// GIFs may fool us.
}
if (aNewProgress & FLAG_HAS_TRANSPARENCY) {
// We should never discover this after FLAG_SIZE_AVAILABLE except in the
// case of animated images, which may have an opaque first frame but
// transparent frames later on in the animation.
MOZ_ASSERT((aNewProgress & FLAG_IS_ANIMATED) ||
(aOldProgress & FLAG_HAS_TRANSPARENCY) ||
!(aOldProgress & FLAG_SIZE_AVAILABLE));
// XXX We'd like to assert that transparency is only set during metadata
// decode but we don't have any way to assert that until bug 1254892 is fixed.
}
if (aNewProgress & FLAG_LAST_PART_COMPLETE) {
MOZ_ASSERT(aNewProgress & FLAG_LOAD_COMPLETE);