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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 if (page && page->mainFrame() == &frame) { | 164 if (page && page->mainFrame() == &frame) { |
165 m_isMainFrameRenderViewLayer = true; | 165 m_isMainFrameRenderViewLayer = true; |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 createPrimaryGraphicsLayer(); | 169 createPrimaryGraphicsLayer(); |
170 } | 170 } |
171 | 171 |
172 RenderLayerBacking::~RenderLayerBacking() | 172 RenderLayerBacking::~RenderLayerBacking() |
173 { | 173 { |
174 updateClippingLayers(false, false); | 174 updateClippingLayers(false, false, false); |
175 updateOverflowControlsLayers(false, false, false); | 175 updateOverflowControlsLayers(false, false, false); |
176 updateForegroundLayer(false); | 176 updateForegroundLayer(false); |
177 updateBackgroundLayer(false); | 177 updateBackgroundLayer(false); |
178 updateMaskLayer(false); | 178 updateMaskLayer(false); |
179 updateScrollingLayers(false); | 179 updateScrollingLayers(false); |
180 destroyGraphicsLayers(); | 180 destroyGraphicsLayers(); |
181 } | 181 } |
182 | 182 |
183 PassOwnPtr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(CompositingRea
sons reasons) | 183 PassOwnPtr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(CompositingRea
sons reasons) |
184 { | 184 { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 | 411 |
412 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(m_owning
Layer))) | 412 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(m_owning
Layer))) |
413 layerConfigChanged = true; | 413 layerConfigChanged = true; |
414 | 414 |
415 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants
(m_owningLayer); | 415 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants
(m_owningLayer); |
416 | 416 |
417 // Our scrolling layer will clip. | 417 // Our scrolling layer will clip. |
418 if (m_owningLayer->needsCompositedScrolling()) | 418 if (m_owningLayer->needsCompositedScrolling()) |
419 needsDescendentsClippingLayer = false; | 419 needsDescendentsClippingLayer = false; |
420 | 420 |
421 if (updateClippingLayers(compositor->clippedByAncestor(m_owningLayer), needs
DescendentsClippingLayer)) | 421 bool needsAncestorClip = compositor->clippedByAncestor(m_owningLayer); |
| 422 bool needsScrollClip = m_owningLayer->hasScrollParent(); |
| 423 if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer, n
eedsScrollClip)) |
422 layerConfigChanged = true; | 424 layerConfigChanged = true; |
423 | 425 |
424 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require
sVerticalScrollbarLayer(), requiresScrollCornerLayer())) | 426 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require
sVerticalScrollbarLayer(), requiresScrollCornerLayer())) |
425 layerConfigChanged = true; | 427 layerConfigChanged = true; |
426 | 428 |
427 if (updateScrollingLayers(m_owningLayer->needsCompositedScrolling())) | 429 if (updateScrollingLayers(m_owningLayer->needsCompositedScrolling())) |
428 layerConfigChanged = true; | 430 layerConfigChanged = true; |
429 | 431 |
| 432 updateScrollParent(needsScrollClip); |
| 433 |
| 434 updateClipParent(needsAncestorClip); |
| 435 |
430 if (layerConfigChanged) | 436 if (layerConfigChanged) |
431 updateInternalHierarchy(); | 437 updateInternalHierarchy(); |
432 | 438 |
433 if (updateMaskLayer(renderer->hasMask())) | 439 if (updateMaskLayer(renderer->hasMask())) |
434 m_graphicsLayer->setMaskLayer(m_maskLayer.get()); | 440 m_graphicsLayer->setMaskLayer(m_maskLayer.get()); |
435 | 441 |
436 if (m_owningLayer->hasReflection()) { | 442 if (m_owningLayer->hasReflection()) { |
437 if (m_owningLayer->reflectionLayer()->backing()) { | 443 if (m_owningLayer->reflectionLayer()->backing()) { |
438 GraphicsLayer* reflectionLayer = m_owningLayer->reflectionLayer()->b
acking()->graphicsLayer(); | 444 GraphicsLayer* reflectionLayer = m_owningLayer->reflectionLayer()->b
acking()->graphicsLayer(); |
439 m_graphicsLayer->setReplicatedByLayer(reflectionLayer); | 445 m_graphicsLayer->setReplicatedByLayer(reflectionLayer); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 else | 542 else |
537 graphicsLayerParentLocation = renderer()->view()->documentRect().locatio
n(); | 543 graphicsLayerParentLocation = renderer()->view()->documentRect().locatio
n(); |
538 | 544 |
539 if (compAncestor && compAncestor->needsCompositedScrolling()) { | 545 if (compAncestor && compAncestor->needsCompositedScrolling()) { |
540 RenderBox* renderBox = toRenderBox(compAncestor->renderer()); | 546 RenderBox* renderBox = toRenderBox(compAncestor->renderer()); |
541 IntSize scrollOffset = compAncestor->scrolledContentOffset(); | 547 IntSize scrollOffset = compAncestor->scrolledContentOffset(); |
542 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop()); | 548 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop()); |
543 graphicsLayerParentLocation = scrollOrigin - scrollOffset; | 549 graphicsLayerParentLocation = scrollOrigin - scrollOffset; |
544 } | 550 } |
545 | 551 |
| 552 if (compAncestor && m_ancestorScrollClippingLayer) { |
| 553 // Our scroll parent must have been processed before us. |
| 554 RenderLayer* scrollParent = m_owningLayer->ancestorScrollingLayer(); |
| 555 GraphicsLayer* scrollParentClippingLayer = scrollParent->backing()->scro
llingLayer(); |
| 556 |
| 557 // Not relative to our parent graphics layer. |
| 558 FloatPoint position; |
| 559 GraphicsLayer* scrollParentChildForSuperlayers = scrollParent->backing()
->childForSuperlayers(); |
| 560 |
| 561 for (GraphicsLayer* scrollAncestor = scrollParentClippingLayer; scrollAn
cestor; scrollAncestor = scrollAncestor->parent()) { |
| 562 position = position + toFloatSize(scrollAncestor->position()); |
| 563 if (scrollAncestor == scrollParentChildForSuperlayers) |
| 564 break; |
| 565 } |
| 566 |
| 567 m_ancestorScrollClippingLayer->setPosition(position); |
| 568 m_ancestorScrollClippingLayer->setSize(scrollParentClippingLayer->size()
); |
| 569 m_ancestorScrollClippingLayer->setOffsetFromRenderer(toIntSize(roundedIn
tPoint(-position))); |
| 570 |
| 571 graphicsLayerParentLocation = roundedIntPoint(position); |
| 572 } |
| 573 |
546 if (compAncestor && m_ancestorClippingLayer) { | 574 if (compAncestor && m_ancestorClippingLayer) { |
547 // Call calculateRects to get the backgroundRect which is what is used t
o clip the contents of this | 575 // Call calculateRects to get the backgroundRect which is what is used t
o clip the contents of this |
548 // layer. Note that we call it with temporaryClipRects = true because no
rmally when computing clip rects | 576 // layer. Note that we call it with temporaryClipRects = true because no
rmally when computing clip rects |
549 // for a compositing layer, rootLayer is the layer itself. | 577 // for a compositing layer, rootLayer is the layer itself. |
550 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0, Temporar
yClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip); | 578 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0, Temporar
yClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip); |
551 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundCl
ipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. | 579 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundCl
ipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. |
552 ASSERT(parentClipRect != PaintInfo::infiniteRect()); | 580 ASSERT(parentClipRect != PaintInfo::infiniteRect()); |
553 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location(
) - graphicsLayerParentLocation)); | 581 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location(
) - graphicsLayerParentLocation)); |
554 m_ancestorClippingLayer->setSize(parentClipRect.size()); | 582 m_ancestorClippingLayer->setSize(parentClipRect.size()); |
555 | 583 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 770 |
743 // Page scale is applied as a transform on the root render view layer. Becau
se the scroll | 771 // Page scale is applied as a transform on the root render view layer. Becau
se the scroll |
744 // layer is further up in the hierarchy, we need to avoid marking the root r
ender view | 772 // layer is further up in the hierarchy, we need to avoid marking the root r
ender view |
745 // layer as a container. | 773 // layer as a container. |
746 bool isContainer = m_owningLayer->hasTransform() && !m_owningLayer->isRootLa
yer(); | 774 bool isContainer = m_owningLayer->hasTransform() && !m_owningLayer->isRootLa
yer(); |
747 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe
rlayers(), isContainer); | 775 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe
rlayers(), isContainer); |
748 } | 776 } |
749 | 777 |
750 void RenderLayerBacking::updateInternalHierarchy() | 778 void RenderLayerBacking::updateInternalHierarchy() |
751 { | 779 { |
| 780 if (m_ancestorScrollClippingLayer) |
| 781 m_ancestorScrollClippingLayer->removeAllChildren(); |
| 782 |
752 // m_foregroundLayer has to be inserted in the correct order with child laye
rs, | 783 // m_foregroundLayer has to be inserted in the correct order with child laye
rs, |
753 // so it's not inserted here. | 784 // so it's not inserted here. |
754 if (m_ancestorClippingLayer) | 785 if (m_ancestorClippingLayer) |
755 m_ancestorClippingLayer->removeAllChildren(); | 786 m_ancestorClippingLayer->removeAllChildren(); |
756 | 787 |
757 m_graphicsLayer->removeFromParent(); | 788 m_graphicsLayer->removeFromParent(); |
758 | 789 |
759 if (m_ancestorClippingLayer) | 790 if (m_ancestorClippingLayer) |
760 m_ancestorClippingLayer->addChild(m_graphicsLayer.get()); | 791 m_ancestorClippingLayer->addChild(m_graphicsLayer.get()); |
761 | 792 |
| 793 if (m_ancestorScrollClippingLayer) { |
| 794 if (m_ancestorClippingLayer) |
| 795 m_ancestorScrollClippingLayer->addChild(m_ancestorClippingLayer.get(
)); |
| 796 else |
| 797 m_ancestorScrollClippingLayer->addChild(m_graphicsLayer.get()); |
| 798 } |
| 799 |
762 if (m_childContainmentLayer) { | 800 if (m_childContainmentLayer) { |
763 m_childContainmentLayer->removeFromParent(); | 801 m_childContainmentLayer->removeFromParent(); |
764 m_graphicsLayer->addChild(m_childContainmentLayer.get()); | 802 m_graphicsLayer->addChild(m_childContainmentLayer.get()); |
765 } | 803 } |
766 | 804 |
767 if (m_scrollingLayer) { | 805 if (m_scrollingLayer) { |
768 GraphicsLayer* superlayer = m_childContainmentLayer ? m_childContainment
Layer.get() : m_graphicsLayer.get(); | 806 GraphicsLayer* superlayer = m_childContainmentLayer ? m_childContainment
Layer.get() : m_graphicsLayer.get(); |
769 m_scrollingLayer->removeFromParent(); | 807 m_scrollingLayer->removeFromParent(); |
770 superlayer->addChild(m_scrollingLayer.get()); | 808 superlayer->addChild(m_scrollingLayer.get()); |
771 } | 809 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 // FIXME: we could refine this to only allocate backing for one of these lay
ers if possible. | 868 // FIXME: we could refine this to only allocate backing for one of these lay
ers if possible. |
831 m_graphicsLayer->setDrawsContent(hasPaintedContent); | 869 m_graphicsLayer->setDrawsContent(hasPaintedContent); |
832 if (m_foregroundLayer) | 870 if (m_foregroundLayer) |
833 m_foregroundLayer->setDrawsContent(hasPaintedContent); | 871 m_foregroundLayer->setDrawsContent(hasPaintedContent); |
834 | 872 |
835 if (m_backgroundLayer) | 873 if (m_backgroundLayer) |
836 m_backgroundLayer->setDrawsContent(hasPaintedContent); | 874 m_backgroundLayer->setDrawsContent(hasPaintedContent); |
837 } | 875 } |
838 | 876 |
839 // Return true if the layers changed. | 877 // Return true if the layers changed. |
840 bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs
DescendantClip) | 878 bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs
DescendantClip, bool needsScrollClip) |
841 { | 879 { |
842 bool layersChanged = false; | 880 bool layersChanged = false; |
843 | 881 |
844 if (needsAncestorClip) { | 882 if (needsAncestorClip) { |
845 if (!m_ancestorClippingLayer) { | 883 if (!m_ancestorClippingLayer) { |
846 m_ancestorClippingLayer = createGraphicsLayer(CompositingReasonLayer
ForClip); | 884 m_ancestorClippingLayer = createGraphicsLayer(CompositingReasonLayer
ForClip); |
847 m_ancestorClippingLayer->setMasksToBounds(true); | 885 m_ancestorClippingLayer->setMasksToBounds(true); |
848 layersChanged = true; | 886 layersChanged = true; |
849 } | 887 } |
850 } else if (m_ancestorClippingLayer) { | 888 } else if (m_ancestorClippingLayer) { |
851 m_ancestorClippingLayer->removeFromParent(); | 889 m_ancestorClippingLayer->removeFromParent(); |
852 m_ancestorClippingLayer = nullptr; | 890 m_ancestorClippingLayer = nullptr; |
853 layersChanged = true; | 891 layersChanged = true; |
854 } | 892 } |
855 | 893 |
856 if (needsDescendantClip) { | 894 if (needsDescendantClip) { |
857 // We don't need a child containment layer if we're the main frame rende
r view | 895 // We don't need a child containment layer if we're the main frame rende
r view |
858 // layer. It's redundant as the frame clip above us will handle this cli
pping. | 896 // layer. It's redundant as the frame clip above us will handle this cli
pping. |
859 if (!m_childContainmentLayer && !m_isMainFrameRenderViewLayer) { | 897 if (!m_childContainmentLayer && !m_isMainFrameRenderViewLayer) { |
860 m_childContainmentLayer = createGraphicsLayer(CompositingReasonLayer
ForClip); | 898 m_childContainmentLayer = createGraphicsLayer(CompositingReasonLayer
ForClip); |
861 m_childContainmentLayer->setMasksToBounds(true); | 899 m_childContainmentLayer->setMasksToBounds(true); |
862 layersChanged = true; | 900 layersChanged = true; |
863 } | 901 } |
864 } else if (hasClippingLayer()) { | 902 } else if (hasClippingLayer()) { |
865 m_childContainmentLayer->removeFromParent(); | 903 m_childContainmentLayer->removeFromParent(); |
866 m_childContainmentLayer = nullptr; | 904 m_childContainmentLayer = nullptr; |
867 layersChanged = true; | 905 layersChanged = true; |
868 } | 906 } |
869 | 907 |
| 908 if (needsScrollClip) { |
| 909 if (!m_ancestorScrollClippingLayer) { |
| 910 m_ancestorScrollClippingLayer = createGraphicsLayer(CompositingReaso
nLayerForClip); |
| 911 m_ancestorScrollClippingLayer->setMasksToBounds(true); |
| 912 layersChanged = true; |
| 913 } |
| 914 } else if (m_ancestorScrollClippingLayer) { |
| 915 m_ancestorScrollClippingLayer->removeFromParent(); |
| 916 m_ancestorScrollClippingLayer = nullptr; |
| 917 layersChanged = true; |
| 918 } |
| 919 |
870 return layersChanged; | 920 return layersChanged; |
871 } | 921 } |
872 | 922 |
873 void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgr
oundLayerPaintsFixedRootBackground) | 923 void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgr
oundLayerPaintsFixedRootBackground) |
874 { | 924 { |
875 m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootB
ackground; | 925 m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootB
ackground; |
876 } | 926 } |
877 | 927 |
878 bool RenderLayerBacking::updateOverflowControlsLayers(bool needsHorizontalScroll
barLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer) | 928 bool RenderLayerBacking::updateOverflowControlsLayers(bool needsHorizontalScroll
barLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer) |
879 { | 929 { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 updateInternalHierarchy(); | 1132 updateInternalHierarchy(); |
1083 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); | 1133 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); |
1084 m_graphicsLayer->setNeedsDisplay(); | 1134 m_graphicsLayer->setNeedsDisplay(); |
1085 if (renderer()->view()) | 1135 if (renderer()->view()) |
1086 compositor()->scrollingLayerDidChange(m_owningLayer); | 1136 compositor()->scrollingLayerDidChange(m_owningLayer); |
1087 } | 1137 } |
1088 | 1138 |
1089 return layerChanged; | 1139 return layerChanged; |
1090 } | 1140 } |
1091 | 1141 |
| 1142 void RenderLayerBacking::updateScrollParent(bool needsScrollParent) |
| 1143 { |
| 1144 ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m
_owningLayer); |
| 1145 if (!scrollingCoordinator) |
| 1146 return; |
| 1147 |
| 1148 RenderLayer* scrollParent = 0; |
| 1149 if (needsScrollParent) |
| 1150 scrollParent = m_owningLayer->ancestorScrollingLayer(); |
| 1151 |
| 1152 scrollingCoordinator->updateScrollParentForLayer(m_owningLayer, scrollParent
); |
| 1153 } |
| 1154 |
| 1155 void RenderLayerBacking::updateClipParent(bool needsAncestorClip) |
| 1156 { |
| 1157 ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m
_owningLayer); |
| 1158 if (!scrollingCoordinator) |
| 1159 return; |
| 1160 |
| 1161 // If the clip we want to ignore is established by a stacking sibling, it wo
n't affect us. |
| 1162 // We've already made sure that we don't get a troublesome m_ancestorClippin
gLayer in this case. |
| 1163 RenderLayer* clipParent = 0; |
| 1164 if ((m_owningLayer->compositingReasons() & CompositingReasonOutOfFlowClippin
g) && !needsAncestorClip) { |
| 1165 if (RenderObject* containingBlock = m_owningLayer->renderer()->containin
gBlock()) |
| 1166 clipParent = containingBlock->enclosingLayer()->enclosingCompositing
Layer(true); |
| 1167 } |
| 1168 |
| 1169 scrollingCoordinator->updateClipParentForLayer(m_owningLayer, clipParent); |
| 1170 } |
| 1171 |
1092 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co
nst | 1172 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co
nst |
1093 { | 1173 { |
1094 unsigned phase = 0; | 1174 unsigned phase = 0; |
1095 if (!m_backgroundLayer) | 1175 if (!m_backgroundLayer) |
1096 phase |= GraphicsLayerPaintBackground; | 1176 phase |= GraphicsLayerPaintBackground; |
1097 if (!m_foregroundLayer) | 1177 if (!m_foregroundLayer) |
1098 phase |= GraphicsLayerPaintForeground; | 1178 phase |= GraphicsLayerPaintForeground; |
1099 if (!m_maskLayer) | 1179 if (!m_maskLayer) |
1100 phase |= GraphicsLayerPaintMask; | 1180 phase |= GraphicsLayerPaintMask; |
1101 | 1181 |
1102 if (m_scrollingContentsLayer) { | 1182 if (m_scrollingContentsLayer) { |
1103 phase &= ~GraphicsLayerPaintForeground; | 1183 phase &= ~GraphicsLayerPaintForeground; |
1104 phase |= GraphicsLayerPaintCompositedScroll; | 1184 phase |= GraphicsLayerPaintCompositedScroll; |
1105 } | 1185 } |
1106 | 1186 |
| 1187 if (m_owningLayer->compositingReasons() & CompositingReasonOverflowScrolling
Parent) |
| 1188 phase |= GraphicsLayerPaintCompositedScroll; |
| 1189 |
1107 return static_cast<GraphicsLayerPaintingPhase>(phase); | 1190 return static_cast<GraphicsLayerPaintingPhase>(phase); |
1108 } | 1191 } |
1109 | 1192 |
1110 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const | 1193 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const |
1111 { | 1194 { |
1112 float finalOpacity = rendererOpacity; | 1195 float finalOpacity = rendererOpacity; |
1113 | 1196 |
1114 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent(
)) { | 1197 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent(
)) { |
1115 // We only care about parents that are stacking contexts. | 1198 // We only care about parents that are stacking contexts. |
1116 // Recall that opacity creates stacking context. | 1199 // Recall that opacity creates stacking context. |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 GraphicsLayer* RenderLayerBacking::parentForSublayers() const | 1517 GraphicsLayer* RenderLayerBacking::parentForSublayers() const |
1435 { | 1518 { |
1436 if (m_scrollingContentsLayer) | 1519 if (m_scrollingContentsLayer) |
1437 return m_scrollingContentsLayer.get(); | 1520 return m_scrollingContentsLayer.get(); |
1438 | 1521 |
1439 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL
ayer.get(); | 1522 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL
ayer.get(); |
1440 } | 1523 } |
1441 | 1524 |
1442 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const | 1525 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const |
1443 { | 1526 { |
| 1527 if (m_ancestorScrollClippingLayer) |
| 1528 return m_ancestorScrollClippingLayer.get(); |
| 1529 |
1444 if (m_ancestorClippingLayer) | 1530 if (m_ancestorClippingLayer) |
1445 return m_ancestorClippingLayer.get(); | 1531 return m_ancestorClippingLayer.get(); |
1446 | 1532 |
1447 return m_graphicsLayer.get(); | 1533 return m_graphicsLayer.get(); |
1448 } | 1534 } |
1449 | 1535 |
1450 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) | 1536 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) |
1451 { | 1537 { |
1452 if (requiresOwnBacking == m_requiresOwnBackingStore) | 1538 if (requiresOwnBacking == m_requiresOwnBackingStore) |
1453 return; | 1539 return; |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate(); | 1986 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate(); |
1901 | 1987 |
1902 return backingMemory; | 1988 return backingMemory; |
1903 } | 1989 } |
1904 | 1990 |
1905 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer) | 1991 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer) |
1906 { | 1992 { |
1907 String name; | 1993 String name; |
1908 if (graphicsLayer == m_graphicsLayer.get()) { | 1994 if (graphicsLayer == m_graphicsLayer.get()) { |
1909 name = m_owningLayer->debugName(); | 1995 name = m_owningLayer->debugName(); |
| 1996 } else if (graphicsLayer == m_ancestorScrollClippingLayer.get()) { |
| 1997 name = "Ancestor Scroll Clipping Layer"; |
1910 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { | 1998 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { |
1911 name = "Ancestor Clipping Layer"; | 1999 name = "Ancestor Clipping Layer"; |
1912 } else if (graphicsLayer == m_foregroundLayer.get()) { | 2000 } else if (graphicsLayer == m_foregroundLayer.get()) { |
1913 name = m_owningLayer->debugName() + " (foreground) Layer"; | 2001 name = m_owningLayer->debugName() + " (foreground) Layer"; |
1914 } else if (graphicsLayer == m_backgroundLayer.get()) { | 2002 } else if (graphicsLayer == m_backgroundLayer.get()) { |
1915 name = m_owningLayer->debugName() + " (background) Layer"; | 2003 name = m_owningLayer->debugName() + " (background) Layer"; |
1916 } else if (graphicsLayer == m_childContainmentLayer.get()) { | 2004 } else if (graphicsLayer == m_childContainmentLayer.get()) { |
1917 name = "Child Containment Layer"; | 2005 name = "Child Containment Layer"; |
1918 } else if (graphicsLayer == m_maskLayer.get()) { | 2006 } else if (graphicsLayer == m_maskLayer.get()) { |
1919 name = "Mask Layer"; | 2007 name = "Mask Layer"; |
1920 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { | 2008 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { |
1921 name = "Horizontal Scrollbar Layer"; | 2009 name = "Horizontal Scrollbar Layer"; |
1922 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { | 2010 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { |
1923 name = "Vertical Scrollbar Layer"; | 2011 name = "Vertical Scrollbar Layer"; |
1924 } else if (graphicsLayer == m_layerForScrollCorner.get()) { | 2012 } else if (graphicsLayer == m_layerForScrollCorner.get()) { |
1925 name = "Scroll Corner Layer"; | 2013 name = "Scroll Corner Layer"; |
1926 } else if (graphicsLayer == m_scrollingLayer.get()) { | 2014 } else if (graphicsLayer == m_scrollingLayer.get()) { |
1927 name = "Scrolling Layer"; | 2015 name = "Scrolling Layer"; |
1928 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2016 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
1929 name = "Scrolling Contents Layer"; | 2017 name = "Scrolling Contents Layer"; |
1930 } else { | 2018 } else { |
1931 ASSERT_NOT_REACHED(); | 2019 ASSERT_NOT_REACHED(); |
1932 } | 2020 } |
1933 | 2021 |
1934 return name; | 2022 return name; |
1935 } | 2023 } |
1936 | 2024 |
1937 } // namespace WebCore | 2025 } // namespace WebCore |
OLD | NEW |