Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2569253002: Revert "Fix border radius on composited children." (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 2d831e1eefae11322c7b37ed69ae379969ef3b56..d238b392794828ea16985bb04527cb2ee7e481a6 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -202,7 +202,7 @@ CompositedLayerMapping::~CompositedLayerMapping() {
}
}
- updateClippingLayers(false, false, false);
+ updateClippingLayers(false, false);
updateOverflowControlsLayers(false, false, false, false);
updateChildTransformLayer(false);
updateForegroundLayer(false);
@@ -246,7 +246,6 @@ void CompositedLayerMapping::destroyGraphicsLayers() {
m_graphicsLayer->removeFromParent();
m_ancestorClippingLayer = nullptr;
- m_ancestorClippingMaskLayer = nullptr;
m_graphicsLayer = nullptr;
m_foregroundLayer = nullptr;
m_backgroundLayer = nullptr;
@@ -473,34 +472,29 @@ void CompositedLayerMapping::updateCompositingReasons() {
m_owningLayer.getSquashingDisallowedReasons());
}
-void CompositedLayerMapping::
- owningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor(
- const PaintLayer* scrollParent,
- bool& owningLayerIsClipped,
- bool& owningLayerIsMasked) {
- owningLayerIsClipped = false;
- owningLayerIsMasked = false;
-
+bool CompositedLayerMapping::
+ owningLayerClippedByLayerNotAboveCompositedAncestor(
+ const PaintLayer* scrollParent) {
if (!m_owningLayer.parent())
- return;
+ return false;
const PaintLayer* compositingAncestor =
m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf);
if (!compositingAncestor)
- return;
+ return false;
const LayoutObject* clippingContainer = m_owningLayer.clippingContainer();
if (!clippingContainer)
- return;
+ return false;
if (clippingContainer->enclosingLayer() == scrollParent)
- return;
+ return false;
if (clippingContainer->enclosingLayer()->hasRootScrollerAsDescendant())
- return;
+ return false;
if (compositingAncestor->layoutObject()->isDescendantOf(clippingContainer))
- return;
+ return false;
// We ignore overflow clip here; we want composited overflow content to
// behave as if it lives in an unclipped universe so it can prepaint, etc.
@@ -515,14 +509,7 @@ void CompositedLayerMapping::
clipRectsContext.setIgnoreOverflowClip();
IntRect parentClipRect = pixelSnappedIntRect(
m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect());
- owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect();
-
- // TODO(schenney): CSS clips are not applied to composited children, and
- // should be via mask or by compositing the parent too.
- // https://bugs.chromium.org/p/chromium/issues/detail?id=615870
- DCHECK(clippingContainer->style());
- owningLayerIsMasked =
- owningLayerIsClipped && clippingContainer->style()->hasBorderRadius();
+ return parentClipRect != LayoutRect::infiniteIntRect();
}
const PaintLayer* CompositedLayerMapping::scrollParent() {
@@ -578,12 +565,10 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration() {
// layoutObject hierarchy, but a sibling in the z-order hierarchy. Further,
// that sibling need not be composited at all. In such scenarios, an ancestor
// clipping layer is necessary to apply the composited clip for this layer.
- bool needsAncestorClip = false;
- bool needsAncestorClippingMask = false;
- owningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor(
- scrollParent, needsAncestorClip, needsAncestorClippingMask);
- if (updateClippingLayers(needsAncestorClip, needsAncestorClippingMask,
- needsDescendantsClippingLayer))
+ bool needsAncestorClip =
+ owningLayerClippedByLayerNotAboveCompositedAncestor(scrollParent);
+
+ if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer))
layerConfigChanged = true;
bool scrollingConfigChanged = false;
@@ -1115,13 +1100,6 @@ void CompositedLayerMapping::updateAncestorClippingLayerGeometry(
m_ancestorClippingLayer->setOffsetFromLayoutObject(
parentClipRect.location() - snappedOffsetFromCompositedAncestor);
- if (m_ancestorClippingMaskLayer) {
- m_ancestorClippingMaskLayer->setOffsetFromLayoutObject(
- m_ancestorClippingLayer->offsetFromLayoutObject());
- m_ancestorClippingMaskLayer->setSize(m_ancestorClippingLayer->size());
- m_ancestorClippingMaskLayer->setNeedsDisplay();
- }
-
// The primary layer is then parented in, and positioned relative to this
// clipping layer.
graphicsLayerParentLocation = parentClipRect.location();
@@ -1673,9 +1651,6 @@ void CompositedLayerMapping::updateDrawsContent() {
if (m_decorationOutlineLayer)
m_decorationOutlineLayer->setDrawsContent(true);
- if (m_ancestorClippingMaskLayer)
- m_ancestorClippingMaskLayer->setDrawsContent(true);
-
if (m_maskLayer)
m_maskLayer->setDrawsContent(true);
@@ -1693,10 +1668,8 @@ void CompositedLayerMapping::updateChildrenTransform() {
}
// Return true if the layers changed.
-bool CompositedLayerMapping::updateClippingLayers(
- bool needsAncestorClip,
- bool needsAncestorClippingMask,
- bool needsDescendantClip) {
+bool CompositedLayerMapping::updateClippingLayers(bool needsAncestorClip,
+ bool needsDescendantClip) {
bool layersChanged = false;
if (needsAncestorClip) {
@@ -1708,32 +1681,11 @@ bool CompositedLayerMapping::updateClippingLayers(
layersChanged = true;
}
} else if (m_ancestorClippingLayer) {
- if (m_ancestorClippingMaskLayer) {
- m_ancestorClippingMaskLayer->removeFromParent();
- m_ancestorClippingMaskLayer = nullptr;
- }
m_ancestorClippingLayer->removeFromParent();
m_ancestorClippingLayer = nullptr;
layersChanged = true;
}
- if (needsAncestorClippingMask) {
- DCHECK(m_ancestorClippingLayer);
- if (!m_ancestorClippingMaskLayer) {
- m_ancestorClippingMaskLayer =
- createGraphicsLayer(CompositingReasonLayerForAncestorClippingMask);
- m_ancestorClippingMaskLayer->setPaintingPhase(
- GraphicsLayerPaintAncestorClippingMask);
- m_ancestorClippingLayer->setMaskLayer(m_ancestorClippingMaskLayer.get());
- layersChanged = true;
- }
- } else if (m_ancestorClippingMaskLayer) {
- m_ancestorClippingMaskLayer->removeFromParent();
- m_ancestorClippingMaskLayer = nullptr;
- m_ancestorClippingLayer->setMaskLayer(nullptr);
- layersChanged = true;
- }
-
if (needsDescendantClip) {
// We don't need a child containment layer if we're the main frame layout
// view layer. It's redundant as the frame clip above us will handle this
@@ -1963,10 +1915,6 @@ static void ApplyToGraphicsLayers(const CompositedLayerMapping* mapping,
(mode & ApplyToNonScrollingContentLayers)) &&
mapping->childClippingMaskLayer())
f(mapping->childClippingMaskLayer());
- if (((mode & ApplyToMaskLayers) || (mode & ApplyToContentLayers) ||
- (mode & ApplyToNonScrollingContentLayers)) &&
- mapping->ancestorClippingMaskLayer())
- f(mapping->ancestorClippingMaskLayer());
if (((mode & ApplyToBackgroundLayer) || (mode & ApplyToContentLayers) ||
(mode & ApplyToNonScrollingContentLayers)) &&
@@ -2002,7 +1950,7 @@ void CompositedLayerMapping::updateRenderingContext() {
// Some compositing reasons depend on the compositing state of ancestors. So
// if we want a rendering context id for the context root, we cannot ask for
// the id of its associated WebLayer now; it may not have one yet. We could do
- // a second pass after doing the compositing updates to get these ids, but
+ // a second past after doing the compositing updates to get these ids, but
// this would actually be harmful. We do not want to attach any semantic
// meaning to the context id other than the fact that they group a number of
// layers together for the sake of 3d sorting. So instead we will ask the
@@ -2306,11 +2254,7 @@ static void updateClipParentForGraphicsLayer(
void CompositedLayerMapping::updateClipParent(const PaintLayer* scrollParent) {
const PaintLayer* clipParent = nullptr;
- bool haveAncestorClipLayer = false;
- bool haveAncestorMaskLayer = false;
- owningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor(
- scrollParent, haveAncestorClipLayer, haveAncestorMaskLayer);
- if (!haveAncestorClipLayer) {
+ if (!owningLayerClippedByLayerNotAboveCompositedAncestor(scrollParent)) {
clipParent = m_owningLayer.clipParent();
if (clipParent)
clipParent =
@@ -2850,8 +2794,6 @@ void CompositedLayerMapping::doPaintTask(
if (!(paintLayerFlags & PaintLayerPaintingOverflowContents)) {
LayoutRect bounds = paintInfo.compositedBounds;
bounds.move(paintInfo.paintLayer->subpixelAccumulation());
- if (paintLayerFlags & PaintLayerPaintingAncestorClippingMaskPhase)
- bounds.move(offset);
dirtyRect.intersect(pixelSnappedIntRect(bounds));
} else {
dirtyRect.move(
@@ -3129,8 +3071,6 @@ void CompositedLayerMapping::paintContents(
paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase;
if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask)
paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase;
- if (graphicsLayerPaintingPhase & GraphicsLayerPaintAncestorClippingMask)
- paintLayerFlags |= PaintLayerPaintingAncestorClippingMaskPhase;
if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents)
paintLayerFlags |= PaintLayerPaintingOverflowContents;
if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll)
@@ -3150,8 +3090,7 @@ void CompositedLayerMapping::paintContents(
graphicsLayer == m_maskLayer.get() ||
graphicsLayer == m_childClippingMaskLayer.get() ||
graphicsLayer == m_scrollingContentsLayer.get() ||
- graphicsLayer == m_decorationOutlineLayer.get() ||
- graphicsLayer == m_ancestorClippingMaskLayer.get()) {
+ graphicsLayer == m_decorationOutlineLayer.get()) {
bool paintRootBackgroundOntoScrollingContentsLayer =
m_backgroundPaintsOntoScrollingContentsLayer;
DCHECK(!paintRootBackgroundOntoScrollingContentsLayer ||
@@ -3406,8 +3345,6 @@ String CompositedLayerMapping::debugName(
")";
} else if (graphicsLayer == m_ancestorClippingLayer.get()) {
name = "Ancestor Clipping Layer";
- } else if (graphicsLayer == m_ancestorClippingMaskLayer.get()) {
- name = "Ancestor Clipping Mask Layer";
} else if (graphicsLayer == m_foregroundLayer.get()) {
name = m_owningLayer.debugName() + " (foreground) Layer";
} else if (graphicsLayer == m_backgroundLayer.get()) {

Powered by Google App Engine
This is Rietveld 408576698