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
This commit is contained in:
Emilio Cobos Álvarez 2022-02-03 22:23:10 +01:00
parent 909e38144b
commit f06e26a2b8

View File

@ -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<SVGImageContext> 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(