Diff
Modified: trunk/LayoutTests/ChangeLog (222284 => 222285)
--- trunk/LayoutTests/ChangeLog 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/LayoutTests/ChangeLog 2017-09-20 21:00:43 UTC (rev 222285)
@@ -1,3 +1,18 @@
+2017-09-20 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r222254.
+ https://bugs.webkit.org/show_bug.cgi?id=177267
+
+ Caused fast/images/animated-gif-webkit-transform.html to time
+ out, and possible perf regression (Requested by smfr on
+ #webkit).
+
+ Reverted changeset:
+
+ "Simplify compositing layer updating"
+ https://bugs.webkit.org/show_bug.cgi?id=176196
+ http://trac.webkit.org/changeset/222254
+
2017-09-20 Ryan Haddad <[email protected]>
Unreviewed, rolling out r222278.
Modified: trunk/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt (222284 => 222285)
--- trunk/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt 2017-09-20 21:00:43 UTC (rev 222285)
@@ -8,7 +8,8 @@
(contentsOpaque 1)
(children 1
(GraphicsLayer
- (position 12.00 200.00)
+ (position 12.00 10.00)
+ (approximate position 12.00 200.00)
(bounds 100.00 100.00)
(contentsOpaque 1)
)
Modified: trunk/LayoutTests/tiled-drawing/background-transparency-toggle-expected.txt (222284 => 222285)
--- trunk/LayoutTests/tiled-drawing/background-transparency-toggle-expected.txt 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/LayoutTests/tiled-drawing/background-transparency-toggle-expected.txt 2017-09-20 21:00:43 UTC (rev 222285)
@@ -49,7 +49,6 @@
(GraphicsLayer
(bounds 785.00 1024.00)
(contentsOpaque 1)
- (backgroundColor #CCCCCC)
(tile cache coverage 0, 0 785 x 1024)
(tile size 785 x 512)
(top left tile 0, 0 tiles grid 1 x 2)
Modified: trunk/Source/WebCore/ChangeLog (222284 => 222285)
--- trunk/Source/WebCore/ChangeLog 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/Source/WebCore/ChangeLog 2017-09-20 21:00:43 UTC (rev 222285)
@@ -1,3 +1,18 @@
+2017-09-20 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r222254.
+ https://bugs.webkit.org/show_bug.cgi?id=177267
+
+ Caused fast/images/animated-gif-webkit-transform.html to time
+ out, and possible perf regression (Requested by smfr on
+ #webkit).
+
+ Reverted changeset:
+
+ "Simplify compositing layer updating"
+ https://bugs.webkit.org/show_bug.cgi?id=176196
+ http://trac.webkit.org/changeset/222254
+
2017-09-20 Alex Christensen <[email protected]>
Remove ActionType::InvalidAction
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (222284 => 222285)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2017-09-20 21:00:43 UTC (rev 222285)
@@ -560,6 +560,11 @@
if (m_reflection)
m_reflection->layout();
+ // Clear the IsCompositingUpdateRoot flag once we've found the first compositing layer in this update.
+ bool isUpdateRoot = (flags & IsCompositingUpdateRoot);
+ if (isComposited())
+ flags &= ~IsCompositingUpdateRoot;
+
if (renderer().isInFlowRenderFlowThread()) {
updatePagination();
flags |= UpdatePagination;
@@ -574,6 +579,15 @@
for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
child->updateLayerPositions(geometryMap, flags);
+ if ((flags & UpdateCompositingLayers) && isComposited()) {
+ RenderLayerBacking::UpdateAfterLayoutFlags updateFlags = RenderLayerBacking::CompositingChildrenOnly;
+ if (flags & NeedsFullRepaintInBacking)
+ updateFlags |= RenderLayerBacking::NeedsFullRepaint;
+ if (isUpdateRoot)
+ updateFlags |= RenderLayerBacking::IsUpdateRoot;
+ backing()->updateAfterLayout(updateFlags);
+ }
+
// With all our children positioned, now update our marquee if we need to.
if (m_marquee) {
// FIXME: would like to use SetForScope<> but it doesn't work with bitfields.
@@ -5068,7 +5082,7 @@
}
// Ensure our lists and 3d status are up-to-date.
- updateLayerListsIfNeeded();
+ updateCompositingAndLayerListsIfNeeded();
update3DTransformedDescendantStatus();
RefPtr<HitTestingTransformState> localTransformState;
@@ -6367,6 +6381,17 @@
}
}
+void RenderLayer::updateCompositingAndLayerListsIfNeeded()
+{
+ if (compositor().inCompositingMode()) {
+ if (isDirtyStackingContainer() || m_normalFlowListDirty)
+ compositor().updateCompositingLayers(CompositingUpdateType::OnHitTest, this);
+ return;
+ }
+
+ updateLayerListsIfNeeded();
+}
+
void RenderLayer::repaintIncludingDescendants()
{
renderer().repaint();
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (222284 => 222285)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2017-09-20 21:00:43 UTC (rev 222285)
@@ -304,14 +304,16 @@
bool canRender3DTransforms() const;
enum UpdateLayerPositionsFlag {
- CheckForRepaint = 1 << 0,
- NeedsFullRepaintInBacking = 1 << 1,
- UpdatePagination = 1 << 2,
- SeenTransformedLayer = 1 << 3,
- Seen3DTransformedLayer = 1 << 4
+ CheckForRepaint = 1 << 0,
+ NeedsFullRepaintInBacking = 1 << 1,
+ IsCompositingUpdateRoot = 1 << 2,
+ UpdateCompositingLayers = 1 << 3,
+ UpdatePagination = 1 << 4,
+ SeenTransformedLayer = 1 << 5,
+ Seen3DTransformedLayer = 1 << 6
};
typedef unsigned UpdateLayerPositionsFlags;
- static const UpdateLayerPositionsFlags defaultFlags = CheckForRepaint;
+ static const UpdateLayerPositionsFlags defaultFlags = CheckForRepaint | IsCompositingUpdateRoot | UpdateCompositingLayers;
void updateLayerPositionsAfterLayout(const RenderLayer* rootLayer, UpdateLayerPositionsFlags);
@@ -821,6 +823,8 @@
void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, std::unique_ptr<Vector<RenderLayer*>>&, std::unique_ptr<Vector<RenderLayer*>>&);
+ void updateCompositingAndLayerListsIfNeeded();
+
bool setupFontSubpixelQuantization(GraphicsContext&, bool& didQuantizeFonts);
Path computeClipPath(const LayoutSize& offsetFromRoot, LayoutRect& rootRelativeBounds, WindRule&) const;
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (222284 => 222285)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2017-09-20 21:00:43 UTC (rev 222285)
@@ -633,6 +633,34 @@
}
}
+void RenderLayerBacking::updateAfterLayout(UpdateAfterLayoutFlags flags)
+{
+ LOG(Compositing, "RenderLayerBacking %p updateAfterLayout (layer %p)", this, &m_owningLayer);
+
+ if (!compositor().compositingLayersNeedRebuild()) {
+ // Calling updateGeometry() here gives incorrect results, because the
+ // position of this layer's GraphicsLayer depends on the position of our compositing
+ // ancestor's GraphicsLayer. That cannot be determined until all the descendant
+ // RenderLayers of that ancestor have been processed via updateLayerPositions().
+ //
+ // The solution is to update compositing children of this layer here,
+ // via updateCompositingChildrenGeometry().
+ updateCompositedBounds();
+ compositor().updateCompositingDescendantGeometry(m_owningLayer, m_owningLayer, flags & CompositingChildrenOnly);
+
+ if (flags & IsUpdateRoot) {
+ updateGeometry();
+ compositor().updateRootLayerPosition();
+ RenderLayer* stackingContainer = m_owningLayer.enclosingStackingContainer();
+ if (!compositor().compositingLayersNeedRebuild() && stackingContainer && (stackingContainer != &m_owningLayer))
+ compositor().updateCompositingDescendantGeometry(*stackingContainer, *stackingContainer, flags & CompositingChildrenOnly);
+ }
+ }
+
+ if (flags & NeedsFullRepaint && canIssueSetNeedsDisplay())
+ setContentsNeedDisplay();
+}
+
bool RenderLayerBacking::updateConfiguration()
{
m_owningLayer.updateDescendantDependentFlags();
@@ -951,7 +979,6 @@
RenderLayer* compositedAncestor = m_owningLayer.ancestorCompositingLayer();
LayoutSize ancestorClippingLayerOffset;
- // FIXME: can we avoid computeParentGraphicsLayerRect here?
LayoutRect parentGraphicsLayerRect = computeParentGraphicsLayerRect(compositedAncestor, ancestorClippingLayerOffset);
LayoutRect primaryGraphicsLayerRect = computePrimaryGraphicsLayerRect(parentGraphicsLayerRect);
@@ -2229,12 +2256,12 @@
}
if ((changeType == BackgroundImageChanged) && canDirectlyCompositeBackgroundBackgroundImage(renderer().style()))
- compositor().setCompositingLayersNeedRebuild();
+ updateGeometry();
if ((changeType == MaskImageChanged) && m_maskLayer) {
// The composited layer bounds relies on box->maskClipRect(), which changes
// when the mask image becomes available.
- compositor().setCompositingLayersNeedRebuild();
+ updateAfterLayout(CompositingChildrenOnly | IsUpdateRoot);
}
#if ENABLE(WEBGL) || ENABLE(ACCELERATED_2D_CANVAS)
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (222284 => 222285)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.h 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2017-09-20 21:00:43 UTC (rev 222285)
@@ -65,6 +65,14 @@
RenderLayer& owningLayer() const { return m_owningLayer; }
+ enum UpdateAfterLayoutFlag {
+ CompositingChildrenOnly = 1 << 0,
+ NeedsFullRepaint = 1 << 1,
+ IsUpdateRoot = 1 << 2
+ };
+ typedef unsigned UpdateAfterLayoutFlags;
+ void updateAfterLayout(UpdateAfterLayoutFlags);
+
// Returns true if layer configuration changed.
bool updateConfiguration();
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (222284 => 222285)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2017-09-20 21:00:43 UTC (rev 222285)
@@ -665,11 +665,12 @@
switch (updateType) {
case CompositingUpdateType::AfterStyleChange:
case CompositingUpdateType::AfterLayout:
+ case CompositingUpdateType::OnHitTest:
checkForHierarchyUpdate = true;
- needGeometryUpdate = true;
break;
case CompositingUpdateType::OnScroll:
checkForHierarchyUpdate = true; // Overlap can change with scrolling, so need to check for hierarchy updates.
+
needGeometryUpdate = true;
break;
case CompositingUpdateType::OnCompositedScroll:
@@ -690,7 +691,7 @@
if (isFullUpdate && updateType == CompositingUpdateType::AfterLayout)
m_reevaluateCompositingAfterLayout = false;
- LOG(Compositing, " checkForHierarchyUpdate %d, needGeometryUpdate %d", checkForHierarchyUpdate, needGeometryUpdate);
+ LOG(Compositing, " checkForHierarchyUpdate %d, needGeometryUpdate %d", checkForHierarchyUpdate, needHierarchyUpdate);
#if !LOG_DISABLED
MonotonicTime startTime;
@@ -742,6 +743,8 @@
reattachSubframeScrollLayers();
} else if (needGeometryUpdate) {
+ // We just need to do a geometry update. This is only used for position:fixed scrolling;
+ // most of the time, geometry is updated via RenderLayer::styleChanged().
updateLayerTreeGeometry(*updateRoot, 0);
ASSERT(!isFullUpdate || !m_subframeScrollLayersNeedReattach);
}
@@ -761,6 +764,7 @@
if (!hasAcceleratedCompositing())
enableCompositingMode(false);
+ // Inform the inspector that the layer tree has changed.
InspectorInstrumentation::layerTreeDidChange(&page());
return true;
@@ -933,8 +937,16 @@
return;
}
- if (layer.isComposited() || needsCompositingUpdateForStyleChangeOnNonCompositedLayer(layer, oldStyle))
+ if (layer.isComposited()) {
+ // FIXME: updating geometry here is potentially harmful, because layout is not up-to-date.
+ layer.backing()->updateGeometry();
+ layer.backing()->updateAfterDescendants();
m_layerNeedsCompositingUpdate = true;
+ return;
+ }
+
+ if (needsCompositingUpdateForStyleChangeOnNonCompositedLayer(layer, oldStyle))
+ m_layerNeedsCompositingUpdate = true;
}
bool RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer(RenderLayer& layer, const RenderStyle* oldStyle) const
@@ -4174,6 +4186,7 @@
switch (updateType) {
case CompositingUpdateType::AfterStyleChange: ts << "after style change"; break;
case CompositingUpdateType::AfterLayout: ts << "after layout"; break;
+ case CompositingUpdateType::OnHitTest: ts << "on hit test"; break;
case CompositingUpdateType::OnScroll: ts << "on scroll"; break;
case CompositingUpdateType::OnCompositedScroll: ts << "on composited scroll"; break;
}
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (222284 => 222285)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2017-09-20 20:54:57 UTC (rev 222284)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2017-09-20 21:00:43 UTC (rev 222285)
@@ -50,6 +50,7 @@
enum class CompositingUpdateType {
AfterStyleChange,
AfterLayout,
+ OnHitTest,
OnScroll,
OnCompositedScroll
};