From f06e26a2b80f719a6060697ecbb58504d83cb9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 3 Feb 2022 22:23:10 +0100 Subject: [PATCH] Bug 1753516 - Honor sync-decoding hint on webrender. r=aosmond We weren't doing it. I want to see if it helps with some flickering intermittents with the patch of bug 1718220. Not sure how to reliably test this. Differential Revision: https://phabricator.services.mozilla.com/D137794 --- layout/generic/nsImageFrame.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 4b2f238dbf20..4a09b9991a19 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -2005,7 +2005,8 @@ void nsDisplayImage::Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) { OldImageHasDifferentRatio(*frame, *mImage, mPrevImage); uint32_t flags = imgIContainer::FLAG_NONE; - if (aBuilder->ShouldSyncDecodeImages() || oldImageIsDifferent) { + if (aBuilder->ShouldSyncDecodeImages() || oldImageIsDifferent || + frame->mForceSyncDecoding) { flags |= imgIContainer::FLAG_SYNC_DECODE; } if (aBuilder->UseHighQualityScaling()) { @@ -2089,7 +2090,8 @@ bool nsDisplayImage::CreateWebRenderCommands( OldImageHasDifferentRatio(*frame, *mImage, mPrevImage); uint32_t flags = imgIContainer::FLAG_ASYNC_NOTIFY; - if (aDisplayListBuilder->ShouldSyncDecodeImages() || oldImageIsDifferent) { + if (aDisplayListBuilder->ShouldSyncDecodeImages() || oldImageIsDifferent || + frame->mForceSyncDecoding) { flags |= imgIContainer::FLAG_SYNC_DECODE; } if (aDisplayListBuilder->UseHighQualityScaling()) { @@ -2202,18 +2204,13 @@ ImgDrawResult nsImageFrame::PaintImage(gfxContext& aRenderingContext, constraintRect, mIntrinsicSize, mIntrinsicRatio, StylePosition(), &anchorPoint); - uint32_t flags = aFlags; - if (mForceSyncDecoding) { - flags |= imgIContainer::FLAG_SYNC_DECODE; - } - Maybe svgContext; SVGImageContext::MaybeStoreContextPaint(svgContext, this, aImage); ImgDrawResult result = nsLayoutUtils::DrawSingleImage( aRenderingContext, PresContext(), aImage, nsLayoutUtils::GetSamplingFilterForFrame(this), dest, aDirtyRect, - svgContext, flags, &anchorPoint); + svgContext, aFlags, &anchorPoint); if (nsImageMap* map = GetImageMap()) { gfxPoint devPixelOffset = nsLayoutUtils::PointToGfxPoint(