Bug 695763. Part 7. Invalidate img's if they are not decoded and we are asked to do a sync decode. r=matt.woodrow

This commit is contained in:
Seth Fowler 2013-06-26 11:43:27 -05:00
parent eda35e04e0
commit f67d99ca0e
2 changed files with 16 additions and 0 deletions

View File

@ -1215,6 +1215,19 @@ nsDisplayImage::Paint(nsDisplayListBuilder* aBuilder,
PaintImage(*aCtx, ToReferenceFrame(), mVisibleRect, mImage, flags);
}
void
nsDisplayImage::ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
nsRegion* aInvalidRegion)
{
if (aBuilder->ShouldSyncDecodeImages() && mImage && !mImage->IsDecoded()) {
bool snap;
aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap));
}
nsDisplayImageContainer::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion);
}
already_AddRefed<ImageContainer>
nsDisplayImage::GetContainer(LayerManager* aManager,
nsDisplayListBuilder* aBuilder)

View File

@ -364,6 +364,9 @@ public:
virtual ~nsDisplayImage() {
MOZ_COUNT_DTOR(nsDisplayImage);
}
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
nsRegion* aInvalidRegion) MOZ_OVERRIDE;
virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) MOZ_OVERRIDE;