[webkit-changes] [WebKit/WebKit] efb71a: REGRESSION (264433 at main): Drawing small images bec...
Said Abou-Hallawa
noreply at github.com
Tue May 30 09:43:18 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: efb71a57dadd74e59047c8eee2ad280b0812a16a
https://github.com/WebKit/WebKit/commit/efb71a57dadd74e59047c8eee2ad280b0812a16a
Author: Said Abou-Hallawa <said at apple.com>
Date: 2023-05-30 (Tue, 30 May 2023)
Changed paths:
M LayoutTests/fast/images/async-image-composited-show.html
M LayoutTests/fast/images/async-image-src-change.html
M LayoutTests/fast/images/decode-decoding-change-image-src.html
M LayoutTests/platform/mac-wk1/TestExpectations
M Source/WebCore/dom/Node.cpp
M Source/WebCore/dom/Node.h
M Source/WebCore/dom/NodeRareData.h
M Source/WebCore/rendering/BackgroundPainter.cpp
M Source/WebCore/rendering/RenderBoxModelObject.cpp
M Source/WebCore/rendering/RenderImage.cpp
M Source/WebCore/rendering/RenderObject.h
Log Message:
-----------
REGRESSION (264433 at main): Drawing small images becomes slower
https://bugs.webkit.org/show_bug.cgi?id=257358
rdar://109810640
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().
Also to fix a subtle one-time-flickering we should not rely on the layer repaint
count because new layers can be created when pinch zoom the image. We can rely
on a new flag called hasEverPaintedImages which is stored on the NodeRareData.
It is initialized to false and it is set to true when an image is drawn on its
RenderObject.
* LayoutTests/fast/images/async-image-composited-show.html:
* LayoutTests/fast/images/async-image-src-change.html:
* LayoutTests/fast/images/decode-decoding-change-image-src.html:
* LayoutTests/platform/mac-wk1/TestExpectations:
* 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/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:
Canonical link: https://commits.webkit.org/264679@main
More information about the webkit-changes
mailing list