Bug 890179. r=seth a=abillings

--HG--
extra : rebase_source : f8c1f5adbdcc9bae652df901f256e8eac3fc5dc3
This commit is contained in:
Joe Drew 2013-07-04 15:58:26 -04:00
parent 58b91b86f9
commit a52cd51483
2 changed files with 7 additions and 7 deletions

View File

@ -177,10 +177,11 @@ void nsGIFDecoder2::BeginImageFrame(uint16_t aDepth)
}
// Our first full frame is automatically created by the image decoding
// infrastructure. Just use it as long as we're not creating a subframe.
else if (mGIFStruct.x_offset != 0 || mGIFStruct.y_offset != 0 ||
int32_t(mGIFStruct.width) != mImageMetadata.GetWidth() ||
int32_t(mGIFStruct.height) != mImageMetadata.GetHeight()) {
// infrastructure. Just use it as long as it matches up.
else if (!GetCurrentFrame()->GetRect().IsEqualEdges(nsIntRect(mGIFStruct.x_offset,
mGIFStruct.y_offset,
mGIFStruct.width,
mGIFStruct.height))) {
// Regardless of depth of input, image is decoded into 24bit RGB
NeedNewFrame(mGIFStruct.images_decoded, mGIFStruct.x_offset,
mGIFStruct.y_offset, mGIFStruct.width, mGIFStruct.height,

View File

@ -141,11 +141,10 @@ void nsPNGDecoder::CreateFrame(png_uint_32 x_offset, png_uint_32 y_offset,
gfxASurface::gfxImageFormat format)
{
// Our first full frame is automatically created by the image decoding
// infrastructure. Just use it as long as we're not creating a subframe.
// infrastructure. Just use it as long as it matches up.
MOZ_ASSERT(HasSize());
if (mNumFrames != 0 ||
x_offset != 0 || y_offset != 0 ||
width != mImageMetadata.GetWidth() || height != mImageMetadata.GetHeight()) {
!GetCurrentFrame()->GetRect().IsEqualEdges(nsIntRect(x_offset, y_offset, width, height))) {
NeedNewFrame(mNumFrames, x_offset, y_offset, width, height, format);
} else if (mNumFrames == 0) {
// Our preallocated frame matches up, with the possible exception of alpha.