| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (page && page->mainFrame() == &frame) { | 165 if (page && page->mainFrame() == &frame) { |
| 166 m_isMainFrameRenderViewLayer = true; | 166 m_isMainFrameRenderViewLayer = true; |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 createPrimaryGraphicsLayer(); | 170 createPrimaryGraphicsLayer(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 RenderLayerBacking::~RenderLayerBacking() | 173 RenderLayerBacking::~RenderLayerBacking() |
| 174 { | 174 { |
| 175 updateClippingLayers(false, false); | 175 updateClippingLayers(false, false, false); |
| 176 updateOverflowControlsLayers(false, false, false); | 176 updateOverflowControlsLayers(false, false, false); |
| 177 updateForegroundLayer(false); | 177 updateForegroundLayer(false); |
| 178 updateBackgroundLayer(false); | 178 updateBackgroundLayer(false); |
| 179 updateMaskLayer(false); | 179 updateMaskLayer(false); |
| 180 updateScrollingLayers(false); | 180 updateScrollingLayers(false); |
| 181 destroyGraphicsLayers(); | 181 destroyGraphicsLayers(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 PassOwnPtr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(CompositingRea
sons reasons) | 184 PassOwnPtr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(CompositingRea
sons reasons) |
| 185 { | 185 { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 RenderLayerCompositor* layerCompositor = compositor(); | 373 RenderLayerCompositor* layerCompositor = compositor(); |
| 374 if (!layerCompositor->compositingLayersNeedRebuild()) { | 374 if (!layerCompositor->compositingLayersNeedRebuild()) { |
| 375 // Calling updateGraphicsLayerGeometry() here gives incorrect results, b
ecause the | 375 // Calling updateGraphicsLayerGeometry() here gives incorrect results, b
ecause the |
| 376 // position of this layer's GraphicsLayer depends on the position of our
compositing | 376 // position of this layer's GraphicsLayer depends on the position of our
compositing |
| 377 // ancestor's GraphicsLayer. That cannot be determined until all the des
cendant | 377 // ancestor's GraphicsLayer. That cannot be determined until all the des
cendant |
| 378 // RenderLayers of that ancestor have been processed via updateLayerPosi
tions(). | 378 // RenderLayers of that ancestor have been processed via updateLayerPosi
tions(). |
| 379 // | 379 // |
| 380 // The solution is to update compositing children of this layer here, | 380 // The solution is to update compositing children of this layer here, |
| 381 // via updateCompositingChildrenGeometry(). | 381 // via updateCompositingChildrenGeometry(). |
| 382 updateCompositedBounds(); | 382 updateCompositedBounds(); |
| 383 layerCompositor->updateCompositingDescendantGeometry(m_owningLayer, m_ow
ningLayer, flags & CompositingChildrenOnly); | 383 HashSet<RenderLayer*> visited; |
| 384 layerCompositor->updateCompositingDescendantGeometry(m_owningLayer, m_ow
ningLayer, visited, flags & CompositingChildrenOnly); |
| 385 visited.clear(); |
| 384 | 386 |
| 385 if (flags & IsUpdateRoot) { | 387 if (flags & IsUpdateRoot) { |
| 386 updateGraphicsLayerGeometry(); | 388 updateGraphicsLayerGeometry(); |
| 387 layerCompositor->updateRootLayerPosition(); | 389 layerCompositor->updateRootLayerPosition(); |
| 388 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon
tainer(); | 390 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon
tainer(); |
| 389 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont
ainer && (stackingContainer != m_owningLayer)) | 391 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont
ainer && (stackingContainer != m_owningLayer)) |
| 390 layerCompositor->updateCompositingDescendantGeometry(stackingCon
tainer, stackingContainer, flags & CompositingChildrenOnly); | 392 layerCompositor->updateCompositingDescendantGeometry(stackingCon
tainer, stackingContainer, visited, flags & CompositingChildrenOnly); |
| 391 } | 393 } |
| 392 } | 394 } |
| 393 | 395 |
| 394 if (flags & NeedsFullRepaint && !paintsIntoCompositedAncestor()) | 396 if (flags & NeedsFullRepaint && !paintsIntoCompositedAncestor()) |
| 395 setContentsNeedDisplay(); | 397 setContentsNeedDisplay(); |
| 396 } | 398 } |
| 397 | 399 |
| 398 bool RenderLayerBacking::updateGraphicsLayerConfiguration() | 400 bool RenderLayerBacking::updateGraphicsLayerConfiguration() |
| 399 { | 401 { |
| 400 RenderLayerCompositor* compositor = this->compositor(); | 402 RenderLayerCompositor* compositor = this->compositor(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 412 | 414 |
| 413 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(m_owning
Layer))) | 415 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(m_owning
Layer))) |
| 414 layerConfigChanged = true; | 416 layerConfigChanged = true; |
| 415 | 417 |
| 416 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants
(m_owningLayer); | 418 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants
(m_owningLayer); |
| 417 | 419 |
| 418 // Our scrolling layer will clip. | 420 // Our scrolling layer will clip. |
| 419 if (m_owningLayer->needsCompositedScrolling()) | 421 if (m_owningLayer->needsCompositedScrolling()) |
| 420 needsDescendentsClippingLayer = false; | 422 needsDescendentsClippingLayer = false; |
| 421 | 423 |
| 422 if (updateClippingLayers(compositor->clippedByAncestor(m_owningLayer), needs
DescendentsClippingLayer)) | 424 RenderLayer* scrollParent = m_owningLayer->scrollParent(); |
| 425 bool needsAncestorClip = compositor->clippedByAncestor(m_owningLayer); |
| 426 bool needsScrollClip = !!scrollParent; |
| 427 if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer, n
eedsScrollClip)) |
| 423 layerConfigChanged = true; | 428 layerConfigChanged = true; |
| 424 | 429 |
| 425 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require
sVerticalScrollbarLayer(), requiresScrollCornerLayer())) | 430 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require
sVerticalScrollbarLayer(), requiresScrollCornerLayer())) |
| 426 layerConfigChanged = true; | 431 layerConfigChanged = true; |
| 427 | 432 |
| 428 if (updateScrollingLayers(m_owningLayer->needsCompositedScrolling())) | 433 if (updateScrollingLayers(m_owningLayer->needsCompositedScrolling())) |
| 429 layerConfigChanged = true; | 434 layerConfigChanged = true; |
| 430 | 435 |
| 436 updateScrollParent(scrollParent); |
| 437 updateClipParent(m_owningLayer->clipParent()); |
| 438 |
| 431 if (layerConfigChanged) | 439 if (layerConfigChanged) |
| 432 updateInternalHierarchy(); | 440 updateInternalHierarchy(); |
| 433 | 441 |
| 434 if (updateMaskLayer(renderer->hasMask())) | 442 if (updateMaskLayer(renderer->hasMask())) |
| 435 m_graphicsLayer->setMaskLayer(m_maskLayer.get()); | 443 m_graphicsLayer->setMaskLayer(m_maskLayer.get()); |
| 436 | 444 |
| 437 if (m_owningLayer->hasReflection()) { | 445 if (m_owningLayer->hasReflection()) { |
| 438 if (m_owningLayer->reflectionLayer()->backing()) { | 446 if (m_owningLayer->reflectionLayer()->backing()) { |
| 439 GraphicsLayer* reflectionLayer = m_owningLayer->reflectionLayer()->b
acking()->graphicsLayer(); | 447 GraphicsLayer* reflectionLayer = m_owningLayer->reflectionLayer()->b
acking()->graphicsLayer(); |
| 440 m_graphicsLayer->setReplicatedByLayer(reflectionLayer); | 448 m_graphicsLayer->setReplicatedByLayer(reflectionLayer); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 else | 545 else |
| 538 graphicsLayerParentLocation = renderer()->view()->documentRect().locatio
n(); | 546 graphicsLayerParentLocation = renderer()->view()->documentRect().locatio
n(); |
| 539 | 547 |
| 540 if (compAncestor && compAncestor->needsCompositedScrolling()) { | 548 if (compAncestor && compAncestor->needsCompositedScrolling()) { |
| 541 RenderBox* renderBox = toRenderBox(compAncestor->renderer()); | 549 RenderBox* renderBox = toRenderBox(compAncestor->renderer()); |
| 542 IntSize scrollOffset = compAncestor->scrolledContentOffset(); | 550 IntSize scrollOffset = compAncestor->scrolledContentOffset(); |
| 543 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop()); | 551 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop()); |
| 544 graphicsLayerParentLocation = scrollOrigin - scrollOffset; | 552 graphicsLayerParentLocation = scrollOrigin - scrollOffset; |
| 545 } | 553 } |
| 546 | 554 |
| 555 if (compAncestor && m_ancestorScrollClippingLayer && m_owningLayer->ancestor
ScrollingLayer()) { |
| 556 // Our scroll parent must have been processed before us. The code in Ren
derLayerCompositor |
| 557 // that coordinates updating graphics layer geometry has been set up to
guarantee that this is the case. |
| 558 RenderLayer* scrollParent = m_owningLayer->ancestorScrollingLayer(); |
| 559 GraphicsLayer* scrollParentClippingLayer = scrollParent->backing()->scro
llingLayer(); |
| 560 |
| 561 // Not relative to our parent graphics layer. |
| 562 FloatPoint position; |
| 563 GraphicsLayer* scrollParentChildForSuperlayers = scrollParent->backing()
->childForSuperlayers(); |
| 564 |
| 565 for (GraphicsLayer* scrollAncestor = scrollParentClippingLayer; scrollAn
cestor; scrollAncestor = scrollAncestor->parent()) { |
| 566 ASSERT(scrollAncestor->transform().isIdentity()); |
| 567 position = position + toFloatSize(scrollAncestor->position()); |
| 568 if (scrollAncestor == scrollParentChildForSuperlayers) |
| 569 break; |
| 570 } |
| 571 |
| 572 m_ancestorScrollClippingLayer->setPosition(position); |
| 573 m_ancestorScrollClippingLayer->setSize(scrollParentClippingLayer->size()
); |
| 574 m_ancestorScrollClippingLayer->setOffsetFromRenderer(toIntSize(roundedIn
tPoint(-position))); |
| 575 |
| 576 graphicsLayerParentLocation = roundedIntPoint(position); |
| 577 } |
| 578 |
| 547 if (compAncestor && m_ancestorClippingLayer) { | 579 if (compAncestor && m_ancestorClippingLayer) { |
| 548 // Call calculateRects to get the backgroundRect which is what is used t
o clip the contents of this | 580 // Call calculateRects to get the backgroundRect which is what is used t
o clip the contents of this |
| 549 // layer. Note that we call it with temporaryClipRects = true because no
rmally when computing clip rects | 581 // layer. Note that we call it with temporaryClipRects = true because no
rmally when computing clip rects |
| 550 // for a compositing layer, rootLayer is the layer itself. | 582 // for a compositing layer, rootLayer is the layer itself. |
| 551 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0, Temporar
yClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip); | 583 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0, Temporar
yClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip); |
| 552 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundCl
ipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. | 584 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundCl
ipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. |
| 553 ASSERT(parentClipRect != PaintInfo::infiniteRect()); | 585 ASSERT(parentClipRect != PaintInfo::infiniteRect()); |
| 554 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location(
) - graphicsLayerParentLocation)); | 586 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location(
) - graphicsLayerParentLocation)); |
| 555 m_ancestorClippingLayer->setSize(parentClipRect.size()); | 587 m_ancestorClippingLayer->setSize(parentClipRect.size()); |
| 556 | 588 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 | 775 |
| 744 // Page scale is applied as a transform on the root render view layer. Becau
se the scroll | 776 // Page scale is applied as a transform on the root render view layer. Becau
se the scroll |
| 745 // layer is further up in the hierarchy, we need to avoid marking the root r
ender view | 777 // layer is further up in the hierarchy, we need to avoid marking the root r
ender view |
| 746 // layer as a container. | 778 // layer as a container. |
| 747 bool isContainer = m_owningLayer->hasTransform() && !m_owningLayer->isRootLa
yer(); | 779 bool isContainer = m_owningLayer->hasTransform() && !m_owningLayer->isRootLa
yer(); |
| 748 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe
rlayers(), isContainer); | 780 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe
rlayers(), isContainer); |
| 749 } | 781 } |
| 750 | 782 |
| 751 void RenderLayerBacking::updateInternalHierarchy() | 783 void RenderLayerBacking::updateInternalHierarchy() |
| 752 { | 784 { |
| 785 if (m_ancestorScrollClippingLayer) |
| 786 m_ancestorScrollClippingLayer->removeAllChildren(); |
| 787 |
| 753 // m_foregroundLayer has to be inserted in the correct order with child laye
rs, | 788 // m_foregroundLayer has to be inserted in the correct order with child laye
rs, |
| 754 // so it's not inserted here. | 789 // so it's not inserted here. |
| 755 if (m_ancestorClippingLayer) | 790 if (m_ancestorClippingLayer) |
| 756 m_ancestorClippingLayer->removeAllChildren(); | 791 m_ancestorClippingLayer->removeAllChildren(); |
| 757 | 792 |
| 758 m_graphicsLayer->removeFromParent(); | 793 m_graphicsLayer->removeFromParent(); |
| 759 | 794 |
| 760 if (m_ancestorClippingLayer) | 795 if (m_ancestorClippingLayer) |
| 761 m_ancestorClippingLayer->addChild(m_graphicsLayer.get()); | 796 m_ancestorClippingLayer->addChild(m_graphicsLayer.get()); |
| 762 | 797 |
| 798 if (m_ancestorScrollClippingLayer) { |
| 799 if (m_ancestorClippingLayer) |
| 800 m_ancestorScrollClippingLayer->addChild(m_ancestorClippingLayer.get(
)); |
| 801 else |
| 802 m_ancestorScrollClippingLayer->addChild(m_graphicsLayer.get()); |
| 803 } |
| 804 |
| 763 if (m_childContainmentLayer) { | 805 if (m_childContainmentLayer) { |
| 764 m_childContainmentLayer->removeFromParent(); | 806 m_childContainmentLayer->removeFromParent(); |
| 765 m_graphicsLayer->addChild(m_childContainmentLayer.get()); | 807 m_graphicsLayer->addChild(m_childContainmentLayer.get()); |
| 766 } | 808 } |
| 767 | 809 |
| 768 if (m_scrollingLayer) { | 810 if (m_scrollingLayer) { |
| 769 GraphicsLayer* superlayer = m_childContainmentLayer ? m_childContainment
Layer.get() : m_graphicsLayer.get(); | 811 GraphicsLayer* superlayer = m_childContainmentLayer ? m_childContainment
Layer.get() : m_graphicsLayer.get(); |
| 770 m_scrollingLayer->removeFromParent(); | 812 m_scrollingLayer->removeFromParent(); |
| 771 superlayer->addChild(m_scrollingLayer.get()); | 813 superlayer->addChild(m_scrollingLayer.get()); |
| 772 } | 814 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 // FIXME: we could refine this to only allocate backing for one of these lay
ers if possible. | 873 // FIXME: we could refine this to only allocate backing for one of these lay
ers if possible. |
| 832 m_graphicsLayer->setDrawsContent(hasPaintedContent); | 874 m_graphicsLayer->setDrawsContent(hasPaintedContent); |
| 833 if (m_foregroundLayer) | 875 if (m_foregroundLayer) |
| 834 m_foregroundLayer->setDrawsContent(hasPaintedContent); | 876 m_foregroundLayer->setDrawsContent(hasPaintedContent); |
| 835 | 877 |
| 836 if (m_backgroundLayer) | 878 if (m_backgroundLayer) |
| 837 m_backgroundLayer->setDrawsContent(hasPaintedContent); | 879 m_backgroundLayer->setDrawsContent(hasPaintedContent); |
| 838 } | 880 } |
| 839 | 881 |
| 840 // Return true if the layers changed. | 882 // Return true if the layers changed. |
| 841 bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs
DescendantClip) | 883 bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs
DescendantClip, bool needsScrollClip) |
| 842 { | 884 { |
| 843 bool layersChanged = false; | 885 bool layersChanged = false; |
| 844 | 886 |
| 845 if (needsAncestorClip) { | 887 if (needsAncestorClip) { |
| 846 if (!m_ancestorClippingLayer) { | 888 if (!m_ancestorClippingLayer) { |
| 847 m_ancestorClippingLayer = createGraphicsLayer(CompositingReasonLayer
ForClip); | 889 m_ancestorClippingLayer = createGraphicsLayer(CompositingReasonLayer
ForClip); |
| 848 m_ancestorClippingLayer->setMasksToBounds(true); | 890 m_ancestorClippingLayer->setMasksToBounds(true); |
| 849 layersChanged = true; | 891 layersChanged = true; |
| 850 } | 892 } |
| 851 } else if (m_ancestorClippingLayer) { | 893 } else if (m_ancestorClippingLayer) { |
| 852 m_ancestorClippingLayer->removeFromParent(); | 894 m_ancestorClippingLayer->removeFromParent(); |
| 853 m_ancestorClippingLayer = nullptr; | 895 m_ancestorClippingLayer = nullptr; |
| 854 layersChanged = true; | 896 layersChanged = true; |
| 855 } | 897 } |
| 856 | 898 |
| 857 if (needsDescendantClip) { | 899 if (needsDescendantClip) { |
| 858 // We don't need a child containment layer if we're the main frame rende
r view | 900 // We don't need a child containment layer if we're the main frame rende
r view |
| 859 // layer. It's redundant as the frame clip above us will handle this cli
pping. | 901 // layer. It's redundant as the frame clip above us will handle this cli
pping. |
| 860 if (!m_childContainmentLayer && !m_isMainFrameRenderViewLayer) { | 902 if (!m_childContainmentLayer && !m_isMainFrameRenderViewLayer) { |
| 861 m_childContainmentLayer = createGraphicsLayer(CompositingReasonLayer
ForClip); | 903 m_childContainmentLayer = createGraphicsLayer(CompositingReasonLayer
ForClip); |
| 862 m_childContainmentLayer->setMasksToBounds(true); | 904 m_childContainmentLayer->setMasksToBounds(true); |
| 863 layersChanged = true; | 905 layersChanged = true; |
| 864 } | 906 } |
| 865 } else if (hasClippingLayer()) { | 907 } else if (hasClippingLayer()) { |
| 866 m_childContainmentLayer->removeFromParent(); | 908 m_childContainmentLayer->removeFromParent(); |
| 867 m_childContainmentLayer = nullptr; | 909 m_childContainmentLayer = nullptr; |
| 868 layersChanged = true; | 910 layersChanged = true; |
| 869 } | 911 } |
| 870 | 912 |
| 913 if (needsScrollClip) { |
| 914 if (!m_ancestorScrollClippingLayer) { |
| 915 m_ancestorScrollClippingLayer = createGraphicsLayer(CompositingReaso
nLayerForClip); |
| 916 m_ancestorScrollClippingLayer->setMasksToBounds(true); |
| 917 layersChanged = true; |
| 918 } |
| 919 } else if (m_ancestorScrollClippingLayer) { |
| 920 m_ancestorScrollClippingLayer->removeFromParent(); |
| 921 m_ancestorScrollClippingLayer = nullptr; |
| 922 layersChanged = true; |
| 923 } |
| 924 |
| 871 return layersChanged; | 925 return layersChanged; |
| 872 } | 926 } |
| 873 | 927 |
| 874 void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgr
oundLayerPaintsFixedRootBackground) | 928 void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgr
oundLayerPaintsFixedRootBackground) |
| 875 { | 929 { |
| 876 m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootB
ackground; | 930 m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootB
ackground; |
| 877 } | 931 } |
| 878 | 932 |
| 879 bool RenderLayerBacking::updateOverflowControlsLayers(bool needsHorizontalScroll
barLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer) | 933 bool RenderLayerBacking::updateOverflowControlsLayers(bool needsHorizontalScroll
barLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer) |
| 880 { | 934 { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 updateInternalHierarchy(); | 1137 updateInternalHierarchy(); |
| 1084 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); | 1138 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); |
| 1085 m_graphicsLayer->setNeedsDisplay(); | 1139 m_graphicsLayer->setNeedsDisplay(); |
| 1086 if (renderer()->view()) | 1140 if (renderer()->view()) |
| 1087 compositor()->scrollingLayerDidChange(m_owningLayer); | 1141 compositor()->scrollingLayerDidChange(m_owningLayer); |
| 1088 } | 1142 } |
| 1089 | 1143 |
| 1090 return layerChanged; | 1144 return layerChanged; |
| 1091 } | 1145 } |
| 1092 | 1146 |
| 1147 void RenderLayerBacking::updateScrollParent(RenderLayer* scrollParent) |
| 1148 { |
| 1149 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) |
| 1150 scrollingCoordinator->updateScrollParentForLayer(m_owningLayer, scrollPa
rent); |
| 1151 } |
| 1152 |
| 1153 void RenderLayerBacking::updateClipParent(RenderLayer* clipParent) |
| 1154 { |
| 1155 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay
er(m_owningLayer)) |
| 1156 scrollingCoordinator->updateClipParentForLayer(m_owningLayer, clipParent
); |
| 1157 } |
| 1158 |
| 1093 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co
nst | 1159 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co
nst |
| 1094 { | 1160 { |
| 1095 unsigned phase = 0; | 1161 unsigned phase = 0; |
| 1096 if (!m_backgroundLayer) | 1162 if (!m_backgroundLayer) |
| 1097 phase |= GraphicsLayerPaintBackground; | 1163 phase |= GraphicsLayerPaintBackground; |
| 1098 if (!m_foregroundLayer) | 1164 if (!m_foregroundLayer) |
| 1099 phase |= GraphicsLayerPaintForeground; | 1165 phase |= GraphicsLayerPaintForeground; |
| 1100 if (!m_maskLayer) | 1166 if (!m_maskLayer) |
| 1101 phase |= GraphicsLayerPaintMask; | 1167 phase |= GraphicsLayerPaintMask; |
| 1102 | 1168 |
| 1103 if (m_scrollingContentsLayer) { | 1169 if (m_scrollingContentsLayer) { |
| 1104 phase &= ~GraphicsLayerPaintForeground; | 1170 phase &= ~GraphicsLayerPaintForeground; |
| 1105 phase |= GraphicsLayerPaintCompositedScroll; | 1171 phase |= GraphicsLayerPaintCompositedScroll; |
| 1106 } | 1172 } |
| 1107 | 1173 |
| 1174 if (m_owningLayer->compositingReasons() & CompositingReasonOverflowScrolling
Parent) |
| 1175 phase |= GraphicsLayerPaintCompositedScroll; |
| 1176 |
| 1108 return static_cast<GraphicsLayerPaintingPhase>(phase); | 1177 return static_cast<GraphicsLayerPaintingPhase>(phase); |
| 1109 } | 1178 } |
| 1110 | 1179 |
| 1111 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const | 1180 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const |
| 1112 { | 1181 { |
| 1113 float finalOpacity = rendererOpacity; | 1182 float finalOpacity = rendererOpacity; |
| 1114 | 1183 |
| 1115 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent(
)) { | 1184 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent(
)) { |
| 1116 // We only care about parents that are stacking contexts. | 1185 // We only care about parents that are stacking contexts. |
| 1117 // Recall that opacity creates stacking context. | 1186 // Recall that opacity creates stacking context. |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 GraphicsLayer* RenderLayerBacking::parentForSublayers() const | 1504 GraphicsLayer* RenderLayerBacking::parentForSublayers() const |
| 1436 { | 1505 { |
| 1437 if (m_scrollingContentsLayer) | 1506 if (m_scrollingContentsLayer) |
| 1438 return m_scrollingContentsLayer.get(); | 1507 return m_scrollingContentsLayer.get(); |
| 1439 | 1508 |
| 1440 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL
ayer.get(); | 1509 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL
ayer.get(); |
| 1441 } | 1510 } |
| 1442 | 1511 |
| 1443 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const | 1512 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const |
| 1444 { | 1513 { |
| 1514 if (m_ancestorScrollClippingLayer) |
| 1515 return m_ancestorScrollClippingLayer.get(); |
| 1516 |
| 1445 if (m_ancestorClippingLayer) | 1517 if (m_ancestorClippingLayer) |
| 1446 return m_ancestorClippingLayer.get(); | 1518 return m_ancestorClippingLayer.get(); |
| 1447 | 1519 |
| 1448 return m_graphicsLayer.get(); | 1520 return m_graphicsLayer.get(); |
| 1449 } | 1521 } |
| 1450 | 1522 |
| 1451 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) | 1523 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) |
| 1452 { | 1524 { |
| 1453 if (requiresOwnBacking == m_requiresOwnBackingStore) | 1525 if (requiresOwnBacking == m_requiresOwnBackingStore) |
| 1454 return; | 1526 return; |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate(); | 1973 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate(); |
| 1902 | 1974 |
| 1903 return backingMemory; | 1975 return backingMemory; |
| 1904 } | 1976 } |
| 1905 | 1977 |
| 1906 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer) | 1978 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer) |
| 1907 { | 1979 { |
| 1908 String name; | 1980 String name; |
| 1909 if (graphicsLayer == m_graphicsLayer.get()) { | 1981 if (graphicsLayer == m_graphicsLayer.get()) { |
| 1910 name = m_owningLayer->debugName(); | 1982 name = m_owningLayer->debugName(); |
| 1983 } else if (graphicsLayer == m_ancestorScrollClippingLayer.get()) { |
| 1984 name = "Ancestor Scroll Clipping Layer"; |
| 1911 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { | 1985 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { |
| 1912 name = "Ancestor Clipping Layer"; | 1986 name = "Ancestor Clipping Layer"; |
| 1913 } else if (graphicsLayer == m_foregroundLayer.get()) { | 1987 } else if (graphicsLayer == m_foregroundLayer.get()) { |
| 1914 name = m_owningLayer->debugName() + " (foreground) Layer"; | 1988 name = m_owningLayer->debugName() + " (foreground) Layer"; |
| 1915 } else if (graphicsLayer == m_backgroundLayer.get()) { | 1989 } else if (graphicsLayer == m_backgroundLayer.get()) { |
| 1916 name = m_owningLayer->debugName() + " (background) Layer"; | 1990 name = m_owningLayer->debugName() + " (background) Layer"; |
| 1917 } else if (graphicsLayer == m_childContainmentLayer.get()) { | 1991 } else if (graphicsLayer == m_childContainmentLayer.get()) { |
| 1918 name = "Child Containment Layer"; | 1992 name = "Child Containment Layer"; |
| 1919 } else if (graphicsLayer == m_maskLayer.get()) { | 1993 } else if (graphicsLayer == m_maskLayer.get()) { |
| 1920 name = "Mask Layer"; | 1994 name = "Mask Layer"; |
| 1921 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { | 1995 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { |
| 1922 name = "Horizontal Scrollbar Layer"; | 1996 name = "Horizontal Scrollbar Layer"; |
| 1923 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { | 1997 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { |
| 1924 name = "Vertical Scrollbar Layer"; | 1998 name = "Vertical Scrollbar Layer"; |
| 1925 } else if (graphicsLayer == m_layerForScrollCorner.get()) { | 1999 } else if (graphicsLayer == m_layerForScrollCorner.get()) { |
| 1926 name = "Scroll Corner Layer"; | 2000 name = "Scroll Corner Layer"; |
| 1927 } else if (graphicsLayer == m_scrollingLayer.get()) { | 2001 } else if (graphicsLayer == m_scrollingLayer.get()) { |
| 1928 name = "Scrolling Layer"; | 2002 name = "Scrolling Layer"; |
| 1929 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2003 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 1930 name = "Scrolling Contents Layer"; | 2004 name = "Scrolling Contents Layer"; |
| 1931 } else { | 2005 } else { |
| 1932 ASSERT_NOT_REACHED(); | 2006 ASSERT_NOT_REACHED(); |
| 1933 } | 2007 } |
| 1934 | 2008 |
| 1935 return name; | 2009 return name; |
| 1936 } | 2010 } |
| 1937 | 2011 |
| 1938 } // namespace WebCore | 2012 } // namespace WebCore |
| OLD | NEW |