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) { | |
| 553 // Our scroll parent must have been processed before us. | |
|
hartmanng
2013/09/06 01:46:38
I think a slightly longer comment explaining why o
Ian Vollick
2013/09/06 02:38:11
Done.
| |
| 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(RenderLayer* scrollParent) | |
| 1143 { | |
| 1144 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) | |
| 1145 scrollingCoordinator->updateScrollParentForLayer(m_owningLayer, scrollPa rent); | |
| 1146 } | |
| 1147 | |
| 1148 void RenderLayerBacking::updateClipParent(RenderLayer* clipParent) | |
| 1149 { | |
| 1150 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) | |
| 1151 scrollingCoordinator->updateClipParentForLayer(m_owningLayer, clipParent ); | |
| 1152 } | |
| 1153 | |
| 1092 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co nst | 1154 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co nst |
| 1093 { | 1155 { |
| 1094 unsigned phase = 0; | 1156 unsigned phase = 0; |
| 1095 if (!m_backgroundLayer) | 1157 if (!m_backgroundLayer) |
| 1096 phase |= GraphicsLayerPaintBackground; | 1158 phase |= GraphicsLayerPaintBackground; |
| 1097 if (!m_foregroundLayer) | 1159 if (!m_foregroundLayer) |
| 1098 phase |= GraphicsLayerPaintForeground; | 1160 phase |= GraphicsLayerPaintForeground; |
| 1099 if (!m_maskLayer) | 1161 if (!m_maskLayer) |
| 1100 phase |= GraphicsLayerPaintMask; | 1162 phase |= GraphicsLayerPaintMask; |
| 1101 | 1163 |
| 1102 if (m_scrollingContentsLayer) { | 1164 if (m_scrollingContentsLayer) { |
| 1103 phase &= ~GraphicsLayerPaintForeground; | 1165 phase &= ~GraphicsLayerPaintForeground; |
| 1104 phase |= GraphicsLayerPaintCompositedScroll; | 1166 phase |= GraphicsLayerPaintCompositedScroll; |
| 1105 } | 1167 } |
| 1106 | 1168 |
| 1169 if (m_owningLayer->compositingReasons() & CompositingReasonOverflowScrolling Parent) | |
| 1170 phase |= GraphicsLayerPaintCompositedScroll; | |
| 1171 | |
| 1107 return static_cast<GraphicsLayerPaintingPhase>(phase); | 1172 return static_cast<GraphicsLayerPaintingPhase>(phase); |
| 1108 } | 1173 } |
| 1109 | 1174 |
| 1110 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const | 1175 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const |
| 1111 { | 1176 { |
| 1112 float finalOpacity = rendererOpacity; | 1177 float finalOpacity = rendererOpacity; |
| 1113 | 1178 |
| 1114 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent( )) { | 1179 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent( )) { |
| 1115 // We only care about parents that are stacking contexts. | 1180 // We only care about parents that are stacking contexts. |
| 1116 // Recall that opacity creates stacking context. | 1181 // Recall that opacity creates stacking context. |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1434 GraphicsLayer* RenderLayerBacking::parentForSublayers() const | 1499 GraphicsLayer* RenderLayerBacking::parentForSublayers() const |
| 1435 { | 1500 { |
| 1436 if (m_scrollingContentsLayer) | 1501 if (m_scrollingContentsLayer) |
| 1437 return m_scrollingContentsLayer.get(); | 1502 return m_scrollingContentsLayer.get(); |
| 1438 | 1503 |
| 1439 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL ayer.get(); | 1504 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL ayer.get(); |
| 1440 } | 1505 } |
| 1441 | 1506 |
| 1442 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const | 1507 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const |
| 1443 { | 1508 { |
| 1509 if (m_ancestorScrollClippingLayer) | |
| 1510 return m_ancestorScrollClippingLayer.get(); | |
| 1511 | |
| 1444 if (m_ancestorClippingLayer) | 1512 if (m_ancestorClippingLayer) |
| 1445 return m_ancestorClippingLayer.get(); | 1513 return m_ancestorClippingLayer.get(); |
| 1446 | 1514 |
| 1447 return m_graphicsLayer.get(); | 1515 return m_graphicsLayer.get(); |
| 1448 } | 1516 } |
| 1449 | 1517 |
| 1450 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) | 1518 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) |
| 1451 { | 1519 { |
| 1452 if (requiresOwnBacking == m_requiresOwnBackingStore) | 1520 if (requiresOwnBacking == m_requiresOwnBackingStore) |
| 1453 return; | 1521 return; |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1900 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate(); | 1968 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate(); |
| 1901 | 1969 |
| 1902 return backingMemory; | 1970 return backingMemory; |
| 1903 } | 1971 } |
| 1904 | 1972 |
| 1905 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer) | 1973 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer) |
| 1906 { | 1974 { |
| 1907 String name; | 1975 String name; |
| 1908 if (graphicsLayer == m_graphicsLayer.get()) { | 1976 if (graphicsLayer == m_graphicsLayer.get()) { |
| 1909 name = m_owningLayer->debugName(); | 1977 name = m_owningLayer->debugName(); |
| 1978 } else if (graphicsLayer == m_ancestorScrollClippingLayer.get()) { | |
| 1979 name = "Ancestor Scroll Clipping Layer"; | |
| 1910 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { | 1980 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { |
| 1911 name = "Ancestor Clipping Layer"; | 1981 name = "Ancestor Clipping Layer"; |
| 1912 } else if (graphicsLayer == m_foregroundLayer.get()) { | 1982 } else if (graphicsLayer == m_foregroundLayer.get()) { |
| 1913 name = m_owningLayer->debugName() + " (foreground) Layer"; | 1983 name = m_owningLayer->debugName() + " (foreground) Layer"; |
| 1914 } else if (graphicsLayer == m_backgroundLayer.get()) { | 1984 } else if (graphicsLayer == m_backgroundLayer.get()) { |
| 1915 name = m_owningLayer->debugName() + " (background) Layer"; | 1985 name = m_owningLayer->debugName() + " (background) Layer"; |
| 1916 } else if (graphicsLayer == m_childContainmentLayer.get()) { | 1986 } else if (graphicsLayer == m_childContainmentLayer.get()) { |
| 1917 name = "Child Containment Layer"; | 1987 name = "Child Containment Layer"; |
| 1918 } else if (graphicsLayer == m_maskLayer.get()) { | 1988 } else if (graphicsLayer == m_maskLayer.get()) { |
| 1919 name = "Mask Layer"; | 1989 name = "Mask Layer"; |
| 1920 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { | 1990 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { |
| 1921 name = "Horizontal Scrollbar Layer"; | 1991 name = "Horizontal Scrollbar Layer"; |
| 1922 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { | 1992 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { |
| 1923 name = "Vertical Scrollbar Layer"; | 1993 name = "Vertical Scrollbar Layer"; |
| 1924 } else if (graphicsLayer == m_layerForScrollCorner.get()) { | 1994 } else if (graphicsLayer == m_layerForScrollCorner.get()) { |
| 1925 name = "Scroll Corner Layer"; | 1995 name = "Scroll Corner Layer"; |
| 1926 } else if (graphicsLayer == m_scrollingLayer.get()) { | 1996 } else if (graphicsLayer == m_scrollingLayer.get()) { |
| 1927 name = "Scrolling Layer"; | 1997 name = "Scrolling Layer"; |
| 1928 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 1998 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 1929 name = "Scrolling Contents Layer"; | 1999 name = "Scrolling Contents Layer"; |
| 1930 } else { | 2000 } else { |
| 1931 ASSERT_NOT_REACHED(); | 2001 ASSERT_NOT_REACHED(); |
| 1932 } | 2002 } |
| 1933 | 2003 |
| 1934 return name; | 2004 return name; |
| 1935 } | 2005 } |
| 1936 | 2006 |
| 1937 } // namespace WebCore | 2007 } // namespace WebCore |
| OLD | NEW |