From c19bc09ecde3e0482fb27e36d8e4db843dec6458 Mon Sep 17 00:00:00 2001 From: Andrew Osmond Date: Thu, 31 Aug 2017 05:30:36 -0400 Subject: [PATCH] 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. --- gfx/layers/wr/WebRenderUserData.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/layers/wr/WebRenderUserData.cpp b/gfx/layers/wr/WebRenderUserData.cpp index a444eaa025b8..d7413c005c9a 100644 --- a/gfx/layers/wr/WebRenderUserData.cpp +++ b/gfx/layers/wr/WebRenderUserData.cpp @@ -62,6 +62,10 @@ WebRenderImageData::UpdateImageKey(ImageContainer* aContainer, bool aForceUpdate CreateImageClientIfNeeded(); CreateExternalImageIfNeeded(); + if (mContainer != aContainer) { + mContainer = aContainer; + } + if (!mImageClient || !mExternalImageId) { return Nothing(); }