Modified: trunk/Source/WebCore/ChangeLog (213428 => 213429)
--- trunk/Source/WebCore/ChangeLog 2017-03-04 21:05:31 UTC (rev 213428)
+++ trunk/Source/WebCore/ChangeLog 2017-03-04 21:49:30 UTC (rev 213429)
@@ -1,3 +1,34 @@
+2017-03-04 Simon Fraser <[email protected]>
+
+ Clarify some terminology in RenderLayerBacking
+ https://bugs.webkit.org/show_bug.cgi?id=169174
+
+ Reviewed by Zalan Bujtas.
+
+ Rename some functions related to directly-composited background images and
+ box decorations for clarify.
+
+ Only behavior change is for canDirectlyCompositeBackgroundBackgroundImage() to check
+ GraphicsLayer::supportsContentsTiling(), which means that RenderLayerBacking::contentChanged()
+ will no longer trigger a updateGeometry() when it gets BackgroundImageChanged on non-
+ CoordinateGraphics platforms.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateConfiguration):
+ (WebCore::RenderLayerBacking::updateAfterDescendants):
+ (WebCore::RenderLayerBacking::updateDirectlyCompositedBoxDecorations):
+ (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
+ (WebCore::hasPaintedBoxDecorationsOrBackgroundImage):
+ (WebCore::supportsDirectlyCompositedBoxDecorations):
+ (WebCore::RenderLayerBacking::paintsBoxDecorations):
+ (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
+ (WebCore::RenderLayerBacking::contentChanged):
+ (WebCore::RenderLayerBacking::updateDirectlyCompositedContents): Deleted.
+ (WebCore::canCreateTiledImage): Deleted.
+ (WebCore::hasVisibleBoxDecorationsOrBackgroundImage): Deleted.
+ (WebCore::supportsDirectBoxDecorationsComposition): Deleted.
+ * rendering/RenderLayerBacking.h:
+
2017-03-04 Alex Christensen <[email protected]>
Cleanup after r213418
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (213428 => 213429)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2017-03-04 21:05:31 UTC (rev 213428)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2017-03-04 21:49:30 UTC (rev 213429)
@@ -607,12 +607,12 @@
m_graphicsLayer->setReplicatedByLayer(reflectionLayer);
}
} else
- m_graphicsLayer->setReplicatedByLayer(0);
+ m_graphicsLayer->setReplicatedByLayer(nullptr);
if (!m_owningLayer.isRootLayer()) {
bool isSimpleContainer = isSimpleContainerCompositingLayer();
bool didUpdateContentsRect = false;
- updateDirectlyCompositedContents(isSimpleContainer, didUpdateContentsRect);
+ updateDirectlyCompositedBoxDecorations(isSimpleContainer, didUpdateContentsRect);
} else
updateRootLayerConfiguration();
@@ -1097,7 +1097,7 @@
bool didUpdateContentsRect = false;
// FIXME: this duplicates work we did in updateConfiguration().
isSimpleContainer = isSimpleContainerCompositingLayer();
- updateDirectlyCompositedContents(isSimpleContainer, didUpdateContentsRect);
+ updateDirectlyCompositedBoxDecorations(isSimpleContainer, didUpdateContentsRect);
if (!didUpdateContentsRect && m_graphicsLayer->usesContentsLayer())
resetContentsRect();
}
@@ -1181,7 +1181,7 @@
}
}
-void RenderLayerBacking::updateDirectlyCompositedContents(bool isSimpleContainer, bool& didUpdateContentsRect)
+void RenderLayerBacking::updateDirectlyCompositedBoxDecorations(bool isSimpleContainer, bool& didUpdateContentsRect)
{
if (!m_owningLayer.hasVisibleContent())
return;
@@ -1710,8 +1710,11 @@
return style.hasVisibleBorder() || style.hasBorderRadius() || style.hasOutline() || style.hasAppearance() || style.boxShadow() || style.hasFilter();
}
-static bool canCreateTiledImage(const RenderStyle& style)
+static bool canDirectlyCompositeBackgroundBackgroundImage(const RenderStyle& style)
{
+ if (!GraphicsLayer::supportsContentsTiling())
+ return false;
+
auto& fillLayer = style.backgroundLayers();
if (fillLayer.next())
return false;
@@ -1739,7 +1742,7 @@
return true;
}
-static bool hasVisibleBoxDecorationsOrBackgroundImage(const RenderStyle& style)
+static bool hasPaintedBoxDecorationsOrBackgroundImage(const RenderStyle& style)
{
if (hasVisibleBoxDecorations(style))
return true;
@@ -1747,7 +1750,7 @@
if (!style.hasBackgroundImage())
return false;
- return !GraphicsLayer::supportsContentsTiling() || !canCreateTiledImage(style);
+ return !canDirectlyCompositeBackgroundBackgroundImage(style);
}
static inline bool hasPerspectiveOrPreserves3D(const RenderStyle& style)
@@ -1833,7 +1836,7 @@
}
}
-static bool supportsDirectBoxDecorationsComposition(const RenderLayerModelObject& renderer)
+static bool supportsDirectlyCompositedBoxDecorations(const RenderLayerModelObject& renderer)
{
if (!GraphicsLayer::supportsBackgroundColorContent())
return false;
@@ -1842,7 +1845,7 @@
if (renderer.hasClip())
return false;
- if (hasVisibleBoxDecorationsOrBackgroundImage(style))
+ if (hasPaintedBoxDecorationsOrBackgroundImage(style))
return false;
// FIXME: We can't create a directly composited background if this
@@ -1865,7 +1868,7 @@
if (!m_owningLayer.hasVisibleBoxDecorations())
return false;
- return !supportsDirectBoxDecorationsComposition(renderer());
+ return !supportsDirectlyCompositedBoxDecorations(renderer());
}
bool RenderLayerBacking::paintsChildRenderers() const
@@ -1927,7 +1930,7 @@
// Reject anything that has a border, a border-radius or outline,
// or is not a simple background (no background, or solid color).
- if (hasVisibleBoxDecorationsOrBackgroundImage(rootObject->style()))
+ if (hasPaintedBoxDecorationsOrBackgroundImage(rootObject->style()))
return false;
// Now look at the body's renderer.
@@ -1938,7 +1941,7 @@
if (!bodyRenderer)
return false;
- if (hasVisibleBoxDecorationsOrBackgroundImage(bodyRenderer->style()))
+ if (hasPaintedBoxDecorationsOrBackgroundImage(bodyRenderer->style()))
return false;
}
@@ -2050,7 +2053,7 @@
return;
}
- if ((changeType == BackgroundImageChanged) && canCreateTiledImage(renderer().style()))
+ if ((changeType == BackgroundImageChanged) && canDirectlyCompositeBackgroundBackgroundImage(renderer().style()))
updateGeometry();
if ((changeType == MaskImageChanged) && m_maskLayer) {
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (213428 => 213429)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.h 2017-03-04 21:05:31 UTC (rev 213428)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2017-03-04 21:49:30 UTC (rev 213429)
@@ -321,9 +321,10 @@
void updateImageContents();
Color rendererBackgroundColor() const;
+
+ void updateDirectlyCompositedBoxDecorations(bool isSimpleContainer, bool& didUpdateContentsRect);
void updateDirectlyCompositedBackgroundColor(bool isSimpleContainer, bool& didUpdateContentsRect);
void updateDirectlyCompositedBackgroundImage(bool isSimpleContainer, bool& didUpdateContentsRect);
- void updateDirectlyCompositedContents(bool isSimpleContainer, bool& didUpdateContentsRect);
void resetContentsRect();