Bug 1207355 (Part 4) - Request decodes intelligently in nsBulletFrame. r=tn

This commit is contained in:
Seth Fowler 2015-10-28 16:40:43 -07:00
Родитель 90c6fe8bde
Коммит 485e5ae23b
1 изменённых файлов: 13 добавлений и 2 удалений

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

@ -712,9 +712,20 @@ nsBulletFrame::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aDa
// Unconditionally start decoding for now.
// XXX(seth): We eventually want to decide whether to do this based on
// visibility. We should get that for free from bug 1091236.
if (aRequest == mImageRequest) {
mImageRequest->RequestDecode();
nsCOMPtr<imgIContainer> container;
aRequest->GetImage(getter_AddRefs(container));
if (container) {
// Retrieve the intrinsic size of the image.
int32_t width = 0;
int32_t height = 0;
container->GetWidth(&width);
container->GetHeight(&height);
// Request a decode at that size.
container->RequestDecodeForSize(IntSize(width, height),
imgIContainer::DECODE_FLAGS_DEFAULT);
}
InvalidateFrame();
}