Bug 1486962 - Ensure frame is associated with background images with WebRender. r=mstange

The frame for a background image should be associated with the image
request. This was done on the non-WebRender path in
nsCSSRendering::PaintStyleImageLayerWithSC but otherwise missing for the
WebRender path. This is important because the association is what allows
the FRAME_UPDATE from imagelib to cause a repaint. Without it, it will
manifest as incomplete or missing background images, in particular after
the background image SourceSurface has been released to save memory.
This commit is contained in:
Andrew Osmond 2018-08-30 18:19:59 -04:00
Родитель 3107aff601
Коммит c4053ead28
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -2926,6 +2926,12 @@ nsCSSRendering::BuildWebRenderDisplayItemsForStyleImageLayerWithSC(const PaintBG
aParams.paintFlags, paintBorderArea,
clipState.mBGClipArea, layer, nullptr);
result &= state.mImageRenderer.PrepareResult();
// Ensure we get invalidated for loads and animations of the image.
// We need to do this here because this might be the only code that
// knows about the association of the style data with the frame.
aParams.frame->AssociateImage(layer.mImage, &aParams.presCtx, 0);
if (!state.mFillArea.IsEmpty()) {
return state.mImageRenderer.BuildWebRenderDisplayItemsForLayer(&aParams.presCtx,
aBuilder, aResources, aSc,