blinking images when decoding is async#1635
Open
BunioFH wants to merge 2 commits intoWebPlatformForEmbedded:wpe-2.38from
Open
blinking images when decoding is async#1635BunioFH wants to merge 2 commits intoWebPlatformForEmbedded:wpe-2.38from
BunioFH wants to merge 2 commits intoWebPlatformForEmbedded:wpe-2.38from
Conversation
https://bugs.webkit.org/show_bug.cgi?id=256620 rdar://108930635 Reviewed by Simon Fraser. Rearrange the logic of RenderBoxModelObject::decodingModeForImageDraw() such that we call isVisibleInViewport() at the end of this function. But there is only one exception to this. If the image has the attribute decoding="async" specified, then we have to make sure the image will not flicker. And to check that we have to call isVisibleInViewport(). Fix a subtle one-time-flickering we should not rely on the layer repaint count only because new layers can be created when pinch zoom the image. In addition to the repaint count, we can rely on a new flag called hasEverPaintedImages which can be stored in the NodeRareData. It is initialized to false and it is set to true when the image is drawn by its RenderObject. An image is allowed to be asynchronously decoded if layer repaint count is zero and the element's flag hasEverPaintedImages is false. The internal setting setLargeImageAsyncDecodingEnabledForTesting() will be renamed to setAsyncDecodingEnabledForTesting(). Its use will change to enable async image decoding for any image regardless of its size. * LayoutTests/fast/images/async-image-background-change.html: * LayoutTests/fast/images/async-image-background-image-repeated.html: * LayoutTests/fast/images/async-image-background-image.html: * LayoutTests/fast/images/async-image-body-background-image.html: * LayoutTests/fast/images/async-image-multiple-clients-repaint.html: * LayoutTests/fast/images/async-image-src-change.html: * LayoutTests/fast/images/decode-render-static-image.html: * LayoutTests/fast/images/decoding-attribute-async-small-image.html: * LayoutTests/fast/images/decoding-attribute-dynamic-async-small-image.html: * LayoutTests/fast/images/sprite-sheet-image-draw.html: * LayoutTests/http/tests/images/render-partial-image-load.html: * Source/WebCore/dom/Node.cpp: (WebCore::Node::hasEverPaintedImages const): (WebCore::Node::setHasEverPaintedImages): * Source/WebCore/dom/Node.h: * Source/WebCore/dom/NodeRareData.h: (WebCore::NodeRareData::hasEverPaintedImages const): (WebCore::NodeRareData::setHasEverPaintedImages): * Source/WebCore/platform/graphics/BitmapImage.h: * Source/WebCore/rendering/BackgroundPainter.cpp: (WebCore::BackgroundPainter::paintFillLayer): * Source/WebCore/rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw const): * Source/WebCore/rendering/RenderImage.cpp: (WebCore::RenderImage::paintIntoRect): * Source/WebCore/rendering/RenderObject.h: * Source/WebCore/testing/Internals.cpp: (WebCore::Internals::setAsyncDecodingEnabledForTesting): (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting): Deleted. * Source/WebCore/testing/Internals.h: * Source/WebCore/testing/Internals.idl: Canonical link: https://commits.webkit.org/265328@main
… first time by disabling async image decoding https://bugs.webkit.org/show_bug.cgi?id=270330 rdar://117533495 Reviewed by Simon Fraser; If an image is decoded asynchronously for a sizeForDrawing different from the current one, a flicker may happen. To avoid this flicker, decode the image synchronously if it has more than one RenderElement in the page and the last time it was decoded asynchronously. * LayoutTests/TestExpectations: * Source/WebCore/loader/cache/CachedImage.h: * Source/WebCore/platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::destroyDecodedData): (WebCore::BitmapImage::draw): (WebCore::BitmapImage::lastDecodingOptions const): (WebCore::BitmapImage::lastDecodingOptionsForTesting const): Deleted. * Source/WebCore/platform/graphics/BitmapImage.h: * Source/WebCore/platform/graphics/ImageObserver.h: (WebCore::ImageObserver::numberOfClients const): * Source/WebCore/rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw const): * Source/WebCore/testing/Internals.cpp: (WebCore::Internals::imageLastDecodingOptions): Canonical link: https://commits.webkit.org/276513@main
|
@BunioFH : can you remove "Bunio" from title of the PR? |
Author
|
@pgorszkowski-igalia sorry, it was automatic from the branch name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
posters blink when loading and navigating through https://astro.zee5.com/
two changes were introduced on wpe-2.46 which do cover the problem. in this PR those changes were rebased and augmented (a little) to work on wpe-2.38. base changes:
df8600f