Bug 1487120 - Invalidate nsImageBoxFrame properly for WebRender. r=jrmuizel

When the frame updates for an animated image, it will trigger
nsImageBoxFrame::OnFrameUpdate to be called. We did not change this for
WebRender, and thus it was missing similar checks added to
nsImageFrame::InvalidateSelf as originally added in bug 1382985. This
caused us to ignore the frame update, and thus the animation never
appeared to progress.
This commit is contained in:
Andrew Osmond 2018-08-30 14:51:27 -04:00
Родитель 76c84025d2
Коммит 740299988c
2 изменённых файлов: 15 добавлений и 2 удалений

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

@ -766,8 +766,8 @@ void
nsImageFrame::InvalidateSelf(const nsIntRect* aLayerInvalidRect,
const nsRect* aFrameInvalidRect)
{
// XXX: Do we really want to check whether we have a
// WebRenderUserDataProperty?
// Check if WebRender has interacted with this frame. If it has
// we need to let it know that things have changed.
if (HasProperty(WebRenderUserDataProperty::Key())) {
RefPtr<WebRenderFallbackData> data = GetWebRenderUserData<WebRenderFallbackData>(this, static_cast<uint32_t>(DisplayItemType::TYPE_IMAGE));
if (data) {

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

@ -902,6 +902,19 @@ nsImageBoxFrame::OnFrameUpdate(imgIRequest* aRequest)
return NS_OK;
}
// Check if WebRender has interacted with this frame. If it has
// we need to let it know that things have changed.
if (HasProperty(WebRenderUserDataProperty::Key())) {
uint32_t key = static_cast<uint32_t>(DisplayItemType::TYPE_XUL_IMAGE);
RefPtr<WebRenderFallbackData> data =
GetWebRenderUserData<WebRenderFallbackData>(this, key);
if (data) {
data->SetInvalid(true);
}
SchedulePaint();
return NS_OK;
}
InvalidateLayer(DisplayItemType::TYPE_XUL_IMAGE);
return NS_OK;