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 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 RenderLayer* scrollParent = m_owningLayer->scrollParent(); |
| 422 bool needsAncestorClip = compositor->clippedByAncestor(m_owningLayer); | |
| 423 bool needsScrollClip = !!scrollParent; | |
| 424 if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer, n eedsScrollClip)) | |
| 422 layerConfigChanged = true; | 425 layerConfigChanged = true; |
| 423 | 426 |
| 424 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require sVerticalScrollbarLayer(), requiresScrollCornerLayer())) | 427 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require sVerticalScrollbarLayer(), requiresScrollCornerLayer())) |
| 425 layerConfigChanged = true; | 428 layerConfigChanged = true; |
| 426 | 429 |
| 427 if (updateScrollingLayers(m_owningLayer->needsCompositedScrolling())) | 430 if (updateScrollingLayers(m_owningLayer->needsCompositedScrolling())) |
| 428 layerConfigChanged = true; | 431 layerConfigChanged = true; |
| 429 | 432 |
| 433 updateScrollParent(scrollParent); | |
| 434 updateClipParent(m_owningLayer->clipParent()); | |
| 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) { | |
|
enne (OOO)
2013/09/10 23:45:01
Just as a sanity check, the ancestor scroll clippi
Ian Vollick
2013/09/11 17:57:52
I've added a detailed description of all layers in
| |
| 553 // Our scroll parent must have been processed before us. The code in Ren derLayerCompositor | |
| 554 // that coordinates updating graphics layer geometry has been set up to guarantee that this is the case. | |
| 555 RenderLayer* scrollParent = m_owningLayer->ancestorScrollingLayer(); | |
| 556 GraphicsLayer* scrollParentClippingLayer = scrollParent->backing()->scro llingLayer(); | |
| 557 | |
| 558 // Not relative to our parent graphics layer. | |
| 559 FloatPoint position; | |
| 560 GraphicsLayer* scrollParentChildForSuperlayers = scrollParent->backing() ->childForSuperlayers(); | |
| 561 | |
| 562 for (GraphicsLayer* scrollAncestor = scrollParentClippingLayer; scrollAn cestor; scrollAncestor = scrollAncestor->parent()) { | |
| 563 position = position + toFloatSize(scrollAncestor->position()); | |
|
enne (OOO)
2013/09/10 23:45:01
Maybe also ASSERT that there's no transform applie
Ian Vollick
2013/09/11 17:57:52
Done.
| |
| 564 if (scrollAncestor == scrollParentChildForSuperlayers) | |
| 565 break; | |
| 566 } | |
| 567 | |
| 568 m_ancestorScrollClippingLayer->setPosition(position); | |
| 569 m_ancestorScrollClippingLayer->setSize(scrollParentClippingLayer->size() ); | |
| 570 m_ancestorScrollClippingLayer->setOffsetFromRenderer(toIntSize(roundedIn tPoint(-position))); | |
| 571 | |
| 572 graphicsLayerParentLocation = roundedIntPoint(position); | |
| 573 } | |
| 574 | |
| 546 if (compAncestor && m_ancestorClippingLayer) { | 575 if (compAncestor && m_ancestorClippingLayer) { |
| 547 // Call calculateRects to get the backgroundRect which is what is used t o clip the contents of this | 576 // 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 | 577 // 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. | 578 // for a compositing layer, rootLayer is the layer itself. |
| 550 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0, Temporar yClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip); | 579 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0, Temporar yClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip); |
| 551 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundCl ipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. | 580 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundCl ipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. |
| 552 ASSERT(parentClipRect != PaintInfo::infiniteRect()); | 581 ASSERT(parentClipRect != PaintInfo::infiniteRect()); |
| 553 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location( ) - graphicsLayerParentLocation)); | 582 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location( ) - graphicsLayerParentLocation)); |
| 554 m_ancestorClippingLayer->setSize(parentClipRect.size()); | 583 m_ancestorClippingLayer->setSize(parentClipRect.size()); |
| 555 | 584 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 742 | 771 |
| 743 // Page scale is applied as a transform on the root render view layer. Becau se the scroll | 772 // 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 | 773 // layer is further up in the hierarchy, we need to avoid marking the root r ender view |
| 745 // layer as a container. | 774 // layer as a container. |
| 746 bool isContainer = m_owningLayer->hasTransform() && !m_owningLayer->isRootLa yer(); | 775 bool isContainer = m_owningLayer->hasTransform() && !m_owningLayer->isRootLa yer(); |
| 747 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe rlayers(), isContainer); | 776 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe rlayers(), isContainer); |
| 748 } | 777 } |
| 749 | 778 |
| 750 void RenderLayerBacking::updateInternalHierarchy() | 779 void RenderLayerBacking::updateInternalHierarchy() |
| 751 { | 780 { |
| 781 if (m_ancestorScrollClippingLayer) | |
| 782 m_ancestorScrollClippingLayer->removeAllChildren(); | |
| 783 | |
| 752 // m_foregroundLayer has to be inserted in the correct order with child laye rs, | 784 // m_foregroundLayer has to be inserted in the correct order with child laye rs, |
| 753 // so it's not inserted here. | 785 // so it's not inserted here. |
| 754 if (m_ancestorClippingLayer) | 786 if (m_ancestorClippingLayer) |
| 755 m_ancestorClippingLayer->removeAllChildren(); | 787 m_ancestorClippingLayer->removeAllChildren(); |
| 756 | 788 |
| 757 m_graphicsLayer->removeFromParent(); | 789 m_graphicsLayer->removeFromParent(); |
| 758 | 790 |
| 759 if (m_ancestorClippingLayer) | 791 if (m_ancestorClippingLayer) |
| 760 m_ancestorClippingLayer->addChild(m_graphicsLayer.get()); | 792 m_ancestorClippingLayer->addChild(m_graphicsLayer.get()); |
| 761 | 793 |
| 794 if (m_ancestorScrollClippingLayer) { | |
| 795 if (m_ancestorClippingLayer) | |
| 796 m_ancestorScrollClippingLayer->addChild(m_ancestorClippingLayer.get( )); | |
| 797 else | |
| 798 m_ancestorScrollClippingLayer->addChild(m_graphicsLayer.get()); | |
| 799 } | |
| 800 | |
| 762 if (m_childContainmentLayer) { | 801 if (m_childContainmentLayer) { |
| 763 m_childContainmentLayer->removeFromParent(); | 802 m_childContainmentLayer->removeFromParent(); |
| 764 m_graphicsLayer->addChild(m_childContainmentLayer.get()); | 803 m_graphicsLayer->addChild(m_childContainmentLayer.get()); |
| 765 } | 804 } |
| 766 | 805 |
| 767 if (m_scrollingLayer) { | 806 if (m_scrollingLayer) { |
| 768 GraphicsLayer* superlayer = m_childContainmentLayer ? m_childContainment Layer.get() : m_graphicsLayer.get(); | 807 GraphicsLayer* superlayer = m_childContainmentLayer ? m_childContainment Layer.get() : m_graphicsLayer.get(); |
| 769 m_scrollingLayer->removeFromParent(); | 808 m_scrollingLayer->removeFromParent(); |
| 770 superlayer->addChild(m_scrollingLayer.get()); | 809 superlayer->addChild(m_scrollingLayer.get()); |
| 771 } | 810 } |
| (...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. | 869 // FIXME: we could refine this to only allocate backing for one of these lay ers if possible. |
| 831 m_graphicsLayer->setDrawsContent(hasPaintedContent); | 870 m_graphicsLayer->setDrawsContent(hasPaintedContent); |
| 832 if (m_foregroundLayer) | 871 if (m_foregroundLayer) |
| 833 m_foregroundLayer->setDrawsContent(hasPaintedContent); | 872 m_foregroundLayer->setDrawsContent(hasPaintedContent); |
| 834 | 873 |
| 835 if (m_backgroundLayer) | 874 if (m_backgroundLayer) |
| 836 m_backgroundLayer->setDrawsContent(hasPaintedContent); | 875 m_backgroundLayer->setDrawsContent(hasPaintedContent); |
| 837 } | 876 } |
| 838 | 877 |
| 839 // Return true if the layers changed. | 878 // Return true if the layers changed. |
| 840 bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs DescendantClip) | 879 bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs DescendantClip, bool needsScrollClip) |
| 841 { | 880 { |
| 842 bool layersChanged = false; | 881 bool layersChanged = false; |
| 843 | 882 |
| 844 if (needsAncestorClip) { | 883 if (needsAncestorClip) { |
| 845 if (!m_ancestorClippingLayer) { | 884 if (!m_ancestorClippingLayer) { |
| 846 m_ancestorClippingLayer = createGraphicsLayer(CompositingReasonLayer ForClip); | 885 m_ancestorClippingLayer = createGraphicsLayer(CompositingReasonLayer ForClip); |
| 847 m_ancestorClippingLayer->setMasksToBounds(true); | 886 m_ancestorClippingLayer->setMasksToBounds(true); |
| 848 layersChanged = true; | 887 layersChanged = true; |
| 849 } | 888 } |
| 850 } else if (m_ancestorClippingLayer) { | 889 } else if (m_ancestorClippingLayer) { |
| 851 m_ancestorClippingLayer->removeFromParent(); | 890 m_ancestorClippingLayer->removeFromParent(); |
| 852 m_ancestorClippingLayer = nullptr; | 891 m_ancestorClippingLayer = nullptr; |
| 853 layersChanged = true; | 892 layersChanged = true; |
| 854 } | 893 } |
| 855 | 894 |
| 856 if (needsDescendantClip) { | 895 if (needsDescendantClip) { |
| 857 // We don't need a child containment layer if we're the main frame rende r view | 896 // 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. | 897 // layer. It's redundant as the frame clip above us will handle this cli pping. |
| 859 if (!m_childContainmentLayer && !m_isMainFrameRenderViewLayer) { | 898 if (!m_childContainmentLayer && !m_isMainFrameRenderViewLayer) { |
| 860 m_childContainmentLayer = createGraphicsLayer(CompositingReasonLayer ForClip); | 899 m_childContainmentLayer = createGraphicsLayer(CompositingReasonLayer ForClip); |
| 861 m_childContainmentLayer->setMasksToBounds(true); | 900 m_childContainmentLayer->setMasksToBounds(true); |
| 862 layersChanged = true; | 901 layersChanged = true; |
| 863 } | 902 } |
| 864 } else if (hasClippingLayer()) { | 903 } else if (hasClippingLayer()) { |
| 865 m_childContainmentLayer->removeFromParent(); | 904 m_childContainmentLayer->removeFromParent(); |
| 866 m_childContainmentLayer = nullptr; | 905 m_childContainmentLayer = nullptr; |
| 867 layersChanged = true; | 906 layersChanged = true; |
| 868 } | 907 } |
| 869 | 908 |
| 909 if (needsScrollClip) { | |
| 910 if (!m_ancestorScrollClippingLayer) { | |
| 911 m_ancestorScrollClippingLayer = createGraphicsLayer(CompositingReaso nLayerForClip); | |
| 912 m_ancestorScrollClippingLayer->setMasksToBounds(true); | |
| 913 layersChanged = true; | |
| 914 } | |
| 915 } else if (m_ancestorScrollClippingLayer) { | |
| 916 m_ancestorScrollClippingLayer->removeFromParent(); | |
| 917 m_ancestorScrollClippingLayer = nullptr; | |
| 918 layersChanged = true; | |
| 919 } | |
| 920 | |
| 870 return layersChanged; | 921 return layersChanged; |
| 871 } | 922 } |
| 872 | 923 |
| 873 void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgr oundLayerPaintsFixedRootBackground) | 924 void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgr oundLayerPaintsFixedRootBackground) |
| 874 { | 925 { |
| 875 m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootB ackground; | 926 m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootB ackground; |
| 876 } | 927 } |
| 877 | 928 |
| 878 bool RenderLayerBacking::updateOverflowControlsLayers(bool needsHorizontalScroll barLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer) | 929 bool RenderLayerBacking::updateOverflowControlsLayers(bool needsHorizontalScroll barLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer) |
| 879 { | 930 { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1082 updateInternalHierarchy(); | 1133 updateInternalHierarchy(); |
| 1083 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); | 1134 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); |
| 1084 m_graphicsLayer->setNeedsDisplay(); | 1135 m_graphicsLayer->setNeedsDisplay(); |
| 1085 if (renderer()->view()) | 1136 if (renderer()->view()) |
| 1086 compositor()->scrollingLayerDidChange(m_owningLayer); | 1137 compositor()->scrollingLayerDidChange(m_owningLayer); |
| 1087 } | 1138 } |
| 1088 | 1139 |
| 1089 return layerChanged; | 1140 return layerChanged; |
| 1090 } | 1141 } |
| 1091 | 1142 |
| 1143 void RenderLayerBacking::updateScrollParent(RenderLayer* scrollParent) | |
| 1144 { | |
| 1145 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) | |
| 1146 scrollingCoordinator->updateScrollParentForLayer(m_owningLayer, scrollPa rent); | |
| 1147 } | |
| 1148 | |
| 1149 void RenderLayerBacking::updateClipParent(RenderLayer* clipParent) | |
| 1150 { | |
| 1151 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) | |
| 1152 scrollingCoordinator->updateClipParentForLayer(m_owningLayer, clipParent ); | |
| 1153 } | |
| 1154 | |
| 1092 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co nst | 1155 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co nst |
| 1093 { | 1156 { |
| 1094 unsigned phase = 0; | 1157 unsigned phase = 0; |
| 1095 if (!m_backgroundLayer) | 1158 if (!m_backgroundLayer) |
| 1096 phase |= GraphicsLayerPaintBackground; | 1159 phase |= GraphicsLayerPaintBackground; |
| 1097 if (!m_foregroundLayer) | 1160 if (!m_foregroundLayer) |
| 1098 phase |= GraphicsLayerPaintForeground; | 1161 phase |= GraphicsLayerPaintForeground; |
| 1099 if (!m_maskLayer) | 1162 if (!m_maskLayer) |
| 1100 phase |= GraphicsLayerPaintMask; | 1163 phase |= GraphicsLayerPaintMask; |
| 1101 | 1164 |
| 1102 if (m_scrollingContentsLayer) { | 1165 if (m_scrollingContentsLayer) { |
| 1103 phase &= ~GraphicsLayerPaintForeground; | 1166 phase &= ~GraphicsLayerPaintForeground; |
| 1104 phase |= GraphicsLayerPaintCompositedScroll; | 1167 phase |= GraphicsLayerPaintCompositedScroll; |
| 1105 } | 1168 } |
| 1106 | 1169 |
| 1170 if (m_owningLayer->compositingReasons() & CompositingReasonOverflowScrolling Parent) | |
| 1171 phase |= GraphicsLayerPaintCompositedScroll; | |
| 1172 | |
| 1107 return static_cast<GraphicsLayerPaintingPhase>(phase); | 1173 return static_cast<GraphicsLayerPaintingPhase>(phase); |
| 1108 } | 1174 } |
| 1109 | 1175 |
| 1110 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const | 1176 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const |
| 1111 { | 1177 { |
| 1112 float finalOpacity = rendererOpacity; | 1178 float finalOpacity = rendererOpacity; |
| 1113 | 1179 |
| 1114 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent( )) { | 1180 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent( )) { |
| 1115 // We only care about parents that are stacking contexts. | 1181 // We only care about parents that are stacking contexts. |
| 1116 // Recall that opacity creates stacking context. | 1182 // Recall that opacity creates stacking context. |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1434 GraphicsLayer* RenderLayerBacking::parentForSublayers() const | 1500 GraphicsLayer* RenderLayerBacking::parentForSublayers() const |
| 1435 { | 1501 { |
| 1436 if (m_scrollingContentsLayer) | 1502 if (m_scrollingContentsLayer) |
| 1437 return m_scrollingContentsLayer.get(); | 1503 return m_scrollingContentsLayer.get(); |
| 1438 | 1504 |
| 1439 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL ayer.get(); | 1505 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL ayer.get(); |
| 1440 } | 1506 } |
| 1441 | 1507 |
| 1442 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const | 1508 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const |
| 1443 { | 1509 { |
| 1510 if (m_ancestorScrollClippingLayer) | |
| 1511 return m_ancestorScrollClippingLayer.get(); | |
| 1512 | |
| 1444 if (m_ancestorClippingLayer) | 1513 if (m_ancestorClippingLayer) |
| 1445 return m_ancestorClippingLayer.get(); | 1514 return m_ancestorClippingLayer.get(); |
| 1446 | 1515 |
| 1447 return m_graphicsLayer.get(); | 1516 return m_graphicsLayer.get(); |
| 1448 } | 1517 } |
| 1449 | 1518 |
| 1450 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) | 1519 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) |
| 1451 { | 1520 { |
| 1452 if (requiresOwnBacking == m_requiresOwnBackingStore) | 1521 if (requiresOwnBacking == m_requiresOwnBackingStore) |
| 1453 return; | 1522 return; |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1900 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate(); | 1969 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate(); |
| 1901 | 1970 |
| 1902 return backingMemory; | 1971 return backingMemory; |
| 1903 } | 1972 } |
| 1904 | 1973 |
| 1905 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer) | 1974 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer) |
| 1906 { | 1975 { |
| 1907 String name; | 1976 String name; |
| 1908 if (graphicsLayer == m_graphicsLayer.get()) { | 1977 if (graphicsLayer == m_graphicsLayer.get()) { |
| 1909 name = m_owningLayer->debugName(); | 1978 name = m_owningLayer->debugName(); |
| 1979 } else if (graphicsLayer == m_ancestorScrollClippingLayer.get()) { | |
| 1980 name = "Ancestor Scroll Clipping Layer"; | |
| 1910 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { | 1981 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { |
| 1911 name = "Ancestor Clipping Layer"; | 1982 name = "Ancestor Clipping Layer"; |
| 1912 } else if (graphicsLayer == m_foregroundLayer.get()) { | 1983 } else if (graphicsLayer == m_foregroundLayer.get()) { |
| 1913 name = m_owningLayer->debugName() + " (foreground) Layer"; | 1984 name = m_owningLayer->debugName() + " (foreground) Layer"; |
| 1914 } else if (graphicsLayer == m_backgroundLayer.get()) { | 1985 } else if (graphicsLayer == m_backgroundLayer.get()) { |
| 1915 name = m_owningLayer->debugName() + " (background) Layer"; | 1986 name = m_owningLayer->debugName() + " (background) Layer"; |
| 1916 } else if (graphicsLayer == m_childContainmentLayer.get()) { | 1987 } else if (graphicsLayer == m_childContainmentLayer.get()) { |
| 1917 name = "Child Containment Layer"; | 1988 name = "Child Containment Layer"; |
| 1918 } else if (graphicsLayer == m_maskLayer.get()) { | 1989 } else if (graphicsLayer == m_maskLayer.get()) { |
| 1919 name = "Mask Layer"; | 1990 name = "Mask Layer"; |
| 1920 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { | 1991 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { |
| 1921 name = "Horizontal Scrollbar Layer"; | 1992 name = "Horizontal Scrollbar Layer"; |
| 1922 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { | 1993 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { |
| 1923 name = "Vertical Scrollbar Layer"; | 1994 name = "Vertical Scrollbar Layer"; |
| 1924 } else if (graphicsLayer == m_layerForScrollCorner.get()) { | 1995 } else if (graphicsLayer == m_layerForScrollCorner.get()) { |
| 1925 name = "Scroll Corner Layer"; | 1996 name = "Scroll Corner Layer"; |
| 1926 } else if (graphicsLayer == m_scrollingLayer.get()) { | 1997 } else if (graphicsLayer == m_scrollingLayer.get()) { |
| 1927 name = "Scrolling Layer"; | 1998 name = "Scrolling Layer"; |
| 1928 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 1999 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 1929 name = "Scrolling Contents Layer"; | 2000 name = "Scrolling Contents Layer"; |
| 1930 } else { | 2001 } else { |
| 1931 ASSERT_NOT_REACHED(); | 2002 ASSERT_NOT_REACHED(); |
| 1932 } | 2003 } |
| 1933 | 2004 |
| 1934 return name; | 2005 return name; |
| 1935 } | 2006 } |
| 1936 | 2007 |
| 1937 } // namespace WebCore | 2008 } // namespace WebCore |
| OLD | NEW |