зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
bfcb9bab59
Коммит
c19bc09ecd
|
@ -62,6 +62,10 @@ WebRenderImageData::UpdateImageKey(ImageContainer* aContainer, bool aForceUpdate
|
|||
CreateImageClientIfNeeded();
|
||||
CreateExternalImageIfNeeded();
|
||||
|
||||
if (mContainer != aContainer) {
|
||||
mContainer = aContainer;
|
||||
}
|
||||
|
||||
if (!mImageClient || !mExternalImageId) {
|
||||
return Nothing();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче