Bug 1391793 - Save the given ImageContainer in WebRenderImageData so that it is not recreated. r=jrmuizel

A RasterImage's ImageContainer is only retained as a weak pointer in the
RasterImage itself. With WebRender and display items, we no longer kept
a strong reference to said image container, and as such it got recreated
every time it had to repaint (e.g. after a scroll). This would
unnecessarily reset/update the generation counter such that the
ImageClient would decide it needs to retransmit the image data to the
GPU process. By keeping a strong reference to the container that we
don't otherwise use, we avoid this situation.
This commit is contained in:
Andrew Osmond 2017-08-31 05:30:36 -04:00
Родитель bfcb9bab59
Коммит c19bc09ecd
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -62,6 +62,10 @@ WebRenderImageData::UpdateImageKey(ImageContainer* aContainer, bool aForceUpdate
CreateImageClientIfNeeded();
CreateExternalImageIfNeeded();
if (mContainer != aContainer) {
mContainer = aContainer;
}
if (!mImageClient || !mExternalImageId) {
return Nothing();
}