-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RenderLayerBacking::updateGeometry()
should update its GraphicsLayer
's drawsContent
flag
#20822
RenderLayerBacking::updateGeometry()
should update its GraphicsLayer
's drawsContent
flag
#20822
Conversation
EWS run on previous version of this PR (hash e3b301d) |
e3b301d
to
6c9e939
Compare
EWS run on previous version of this PR (hash 6c9e939)
|
6c9e939
to
2d65a6c
Compare
EWS run on previous version of this PR (hash 2d65a6c)
|
…er`'s `drawsContent` flag https://bugs.webkit.org/show_bug.cgi?id=265251 Reviewed by NOBODY (OOPS!). `RenderLayerBacking::updateGeometry()` may change `m_requiresOwnBackingStore`, which can affect the result of `containsPaintedContent()`. We should call `updateDrawsContent()` so that `GraphicsLayer` reflects this change. * LayoutTests/platform/gtk/TestExpectations: * LayoutTests/platform/gtk/compositing/visibility/layer-visible-content-expected.txt: Removed. * Source/WebCore/rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry):
2d65a6c
to
6bc9529
Compare
EWS run on current version of this PR (hash 6bc9529)
|
@@ -1594,6 +1594,7 @@ void RenderLayerBacking::updateGeometry(const RenderLayer* compositedAncestor) | |||
LayoutRect ancestorCompositedBounds = compositedAncestor ? compositedAncestor->backing()->compositedBounds() : LayoutRect(); | |||
setRequiresOwnBackingStore(compositor().requiresOwnBackingStore(m_owningLayer, compositedAncestor, | |||
LayoutRect(toLayoutPoint(compositedBoundsOffset.fromParentGraphicsLayer()), compositedBounds().size()), ancestorCompositedBounds)); | |||
updateDrawsContent(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called from updateAfterDescendants()
which is called on every RenderLayerBacking from RenderLayerCompositor::updateBackingAndHierarchy()
so why does calling it here change behavior?
I'm also curious about why this change is needed on GTK but not macOS/iOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GTK is the only port that doesn't use force compositing mode by default.
When RenderLayerCompositor::updateCompositingLayers()
is called the first time with force compositing enabled, we create the root render layer. It will have no children yet. But its drawsContent
flag will be set to true by the end of the method.
But with force compositing disabled, we create the root layer (with drawsContent
set to false by default) when we already have some children layers. The first child will then decide that it needs its own backing store. And only after that, the root layer will set drawsContent
to true. But it may be too late.
I hope I explained it well enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another argument for this change is that the returning value of RenderLayerBacking::containsPaintedContent()
, which is used by RenderLayerBacking::updateDrawsContent()
, depends on its m_requiresOwnBackingStore
value. So, whenever we change it, we should call updateDrawsContent()
Closing in favor of #20298. |
6bc9529
6bc9529