Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 PaintLayer* oldSquashedLayer = m_squashedLayers[i].paintLayer; | 193 PaintLayer* oldSquashedLayer = m_squashedLayers[i].paintLayer; |
| 194 // Assert on incorrect mappings between layers and groups | 194 // Assert on incorrect mappings between layers and groups |
| 195 ASSERT(oldSquashedLayer->groupedMapping() == this); | 195 ASSERT(oldSquashedLayer->groupedMapping() == this); |
| 196 if (oldSquashedLayer->groupedMapping() == this) { | 196 if (oldSquashedLayer->groupedMapping() == this) { |
| 197 oldSquashedLayer->setGroupedMapping( | 197 oldSquashedLayer->setGroupedMapping( |
| 198 0, PaintLayer::DoNotInvalidateLayerAndRemoveFromMapping); | 198 0, PaintLayer::DoNotInvalidateLayerAndRemoveFromMapping); |
| 199 oldSquashedLayer->setLostGroupedMapping(true); | 199 oldSquashedLayer->setLostGroupedMapping(true); |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 updateClippingLayers(false, false); | 203 updateClippingLayers(false, false, false); |
| 204 updateOverflowControlsLayers(false, false, false, false); | 204 updateOverflowControlsLayers(false, false, false, false); |
| 205 updateChildTransformLayer(false); | 205 updateChildTransformLayer(false); |
| 206 updateForegroundLayer(false); | 206 updateForegroundLayer(false); |
| 207 updateBackgroundLayer(false); | 207 updateBackgroundLayer(false); |
| 208 updateMaskLayer(false); | 208 updateMaskLayer(false); |
| 209 updateChildClippingMaskLayer(false); | 209 updateChildClippingMaskLayer(false); |
| 210 updateScrollingLayers(false); | 210 updateScrollingLayers(false); |
| 211 updateSquashingLayers(false); | 211 updateSquashingLayers(false); |
| 212 destroyGraphicsLayers(); | 212 destroyGraphicsLayers(); |
| 213 } | 213 } |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 237 updateStickyConstraints(layoutObject()->styleRef()); | 237 updateStickyConstraints(layoutObject()->styleRef()); |
| 238 updateLayerBlendMode(layoutObject()->styleRef()); | 238 updateLayerBlendMode(layoutObject()->styleRef()); |
| 239 updateIsRootForIsolatedGroup(); | 239 updateIsRootForIsolatedGroup(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 void CompositedLayerMapping::destroyGraphicsLayers() { | 242 void CompositedLayerMapping::destroyGraphicsLayers() { |
| 243 if (m_graphicsLayer) | 243 if (m_graphicsLayer) |
| 244 m_graphicsLayer->removeFromParent(); | 244 m_graphicsLayer->removeFromParent(); |
| 245 | 245 |
| 246 m_ancestorClippingLayer = nullptr; | 246 m_ancestorClippingLayer = nullptr; |
| 247 m_ancestorClippingMaskLayer = nullptr; | |
| 247 m_graphicsLayer = nullptr; | 248 m_graphicsLayer = nullptr; |
| 248 m_foregroundLayer = nullptr; | 249 m_foregroundLayer = nullptr; |
| 249 m_backgroundLayer = nullptr; | 250 m_backgroundLayer = nullptr; |
| 250 m_childContainmentLayer = nullptr; | 251 m_childContainmentLayer = nullptr; |
| 251 m_childTransformLayer = nullptr; | 252 m_childTransformLayer = nullptr; |
| 252 m_maskLayer = nullptr; | 253 m_maskLayer = nullptr; |
| 253 m_childClippingMaskLayer = nullptr; | 254 m_childClippingMaskLayer = nullptr; |
| 254 | 255 |
| 255 m_scrollingLayer = nullptr; | 256 m_scrollingLayer = nullptr; |
| 256 m_scrollingContentsLayer = nullptr; | 257 m_scrollingContentsLayer = nullptr; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 447 } | 448 } |
| 448 | 449 |
| 449 void CompositedLayerMapping::updateCompositingReasons() { | 450 void CompositedLayerMapping::updateCompositingReasons() { |
| 450 // All other layers owned by this mapping will have the same compositing | 451 // All other layers owned by this mapping will have the same compositing |
| 451 // reason for their lifetime, so they are initialized only when created. | 452 // reason for their lifetime, so they are initialized only when created. |
| 452 m_graphicsLayer->setCompositingReasons(m_owningLayer.getCompositingReasons()); | 453 m_graphicsLayer->setCompositingReasons(m_owningLayer.getCompositingReasons()); |
| 453 m_graphicsLayer->setSquashingDisallowedReasons( | 454 m_graphicsLayer->setSquashingDisallowedReasons( |
| 454 m_owningLayer.getSquashingDisallowedReasons()); | 455 m_owningLayer.getSquashingDisallowedReasons()); |
| 455 } | 456 } |
| 456 | 457 |
| 457 bool CompositedLayerMapping:: | 458 void CompositedLayerMapping:: |
| 458 owningLayerClippedByLayerNotAboveCompositedAncestor( | 459 owningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor( |
| 459 const PaintLayer* scrollParent) { | 460 const PaintLayer* scrollParent, |
| 461 bool& owningLayerIsClipped, | |
| 462 bool& owningLayerIsMasked) { | |
| 463 owningLayerIsClipped = false; | |
| 464 owningLayerIsMasked = false; | |
| 465 | |
| 460 if (!m_owningLayer.parent()) | 466 if (!m_owningLayer.parent()) |
| 461 return false; | 467 return; |
| 462 | 468 |
| 463 const PaintLayer* compositingAncestor = | 469 const PaintLayer* compositingAncestor = |
| 464 m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf); | 470 m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf); |
| 465 if (!compositingAncestor) | 471 if (!compositingAncestor) |
| 466 return false; | 472 return; |
| 467 | 473 |
| 468 const LayoutObject* clippingContainer = m_owningLayer.clippingContainer(); | 474 const LayoutObject* clippingContainer = m_owningLayer.clippingContainer(); |
| 469 if (!clippingContainer) | 475 if (!clippingContainer) |
| 470 return false; | 476 return; |
| 471 | 477 |
| 472 if (clippingContainer->enclosingLayer() == scrollParent) | 478 if (clippingContainer->enclosingLayer() == scrollParent) |
| 473 return false; | 479 return; |
| 474 | 480 |
| 475 if (clippingContainer->enclosingLayer()->hasRootScrollerAsDescendant()) | 481 if (clippingContainer->enclosingLayer()->hasRootScrollerAsDescendant()) |
| 476 return false; | 482 return; |
| 477 | 483 |
| 478 if (compositingAncestor->layoutObject()->isDescendantOf(clippingContainer)) | 484 if (compositingAncestor->layoutObject()->isDescendantOf(clippingContainer)) |
| 479 return false; | 485 return; |
| 486 | |
| 487 if (clippingContainer->enclosingLayer()->hasRootScrollerAsDescendant()) | |
| 488 return; | |
|
Stephen Chennney
2016/11/08 21:42:51
flackr@ told me we need this, and I agree.
| |
| 480 | 489 |
| 481 // We ignore overflow clip here; we want composited overflow content to | 490 // We ignore overflow clip here; we want composited overflow content to |
| 482 // behave as if it lives in an unclipped universe so it can prepaint, etc. | 491 // behave as if it lives in an unclipped universe so it can prepaint, etc. |
| 483 // This means that we need to check if we are actually clipped before | 492 // This means that we need to check if we are actually clipped before |
| 484 // setting up m_ancestorClippingLayer otherwise | 493 // setting up m_ancestorClippingLayer otherwise |
| 485 // updateAncestorClippingLayerGeometry will fail as the clip rect will be | 494 // updateAncestorClippingLayerGeometry will fail as the clip rect will be |
| 486 // infinite. | 495 // infinite. |
| 487 // FIXME: this should use cached clip rects, but this sometimes give | 496 // FIXME: this should use cached clip rects, but this sometimes give |
| 488 // inaccurate results (and trips the ASSERTS in PaintLayerClipper). | 497 // inaccurate results (and trips the ASSERTS in PaintLayerClipper). |
| 489 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects, | 498 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects, |
| 490 IgnoreOverlayScrollbarSize); | 499 IgnoreOverlayScrollbarSize); |
| 491 clipRectsContext.setIgnoreOverflowClip(); | 500 clipRectsContext.setIgnoreOverflowClip(); |
| 492 IntRect parentClipRect = pixelSnappedIntRect( | 501 IntRect parentClipRect = pixelSnappedIntRect( |
| 493 m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect()); | 502 m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect()); |
| 494 return parentClipRect != LayoutRect::infiniteIntRect(); | 503 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect(); |
| 504 | |
| 505 DCHECK(clippingContainer->style()); | |
| 506 owningLayerIsMasked = | |
| 507 owningLayerIsClipped && clippingContainer->style()->hasBorderRadius(); | |
| 495 } | 508 } |
| 496 | 509 |
| 497 const PaintLayer* CompositedLayerMapping::scrollParent() { | 510 const PaintLayer* CompositedLayerMapping::scrollParent() { |
| 498 const PaintLayer* scrollParent = m_owningLayer.scrollParent(); | 511 const PaintLayer* scrollParent = m_owningLayer.scrollParent(); |
| 499 if (scrollParent && !scrollParent->needsCompositedScrolling()) | 512 if (scrollParent && !scrollParent->needsCompositedScrolling()) |
| 500 return nullptr; | 513 return nullptr; |
| 501 return scrollParent; | 514 return scrollParent; |
| 502 } | 515 } |
| 503 | 516 |
| 504 bool CompositedLayerMapping::updateGraphicsLayerConfiguration() { | 517 bool CompositedLayerMapping::updateGraphicsLayerConfiguration() { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 540 needsDescendantsClippingLayer = false; | 553 needsDescendantsClippingLayer = false; |
| 541 | 554 |
| 542 const PaintLayer* scrollParent = this->scrollParent(); | 555 const PaintLayer* scrollParent = this->scrollParent(); |
| 543 | 556 |
| 544 // This is required because compositing layers are parented according to the | 557 // This is required because compositing layers are parented according to the |
| 545 // z-order hierarchy, yet clipping goes down the layoutObject hierarchy. Thus, | 558 // z-order hierarchy, yet clipping goes down the layoutObject hierarchy. Thus, |
| 546 // a PaintLayer can be clipped by a PaintLayer that is an ancestor in the | 559 // a PaintLayer can be clipped by a PaintLayer that is an ancestor in the |
| 547 // layoutObject hierarchy, but a sibling in the z-order hierarchy. Further, | 560 // layoutObject hierarchy, but a sibling in the z-order hierarchy. Further, |
| 548 // that sibling need not be composited at all. In such scenarios, an ancestor | 561 // that sibling need not be composited at all. In such scenarios, an ancestor |
| 549 // clipping layer is necessary to apply the composited clip for this layer. | 562 // clipping layer is necessary to apply the composited clip for this layer. |
| 550 bool needsAncestorClip = | |
| 551 owningLayerClippedByLayerNotAboveCompositedAncestor(scrollParent); | |
| 552 | 563 |
| 553 if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer)) | 564 // TODO(schenney): Can we apply a border radius clip with this ancestor clip |
| 565 // layer? Why do we need a mask for border radius, rather than modifying the | |
| 566 // clip rects applied to the ancestor clip? | |
|
Stephen Chennney
2016/11/08 21:42:51
This comment should be removed. I know why we have
| |
| 567 bool needsAncestorClip = false; | |
| 568 bool needsAncestorClippingMask = false; | |
| 569 owningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor( | |
| 570 scrollParent, needsAncestorClip, needsAncestorClippingMask); | |
| 571 fprintf(stderr, "needsAnsectorClip %s, needsAncestorClippingMask %s\n", | |
| 572 needsAncestorClip ? "true" : "false", | |
| 573 needsAncestorClippingMask ? "true" : "false"); | |
| 574 if (updateClippingLayers(needsAncestorClip, needsAncestorClippingMask, | |
| 575 needsDescendantsClippingLayer)) | |
| 554 layerConfigChanged = true; | 576 layerConfigChanged = true; |
| 555 | 577 |
| 556 bool scrollingConfigChanged = false; | 578 bool scrollingConfigChanged = false; |
| 557 if (updateScrollingLayers(m_owningLayer.needsCompositedScrolling())) { | 579 if (updateScrollingLayers(m_owningLayer.needsCompositedScrolling())) { |
| 558 layerConfigChanged = true; | 580 layerConfigChanged = true; |
| 559 scrollingConfigChanged = true; | 581 scrollingConfigChanged = true; |
| 560 } | 582 } |
| 561 | 583 |
| 562 if (updateOverflowControlsLayers( | 584 if (updateOverflowControlsLayers( |
| 563 requiresHorizontalScrollbarLayer(), requiresVerticalScrollbarLayer(), | 585 requiresHorizontalScrollbarLayer(), requiresVerticalScrollbarLayer(), |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1051 m_ancestorClippingLayer->setPosition( | 1073 m_ancestorClippingLayer->setPosition( |
| 1052 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); | 1074 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); |
| 1053 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size())); | 1075 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size())); |
| 1054 | 1076 |
| 1055 // backgroundRect is relative to compositingContainer, so subtract | 1077 // backgroundRect is relative to compositingContainer, so subtract |
| 1056 // snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y | 1078 // snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y |
| 1057 // to get back to local coords. | 1079 // to get back to local coords. |
| 1058 m_ancestorClippingLayer->setOffsetFromLayoutObject( | 1080 m_ancestorClippingLayer->setOffsetFromLayoutObject( |
| 1059 parentClipRect.location() - snappedOffsetFromCompositedAncestor); | 1081 parentClipRect.location() - snappedOffsetFromCompositedAncestor); |
| 1060 | 1082 |
| 1083 if (m_ancestorClippingMaskLayer) { | |
| 1084 m_ancestorClippingMaskLayer->setPosition( | |
| 1085 m_ancestorClippingLayer | |
| 1086 ->position()); // TODO(schenney) Don't need this? | |
|
Stephen Chennney
2016/11/08 21:42:51
Looks like we do not need this, but more testing i
| |
| 1087 m_ancestorClippingMaskLayer->setSize(m_ancestorClippingLayer->size()); | |
| 1088 m_ancestorClippingMaskLayer->setNeedsDisplay(); | |
| 1089 } | |
| 1090 | |
| 1061 // The primary layer is then parented in, and positioned relative to this | 1091 // The primary layer is then parented in, and positioned relative to this |
| 1062 // clipping layer. | 1092 // clipping layer. |
| 1063 graphicsLayerParentLocation = parentClipRect.location(); | 1093 graphicsLayerParentLocation = parentClipRect.location(); |
| 1064 } | 1094 } |
| 1065 | 1095 |
| 1066 void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry( | 1096 void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry( |
| 1067 const PaintLayer* compositingStackingContext, | 1097 const PaintLayer* compositingStackingContext, |
| 1068 const PaintLayer* compositingContainer, | 1098 const PaintLayer* compositingContainer, |
| 1069 IntPoint graphicsLayerParentLocation) { | 1099 IntPoint graphicsLayerParentLocation) { |
| 1070 if (!m_overflowControlsHostLayer) | 1100 if (!m_overflowControlsHostLayer) |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1565 } | 1595 } |
| 1566 | 1596 |
| 1567 // FIXME: we could refine this to only allocate backings for one of these | 1597 // FIXME: we could refine this to only allocate backings for one of these |
| 1568 // layers if possible. | 1598 // layers if possible. |
| 1569 if (m_foregroundLayer) | 1599 if (m_foregroundLayer) |
| 1570 m_foregroundLayer->setDrawsContent(hasPaintedContent); | 1600 m_foregroundLayer->setDrawsContent(hasPaintedContent); |
| 1571 | 1601 |
| 1572 if (m_backgroundLayer) | 1602 if (m_backgroundLayer) |
| 1573 m_backgroundLayer->setDrawsContent(hasPaintedContent); | 1603 m_backgroundLayer->setDrawsContent(hasPaintedContent); |
| 1574 | 1604 |
| 1605 if (m_ancestorClippingMaskLayer) | |
| 1606 m_ancestorClippingMaskLayer->setDrawsContent(true); | |
| 1607 | |
| 1575 if (m_maskLayer) | 1608 if (m_maskLayer) |
| 1576 m_maskLayer->setDrawsContent(true); | 1609 m_maskLayer->setDrawsContent(true); |
| 1577 | 1610 |
| 1578 if (m_childClippingMaskLayer) | 1611 if (m_childClippingMaskLayer) |
| 1579 m_childClippingMaskLayer->setDrawsContent(true); | 1612 m_childClippingMaskLayer->setDrawsContent(true); |
| 1580 } | 1613 } |
| 1581 | 1614 |
| 1582 void CompositedLayerMapping::updateChildrenTransform() { | 1615 void CompositedLayerMapping::updateChildrenTransform() { |
| 1583 if (GraphicsLayer* childTransformLayer = this->childTransformLayer()) { | 1616 if (GraphicsLayer* childTransformLayer = this->childTransformLayer()) { |
| 1584 childTransformLayer->setTransform(owningLayer().perspectiveTransform()); | 1617 childTransformLayer->setTransform(owningLayer().perspectiveTransform()); |
| 1585 childTransformLayer->setTransformOrigin(owningLayer().perspectiveOrigin()); | 1618 childTransformLayer->setTransformOrigin(owningLayer().perspectiveOrigin()); |
| 1586 } | 1619 } |
| 1587 | 1620 |
| 1588 updateShouldFlattenTransform(); | 1621 updateShouldFlattenTransform(); |
| 1589 } | 1622 } |
| 1590 | 1623 |
| 1591 // Return true if the layers changed. | 1624 // Return true if the layers changed. |
| 1592 bool CompositedLayerMapping::updateClippingLayers(bool needsAncestorClip, | 1625 bool CompositedLayerMapping::updateClippingLayers( |
| 1593 bool needsDescendantClip) { | 1626 bool needsAncestorClip, |
| 1627 bool needsAncestorClippingMask, | |
| 1628 bool needsDescendantClip) { | |
| 1594 bool layersChanged = false; | 1629 bool layersChanged = false; |
| 1595 | 1630 |
| 1596 if (needsAncestorClip) { | 1631 if (needsAncestorClip) { |
| 1597 if (!m_ancestorClippingLayer) { | 1632 if (!m_ancestorClippingLayer) { |
| 1598 m_ancestorClippingLayer = | 1633 m_ancestorClippingLayer = |
| 1599 createGraphicsLayer(CompositingReasonLayerForAncestorClip); | 1634 createGraphicsLayer(CompositingReasonLayerForAncestorClip); |
| 1600 m_ancestorClippingLayer->setMasksToBounds(true); | 1635 m_ancestorClippingLayer->setMasksToBounds(true); |
| 1601 m_ancestorClippingLayer->setShouldFlattenTransform(false); | 1636 m_ancestorClippingLayer->setShouldFlattenTransform(false); |
| 1637 if (needsAncestorClippingMask) { | |
| 1638 m_ancestorClippingMaskLayer = | |
| 1639 createGraphicsLayer(CompositingReasonLayerForAncestorClippingMask); | |
| 1640 m_ancestorClippingMaskLayer->setPaintingPhase( | |
| 1641 GraphicsLayerPaintAncestorClippingMask); | |
| 1642 m_ancestorClippingLayer->setMaskLayer( | |
| 1643 m_ancestorClippingMaskLayer.get()); | |
| 1644 } else if (!needsAncestorClippingMask) { | |
| 1645 if (m_ancestorClippingMaskLayer) { | |
| 1646 m_ancestorClippingMaskLayer = nullptr; | |
| 1647 m_ancestorClippingLayer->setMaskLayer(nullptr); | |
| 1648 } | |
| 1649 } | |
| 1602 layersChanged = true; | 1650 layersChanged = true; |
| 1603 } | 1651 } |
| 1604 } else if (m_ancestorClippingLayer) { | 1652 } else if (m_ancestorClippingLayer) { |
| 1653 if (m_ancestorClippingMaskLayer) { | |
| 1654 m_ancestorClippingMaskLayer->removeFromParent(); | |
| 1655 m_ancestorClippingMaskLayer = nullptr; | |
| 1656 } | |
| 1605 m_ancestorClippingLayer->removeFromParent(); | 1657 m_ancestorClippingLayer->removeFromParent(); |
| 1606 m_ancestorClippingLayer = nullptr; | 1658 m_ancestorClippingLayer = nullptr; |
| 1607 layersChanged = true; | 1659 layersChanged = true; |
| 1608 } | 1660 } |
| 1609 | 1661 |
| 1610 if (needsDescendantClip) { | 1662 if (needsDescendantClip) { |
| 1611 // We don't need a child containment layer if we're the main frame layout | 1663 // We don't need a child containment layer if we're the main frame layout |
| 1612 // view layer. It's redundant as the frame clip above us will handle this | 1664 // view layer. It's redundant as the frame clip above us will handle this |
| 1613 // clipping. | 1665 // clipping. |
| 1614 if (!m_childContainmentLayer && !m_isMainFrameLayoutViewLayer) { | 1666 if (!m_childContainmentLayer && !m_isMainFrameLayoutViewLayer) { |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2136 // Only the topmost layer has a scroll parent. All other layers have a null | 2188 // Only the topmost layer has a scroll parent. All other layers have a null |
| 2137 // scroll parent. | 2189 // scroll parent. |
| 2138 if (layer != topmostLayer) | 2190 if (layer != topmostLayer) |
| 2139 clipParent = 0; | 2191 clipParent = 0; |
| 2140 | 2192 |
| 2141 scrollingCoordinator->updateClipParentForGraphicsLayer(layer, clipParent); | 2193 scrollingCoordinator->updateClipParentForGraphicsLayer(layer, clipParent); |
| 2142 } | 2194 } |
| 2143 | 2195 |
| 2144 void CompositedLayerMapping::updateClipParent(const PaintLayer* scrollParent) { | 2196 void CompositedLayerMapping::updateClipParent(const PaintLayer* scrollParent) { |
| 2145 const PaintLayer* clipParent = nullptr; | 2197 const PaintLayer* clipParent = nullptr; |
| 2146 if (!owningLayerClippedByLayerNotAboveCompositedAncestor(scrollParent)) { | 2198 bool haveAncestorClipLayer = false; |
| 2199 bool haveAncestorMaskLayer = false; | |
| 2200 owningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor( | |
| 2201 scrollParent, haveAncestorClipLayer, haveAncestorMaskLayer); | |
| 2202 if (!haveAncestorClipLayer) { | |
| 2147 clipParent = m_owningLayer.clipParent(); | 2203 clipParent = m_owningLayer.clipParent(); |
| 2148 if (clipParent) | 2204 if (clipParent) |
| 2149 clipParent = | 2205 clipParent = |
| 2150 clipParent->enclosingLayerWithCompositedLayerMapping(IncludeSelf); | 2206 clipParent->enclosingLayerWithCompositedLayerMapping(IncludeSelf); |
| 2151 } | 2207 } |
| 2152 | 2208 |
| 2153 if (ScrollingCoordinator* scrollingCoordinator = | 2209 if (ScrollingCoordinator* scrollingCoordinator = |
| 2154 scrollingCoordinatorFromLayer(m_owningLayer)) { | 2210 scrollingCoordinatorFromLayer(m_owningLayer)) { |
| 2155 GraphicsLayer* topmostLayer = childForSuperlayers(); | 2211 GraphicsLayer* topmostLayer = childForSuperlayers(); |
| 2156 updateClipParentForGraphicsLayer(m_squashingContainmentLayer.get(), | 2212 updateClipParentForGraphicsLayer(m_squashingContainmentLayer.get(), |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2946 if (graphicsLayerPaintingPhase & GraphicsLayerPaintBackground) | 3002 if (graphicsLayerPaintingPhase & GraphicsLayerPaintBackground) |
| 2947 paintLayerFlags |= PaintLayerPaintingCompositingBackgroundPhase; | 3003 paintLayerFlags |= PaintLayerPaintingCompositingBackgroundPhase; |
| 2948 else | 3004 else |
| 2949 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 3005 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
| 2950 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) | 3006 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) |
| 2951 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; | 3007 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; |
| 2952 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) | 3008 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) |
| 2953 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; | 3009 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; |
| 2954 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) | 3010 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) |
| 2955 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; | 3011 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; |
| 3012 if (graphicsLayerPaintingPhase & GraphicsLayerPaintAncestorClippingMask) | |
| 3013 paintLayerFlags |= PaintLayerPaintingAncestorClippingMaskPhase; | |
| 2956 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) | 3014 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) |
| 2957 paintLayerFlags |= PaintLayerPaintingOverflowContents; | 3015 paintLayerFlags |= PaintLayerPaintingOverflowContents; |
| 2958 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) | 3016 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) |
| 2959 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; | 3017 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; |
| 2960 | 3018 |
| 2961 if (graphicsLayer == m_backgroundLayer.get()) | 3019 if (graphicsLayer == m_backgroundLayer.get()) |
| 2962 paintLayerFlags |= PaintLayerPaintingRootBackgroundOnly; | 3020 paintLayerFlags |= PaintLayerPaintingRootBackgroundOnly; |
| 2963 else if (compositor()->fixedRootBackgroundLayer() && | 3021 else if (compositor()->fixedRootBackgroundLayer() && |
| 2964 m_owningLayer.isRootLayer()) | 3022 m_owningLayer.isRootLayer()) |
| 2965 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 3023 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
| 2966 | 3024 |
| 2967 if (graphicsLayer == m_graphicsLayer.get() || | 3025 if (graphicsLayer == m_graphicsLayer.get() || |
| 2968 graphicsLayer == m_foregroundLayer.get() || | 3026 graphicsLayer == m_foregroundLayer.get() || |
| 2969 graphicsLayer == m_backgroundLayer.get() || | 3027 graphicsLayer == m_backgroundLayer.get() || |
| 2970 graphicsLayer == m_maskLayer.get() || | 3028 graphicsLayer == m_maskLayer.get() || |
| 2971 graphicsLayer == m_childClippingMaskLayer.get() || | 3029 graphicsLayer == m_childClippingMaskLayer.get() || |
| 2972 graphicsLayer == m_scrollingContentsLayer.get()) { | 3030 graphicsLayer == m_scrollingContentsLayer.get() || |
| 3031 graphicsLayer == m_scrollingContentsLayer.get() || | |
| 3032 graphicsLayer == m_ancestorClippingMaskLayer.get()) { | |
| 2973 bool paintRootBackgroundOntoScrollingContentsLayer = | 3033 bool paintRootBackgroundOntoScrollingContentsLayer = |
| 2974 m_backgroundPaintsOntoScrollingContentsLayer; | 3034 m_backgroundPaintsOntoScrollingContentsLayer; |
| 2975 DCHECK(!paintRootBackgroundOntoScrollingContentsLayer || | 3035 DCHECK(!paintRootBackgroundOntoScrollingContentsLayer || |
| 2976 (!m_backgroundLayer && !m_foregroundLayer)); | 3036 (!m_backgroundLayer && !m_foregroundLayer)); |
| 2977 if (paintRootBackgroundOntoScrollingContentsLayer) { | 3037 if (paintRootBackgroundOntoScrollingContentsLayer) { |
| 2978 if (graphicsLayer == m_scrollingContentsLayer.get()) | 3038 if (graphicsLayer == m_scrollingContentsLayer.get()) |
| 2979 paintLayerFlags &= ~PaintLayerPaintingSkipRootBackground; | 3039 paintLayerFlags &= ~PaintLayerPaintingSkipRootBackground; |
| 2980 else | 3040 else |
| 2981 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 3041 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
| 2982 } | 3042 } |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3217 } else if (graphicsLayer == m_squashingContainmentLayer.get()) { | 3277 } else if (graphicsLayer == m_squashingContainmentLayer.get()) { |
| 3218 name = "Squashing Containment Layer"; | 3278 name = "Squashing Containment Layer"; |
| 3219 } else if (graphicsLayer == m_squashingLayer.get()) { | 3279 } else if (graphicsLayer == m_squashingLayer.get()) { |
| 3220 name = "Squashing Layer (first squashed layer: " + | 3280 name = "Squashing Layer (first squashed layer: " + |
| 3221 (m_squashedLayers.size() > 0 | 3281 (m_squashedLayers.size() > 0 |
| 3222 ? m_squashedLayers[0].paintLayer->debugName() | 3282 ? m_squashedLayers[0].paintLayer->debugName() |
| 3223 : "") + | 3283 : "") + |
| 3224 ")"; | 3284 ")"; |
| 3225 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { | 3285 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { |
| 3226 name = "Ancestor Clipping Layer"; | 3286 name = "Ancestor Clipping Layer"; |
| 3287 } else if (graphicsLayer == m_ancestorClippingMaskLayer.get()) { | |
| 3288 name = "Ancestor Clipping Mask Layer"; | |
| 3227 } else if (graphicsLayer == m_foregroundLayer.get()) { | 3289 } else if (graphicsLayer == m_foregroundLayer.get()) { |
| 3228 name = m_owningLayer.debugName() + " (foreground) Layer"; | 3290 name = m_owningLayer.debugName() + " (foreground) Layer"; |
| 3229 } else if (graphicsLayer == m_backgroundLayer.get()) { | 3291 } else if (graphicsLayer == m_backgroundLayer.get()) { |
| 3230 name = m_owningLayer.debugName() + " (background) Layer"; | 3292 name = m_owningLayer.debugName() + " (background) Layer"; |
| 3231 } else if (graphicsLayer == m_childContainmentLayer.get()) { | 3293 } else if (graphicsLayer == m_childContainmentLayer.get()) { |
| 3232 name = "Child Containment Layer"; | 3294 name = "Child Containment Layer"; |
| 3233 } else if (graphicsLayer == m_childTransformLayer.get()) { | 3295 } else if (graphicsLayer == m_childTransformLayer.get()) { |
| 3234 name = "Child Transform Layer"; | 3296 name = "Child Transform Layer"; |
| 3235 } else if (graphicsLayer == m_maskLayer.get()) { | 3297 } else if (graphicsLayer == m_maskLayer.get()) { |
| 3236 name = "Mask Layer"; | 3298 name = "Mask Layer"; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 3251 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 3313 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 3252 name = "Scrolling Contents Layer"; | 3314 name = "Scrolling Contents Layer"; |
| 3253 } else { | 3315 } else { |
| 3254 ASSERT_NOT_REACHED(); | 3316 ASSERT_NOT_REACHED(); |
| 3255 } | 3317 } |
| 3256 | 3318 |
| 3257 return name; | 3319 return name; |
| 3258 } | 3320 } |
| 3259 | 3321 |
| 3260 } // namespace blink | 3322 } // namespace blink |
| OLD | NEW |