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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 // Do not leave the destroyed pointer dangling on any RenderLayers that pain ted to this mapping's squashing layer. | 180 // Do not leave the destroyed pointer dangling on any RenderLayers that pain ted to this mapping's squashing layer. |
181 for (size_t i = 0; i < m_squashedLayers.size(); ++i) { | 181 for (size_t i = 0; i < m_squashedLayers.size(); ++i) { |
182 RenderLayer* oldSquashedLayer = m_squashedLayers[i].renderLayer; | 182 RenderLayer* oldSquashedLayer = m_squashedLayers[i].renderLayer; |
183 if (oldSquashedLayer->groupedMapping() == this) { | 183 if (oldSquashedLayer->groupedMapping() == this) { |
184 oldSquashedLayer->setGroupedMapping(0, true); | 184 oldSquashedLayer->setGroupedMapping(0, true); |
185 oldSquashedLayer->setLostGroupedMapping(true); | 185 oldSquashedLayer->setLostGroupedMapping(true); |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 updateClippingLayers(false, false); | 189 updateClippingLayers(false, false); |
190 updateOverflowControlsLayers(false, false, false); | 190 updateOverflowControlsLayers(false, false, false, false); |
191 updateChildTransformLayer(false); | 191 updateChildTransformLayer(false); |
192 updateForegroundLayer(false); | 192 updateForegroundLayer(false); |
193 updateBackgroundLayer(false); | 193 updateBackgroundLayer(false); |
194 updateMaskLayer(false); | 194 updateMaskLayer(false); |
195 updateClippingMaskLayers(false); | 195 updateClippingMaskLayers(false); |
196 updateScrollingLayers(false); | 196 updateScrollingLayers(false); |
197 updateSquashingLayers(false); | 197 updateSquashingLayers(false); |
198 destroyGraphicsLayers(); | 198 destroyGraphicsLayers(); |
199 } | 199 } |
200 | 200 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
381 if (scrollParent) { | 381 if (scrollParent) { |
382 // If our containing block is our ancestor scrolling layer, then we'll a lready be clipped | 382 // If our containing block is our ancestor scrolling layer, then we'll a lready be clipped |
383 // to it via our scroll parent and we don't need an ancestor clipping la yer. | 383 // to it via our scroll parent and we don't need an ancestor clipping la yer. |
384 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_o wningLayer.ancestorScrollingLayer()) | 384 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_o wningLayer.ancestorScrollingLayer()) |
385 needsAncestorClip = false; | 385 needsAncestorClip = false; |
386 } | 386 } |
387 | 387 |
388 if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer)) | 388 if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer)) |
389 layerConfigChanged = true; | 389 layerConfigChanged = true; |
390 | 390 |
391 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require sVerticalScrollbarLayer(), requiresScrollCornerLayer())) | 391 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require sVerticalScrollbarLayer(), requiresScrollCornerLayer(), needsAncestorClip)) |
392 layerConfigChanged = true; | 392 layerConfigChanged = true; |
393 | 393 |
394 bool scrollingConfigChanged = false; | 394 bool scrollingConfigChanged = false; |
395 if (updateScrollingLayers(m_owningLayer.needsCompositedScrolling())) { | 395 if (updateScrollingLayers(m_owningLayer.needsCompositedScrolling())) { |
396 layerConfigChanged = true; | 396 layerConfigChanged = true; |
397 scrollingConfigChanged = true; | 397 scrollingConfigChanged = true; |
398 } | 398 } |
399 | 399 |
400 bool hasPerspective = false; | 400 bool hasPerspective = false; |
401 if (RenderStyle* style = renderer->style()) | 401 if (RenderStyle* style = renderer->style()) |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
591 squashingLayer->setPosition(squashLayerBounds.location()); | 591 squashingLayer->setPosition(squashLayerBounds.location()); |
592 squashingLayer->setSize(squashLayerBounds.size()); | 592 squashingLayer->setSize(squashLayerBounds.size()); |
593 | 593 |
594 *offsetFromTransformedAncestor = referenceOffsetFromTransformedAncestor; | 594 *offsetFromTransformedAncestor = referenceOffsetFromTransformedAncestor; |
595 offsetFromTransformedAncestor->move(squashLayerOriginInOwningLayerSpace); | 595 offsetFromTransformedAncestor->move(squashLayerOriginInOwningLayerSpace); |
596 | 596 |
597 for (size_t i = 0; i < layers.size(); ++i) | 597 for (size_t i = 0; i < layers.size(); ++i) |
598 layers[i].localClipRectForSquashedLayer = localClipRectForSquashedLayer( referenceLayer, layers[i], layers); | 598 layers[i].localClipRectForSquashedLayer = localClipRectForSquashedLayer( referenceLayer, layers[i], layers); |
599 } | 599 } |
600 | 600 |
601 void CompositedLayerMapping::updateGraphicsLayerGeometry(const RenderLayer* comp ositingContainer, Vector<RenderLayer*>& layersNeedingPaintInvalidation) | 601 void CompositedLayerMapping::updateGraphicsLayerGeometry(const RenderLayer* comp ositingContainer, const RenderLayer* compositingStackingContext, Vector<RenderLa yer*>& layersNeedingPaintInvalidation) |
602 { | 602 { |
603 ASSERT(m_owningLayer.compositor()->lifecycle().state() == DocumentLifecycle: :InCompositingUpdate); | 603 ASSERT(m_owningLayer.compositor()->lifecycle().state() == DocumentLifecycle: :InCompositingUpdate); |
604 | 604 |
605 // Set transform property, if it is not animating. We have to do this here b ecause the transform | 605 // Set transform property, if it is not animating. We have to do this here b ecause the transform |
606 // is affected by the layer dimensions. | 606 // is affected by the layer dimensions. |
607 if (!renderer()->style()->isRunningTransformAnimationOnCompositor()) | 607 if (!renderer()->style()->isRunningTransformAnimationOnCompositor()) |
608 updateTransform(renderer()->style()); | 608 updateTransform(renderer()->style()); |
609 | 609 |
610 // Set opacity, if it is not animating. | 610 // Set opacity, if it is not animating. |
611 if (!renderer()->style()->isRunningOpacityAnimationOnCompositor()) | 611 if (!renderer()->style()->isRunningOpacityAnimationOnCompositor()) |
(...skipping 13 matching lines...) Expand all Loading... | |
625 IntRect relativeCompositingBounds; | 625 IntRect relativeCompositingBounds; |
626 LayoutPoint offsetFromCompositedAncestor; | 626 LayoutPoint offsetFromCompositedAncestor; |
627 IntPoint snappedOffsetFromCompositedAncestor; | 627 IntPoint snappedOffsetFromCompositedAncestor; |
628 computeBoundsOfOwningLayer(compositingContainer, localCompositingBounds, rel ativeCompositingBounds, offsetFromCompositedAncestor, snappedOffsetFromComposite dAncestor); | 628 computeBoundsOfOwningLayer(compositingContainer, localCompositingBounds, rel ativeCompositingBounds, offsetFromCompositedAncestor, snappedOffsetFromComposite dAncestor); |
629 | 629 |
630 IntPoint graphicsLayerParentLocation; | 630 IntPoint graphicsLayerParentLocation; |
631 computeGraphicsLayerParentLocation(compositingContainer, ancestorCompositing Bounds, graphicsLayerParentLocation); | 631 computeGraphicsLayerParentLocation(compositingContainer, ancestorCompositing Bounds, graphicsLayerParentLocation); |
632 | 632 |
633 // Might update graphicsLayerParentLocation. | 633 // Might update graphicsLayerParentLocation. |
634 updateAncestorClippingLayerGeometry(compositingContainer, snappedOffsetFromC ompositedAncestor, graphicsLayerParentLocation); | 634 updateAncestorClippingLayerGeometry(compositingContainer, snappedOffsetFromC ompositedAncestor, graphicsLayerParentLocation); |
635 updateOverflowControlsHostLayerGeometry(compositingStackingContext); | |
635 | 636 |
636 FloatSize contentsSize = relativeCompositingBounds.size(); | 637 FloatSize contentsSize = relativeCompositingBounds.size(); |
637 | 638 |
638 updateMainGraphicsLayerGeometry(relativeCompositingBounds, localCompositingB ounds, graphicsLayerParentLocation); | 639 updateMainGraphicsLayerGeometry(relativeCompositingBounds, localCompositingB ounds, graphicsLayerParentLocation); |
639 updateSquashingLayerGeometry(offsetFromCompositedAncestor, graphicsLayerPare ntLocation, m_owningLayer, m_squashedLayers, m_squashingLayer.get(), &m_squashin gLayerOffsetFromTransformedAncestor, layersNeedingPaintInvalidation); | 640 updateSquashingLayerGeometry(offsetFromCompositedAncestor, graphicsLayerPare ntLocation, m_owningLayer, m_squashedLayers, m_squashingLayer.get(), &m_squashin gLayerOffsetFromTransformedAncestor, layersNeedingPaintInvalidation); |
640 | 641 |
641 // If we have a layer that clips children, position it. | 642 // If we have a layer that clips children, position it. |
642 IntRect clippingBox; | 643 IntRect clippingBox; |
643 if (m_childContainmentLayer) | 644 if (m_childContainmentLayer) |
644 clippingBox = clipBox(toRenderBox(renderer())); | 645 clippingBox = clipBox(toRenderBox(renderer())); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
739 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); | 740 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); |
740 m_ancestorClippingLayer->setSize(parentClipRect.size()); | 741 m_ancestorClippingLayer->setSize(parentClipRect.size()); |
741 | 742 |
742 // backgroundRect is relative to compositingContainer, so subtract snappedOf fsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y to get back t o local coords. | 743 // backgroundRect is relative to compositingContainer, so subtract snappedOf fsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y to get back t o local coords. |
743 m_ancestorClippingLayer->setOffsetFromRenderer(parentClipRect.location() - s nappedOffsetFromCompositedAncestor); | 744 m_ancestorClippingLayer->setOffsetFromRenderer(parentClipRect.location() - s nappedOffsetFromCompositedAncestor); |
744 | 745 |
745 // The primary layer is then parented in, and positioned relative to this cl ipping layer. | 746 // The primary layer is then parented in, and positioned relative to this cl ipping layer. |
746 graphicsLayerParentLocation = parentClipRect.location(); | 747 graphicsLayerParentLocation = parentClipRect.location(); |
747 } | 748 } |
748 | 749 |
750 static FloatPoint relativePositionInTransformedAncestorSpace(const RenderLayer* layer, const RenderLayer* compositingStackingContext) | |
hartmanng
2014/07/24 15:57:35
I find this name a bit confusing. When I read it,
Ian Vollick
2014/07/24 17:39:09
Yeah, the name's crappy. I've sidestepped the issu
| |
751 { | |
752 ASSERT(layer->transformAncestor() == compositingStackingContext->transformAn cestor()); | |
753 LayoutPoint localOffsetToTransformedAncestor = layer->computeOffsetFromTrans formedAncestor(); | |
754 LayoutPoint compositingStackingContextOffsetToTransformedAncestor = composit ingStackingContext->computeOffsetFromTransformedAncestor(); | |
755 return FloatPoint(localOffsetToTransformedAncestor - compositingStackingCont extOffsetToTransformedAncestor); | |
756 } | |
757 | |
758 void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry(const Rende rLayer* compositingStackingContext) | |
759 { | |
760 if (!m_overflowControlsHostLayer) | |
761 return; | |
762 | |
763 if (m_owningLayer.needsToReparentOverflowControls()) { | |
764 if (m_overflowControlsClippingLayer) { | |
765 m_overflowControlsClippingLayer->setPosition(m_ancestorClippingLayer ->position()); | |
766 m_overflowControlsClippingLayer->setSize(m_ancestorClippingLayer->si ze()); | |
767 m_overflowControlsClippingLayer->setOffsetFromRenderer(m_ancestorCli ppingLayer->offsetFromRenderer()); | |
768 m_overflowControlsClippingLayer->setMasksToBounds(true); | |
769 | |
770 m_overflowControlsHostLayer->setPosition(IntPoint(-m_overflowControl sClippingLayer->offsetFromRenderer())); | |
771 } else { | |
772 m_overflowControlsHostLayer->setPosition(relativePositionInTransform edAncestorSpace(&m_owningLayer, compositingStackingContext)); | |
773 } | |
774 } else { | |
775 m_overflowControlsHostLayer->setPosition(FloatPoint()); | |
776 } | |
777 } | |
778 | |
749 void CompositedLayerMapping::updateChildContainmentLayerGeometry(const IntRect& clippingBox, const IntRect& localCompositingBounds) | 779 void CompositedLayerMapping::updateChildContainmentLayerGeometry(const IntRect& clippingBox, const IntRect& localCompositingBounds) |
750 { | 780 { |
751 if (!m_childContainmentLayer) | 781 if (!m_childContainmentLayer) |
752 return; | 782 return; |
753 | 783 |
754 m_childContainmentLayer->setPosition(FloatPoint(clippingBox.location() - loc alCompositingBounds.location() + roundedIntSize(m_owningLayer.subpixelAccumulati on()))); | 784 m_childContainmentLayer->setPosition(FloatPoint(clippingBox.location() - loc alCompositingBounds.location() + roundedIntSize(m_owningLayer.subpixelAccumulati on()))); |
755 m_childContainmentLayer->setSize(clippingBox.size()); | 785 m_childContainmentLayer->setSize(clippingBox.size()); |
756 m_childContainmentLayer->setOffsetFromRenderer(toIntSize(clippingBox.locatio n())); | 786 m_childContainmentLayer->setOffsetFromRenderer(toIntSize(clippingBox.locatio n())); |
757 if (m_childClippingMaskLayer && !m_scrollingLayer && !renderer()->style()->c lipPath()) { | 787 if (m_childClippingMaskLayer && !m_scrollingLayer && !renderer()->style()->c lipPath()) { |
758 m_childClippingMaskLayer->setPosition(m_childContainmentLayer->position( )); | 788 m_childClippingMaskLayer->setPosition(m_childContainmentLayer->position( )); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 m_graphicsLayer->setTransformOrigin(compositedTransformOrigin); | 840 m_graphicsLayer->setTransformOrigin(compositedTransformOrigin); |
811 } | 841 } |
812 } | 842 } |
813 | 843 |
814 void CompositedLayerMapping::updateReflectionLayerGeometry(Vector<RenderLayer*>& layersNeedingPaintInvalidation) | 844 void CompositedLayerMapping::updateReflectionLayerGeometry(Vector<RenderLayer*>& layersNeedingPaintInvalidation) |
815 { | 845 { |
816 if (!m_owningLayer.reflectionInfo() || !m_owningLayer.reflectionInfo()->refl ectionLayer()->hasCompositedLayerMapping()) | 846 if (!m_owningLayer.reflectionInfo() || !m_owningLayer.reflectionInfo()->refl ectionLayer()->hasCompositedLayerMapping()) |
817 return; | 847 return; |
818 | 848 |
819 CompositedLayerMappingPtr reflectionCompositedLayerMapping = m_owningLayer.r eflectionInfo()->reflectionLayer()->compositedLayerMapping(); | 849 CompositedLayerMappingPtr reflectionCompositedLayerMapping = m_owningLayer.r eflectionInfo()->reflectionLayer()->compositedLayerMapping(); |
820 reflectionCompositedLayerMapping->updateGraphicsLayerGeometry(&m_owningLayer , layersNeedingPaintInvalidation); | 850 reflectionCompositedLayerMapping->updateGraphicsLayerGeometry(&m_owningLayer , &m_owningLayer, layersNeedingPaintInvalidation); |
hartmanng
2014/07/24 15:57:35
Why is m_owningLayer necessarily the correct compo
Ian Vollick
2014/07/24 17:39:09
It's a great question. Having a reflection makes y
| |
821 } | 851 } |
822 | 852 |
823 void CompositedLayerMapping::updateScrollingLayerGeometry(const IntRect& localCo mpositingBounds) | 853 void CompositedLayerMapping::updateScrollingLayerGeometry(const IntRect& localCo mpositingBounds) |
824 { | 854 { |
825 if (!m_scrollingLayer) | 855 if (!m_scrollingLayer) |
826 return; | 856 return; |
827 | 857 |
828 ASSERT(m_scrollingContentsLayer); | 858 ASSERT(m_scrollingContentsLayer); |
829 RenderBox* renderBox = toRenderBox(renderer()); | 859 RenderBox* renderBox = toRenderBox(renderer()); |
830 IntRect clientBox = enclosingIntRect(renderBox->clientBoxRect()); | 860 IntRect clientBox = enclosingIntRect(renderBox->clientBoxRect()); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
976 | 1006 |
977 if (m_childTransformLayer) | 1007 if (m_childTransformLayer) |
978 superLayer = m_childTransformLayer.get(); | 1008 superLayer = m_childTransformLayer.get(); |
979 | 1009 |
980 superLayer->addChild(m_scrollingLayer.get()); | 1010 superLayer->addChild(m_scrollingLayer.get()); |
981 } | 1011 } |
982 | 1012 |
983 // The clip for child layers does not include space for overflow controls, s o they exist as | 1013 // The clip for child layers does not include space for overflow controls, s o they exist as |
984 // siblings of the clipping layer if we have one. Normal children of this la yer are set as | 1014 // siblings of the clipping layer if we have one. Normal children of this la yer are set as |
985 // children of the clipping layer. | 1015 // children of the clipping layer. |
986 if (m_overflowControlsHostLayer) | 1016 if (m_overflowControlsClippingLayer) { |
1017 m_graphicsLayer->addChild(m_overflowControlsClippingLayer.get()); | |
1018 m_overflowControlsClippingLayer->addChild(m_overflowControlsHostLayer.ge t()); | |
1019 } else if (m_overflowControlsHostLayer) { | |
987 m_graphicsLayer->addChild(m_overflowControlsHostLayer.get()); | 1020 m_graphicsLayer->addChild(m_overflowControlsHostLayer.get()); |
1021 } | |
1022 | |
988 if (m_layerForHorizontalScrollbar) | 1023 if (m_layerForHorizontalScrollbar) |
989 m_overflowControlsHostLayer->addChild(m_layerForHorizontalScrollbar.get( )); | 1024 m_overflowControlsHostLayer->addChild(m_layerForHorizontalScrollbar.get( )); |
990 if (m_layerForVerticalScrollbar) | 1025 if (m_layerForVerticalScrollbar) |
991 m_overflowControlsHostLayer->addChild(m_layerForVerticalScrollbar.get()) ; | 1026 m_overflowControlsHostLayer->addChild(m_layerForVerticalScrollbar.get()) ; |
992 if (m_layerForScrollCorner) | 1027 if (m_layerForScrollCorner) |
993 m_overflowControlsHostLayer->addChild(m_layerForScrollCorner.get()); | 1028 m_overflowControlsHostLayer->addChild(m_layerForScrollCorner.get()); |
994 | 1029 |
995 // The squashing containment layer, if it exists, becomes a no-op parent. | 1030 // The squashing containment layer, if it exists, becomes a no-op parent. |
996 if (m_squashingLayer) { | 1031 if (m_squashingLayer) { |
997 ASSERT(compositor()->layerSquashingEnabled()); | 1032 ASSERT(compositor()->layerSquashingEnabled()); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1160 | 1195 |
1161 // Only a member function so it can call createGraphicsLayer. | 1196 // Only a member function so it can call createGraphicsLayer. |
1162 bool CompositedLayerMapping::toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason) | 1197 bool CompositedLayerMapping::toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason) |
1163 { | 1198 { |
1164 if (needsLayer == !!layer) | 1199 if (needsLayer == !!layer) |
1165 return false; | 1200 return false; |
1166 layer = needsLayer ? createGraphicsLayer(reason) : nullptr; | 1201 layer = needsLayer ? createGraphicsLayer(reason) : nullptr; |
1167 return true; | 1202 return true; |
1168 } | 1203 } |
1169 | 1204 |
1170 bool CompositedLayerMapping::updateOverflowControlsLayers(bool needsHorizontalSc rollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer) | 1205 bool CompositedLayerMapping::updateOverflowControlsLayers(bool needsHorizontalSc rollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer, boo l needsAncestorClip) |
1171 { | 1206 { |
1172 bool horizontalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerF orHorizontalScrollbar, needsHorizontalScrollbarLayer, CompositingReasonLayerForH orizontalScrollbar); | 1207 bool horizontalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerF orHorizontalScrollbar, needsHorizontalScrollbarLayer, CompositingReasonLayerForH orizontalScrollbar); |
1173 bool verticalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerFor VerticalScrollbar, needsVerticalScrollbarLayer, CompositingReasonLayerForVertica lScrollbar); | 1208 bool verticalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerFor VerticalScrollbar, needsVerticalScrollbarLayer, CompositingReasonLayerForVertica lScrollbar); |
1174 bool scrollCornerLayerChanged = toggleScrollbarLayerIfNeeded(m_layerForScrol lCorner, needsScrollCornerLayer, CompositingReasonLayerForScrollCorner); | 1209 bool scrollCornerLayerChanged = toggleScrollbarLayerIfNeeded(m_layerForScrol lCorner, needsScrollCornerLayer, CompositingReasonLayerForScrollCorner); |
1175 | 1210 |
1176 bool needsOverflowControlsHostLayer = needsHorizontalScrollbarLayer || needs VerticalScrollbarLayer || needsScrollCornerLayer; | 1211 bool needsOverflowControlsHostLayer = needsHorizontalScrollbarLayer || needs VerticalScrollbarLayer || needsScrollCornerLayer; |
1177 toggleScrollbarLayerIfNeeded(m_overflowControlsHostLayer, needsOverflowContr olsHostLayer, CompositingReasonLayerForOverflowControlsHost); | 1212 toggleScrollbarLayerIfNeeded(m_overflowControlsHostLayer, needsOverflowContr olsHostLayer, CompositingReasonLayerForOverflowControlsHost); |
1213 bool needsOverflowClipLayer = needsOverflowControlsHostLayer && needsAncesto rClip; | |
1214 toggleScrollbarLayerIfNeeded(m_overflowControlsClippingLayer, needsOverflowC lipLayer, CompositingReasonLayerForOverflowControlsHost); | |
1178 | 1215 |
1179 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) { | 1216 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) { |
1180 if (horizontalScrollbarLayerChanged) | 1217 if (horizontalScrollbarLayerChanged) |
1181 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning Layer.scrollableArea(), HorizontalScrollbar); | 1218 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning Layer.scrollableArea(), HorizontalScrollbar); |
1182 if (verticalScrollbarLayerChanged) | 1219 if (verticalScrollbarLayerChanged) |
1183 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning Layer.scrollableArea(), VerticalScrollbar); | 1220 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning Layer.scrollableArea(), VerticalScrollbar); |
1184 } | 1221 } |
1185 | 1222 |
1186 return horizontalScrollbarLayerChanged || verticalScrollbarLayerChanged || s crollCornerLayerChanged; | 1223 return horizontalScrollbarLayerChanged || verticalScrollbarLayerChanged || s crollCornerLayerChanged; |
1187 } | 1224 } |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1786 | 1823 |
1787 LayoutRect CompositedLayerMapping::contentsBox() const | 1824 LayoutRect CompositedLayerMapping::contentsBox() const |
1788 { | 1825 { |
1789 LayoutRect contentsBox = contentsRect(renderer()); | 1826 LayoutRect contentsBox = contentsRect(renderer()); |
1790 contentsBox.move(contentOffsetInCompositingLayer()); | 1827 contentsBox.move(contentOffsetInCompositingLayer()); |
1791 return contentsBox; | 1828 return contentsBox; |
1792 } | 1829 } |
1793 | 1830 |
1794 GraphicsLayer* CompositedLayerMapping::detachLayerForOverflowControls(const Rend erLayer& enclosingLayer) | 1831 GraphicsLayer* CompositedLayerMapping::detachLayerForOverflowControls(const Rend erLayer& enclosingLayer) |
1795 { | 1832 { |
1796 LayoutPoint localOffsetToTransformedAncestor = m_owningLayer.computeOffsetFr omTransformedAncestor(); | 1833 GraphicsLayer* host = m_overflowControlsClippingLayer.get(); |
1797 LayoutPoint enclosingLayerOffsetToTransformedAncestor = enclosingLayer.compu teOffsetFromTransformedAncestor(); | 1834 if (!host) |
1798 m_overflowControlsHostLayer->setPosition(FloatPoint(localOffsetToTransformed Ancestor - enclosingLayerOffsetToTransformedAncestor)); | 1835 host = m_overflowControlsHostLayer.get(); |
1799 m_overflowControlsHostLayer->removeFromParent(); | 1836 host->removeFromParent(); |
1800 return m_overflowControlsHostLayer.get(); | 1837 return host; |
1801 } | 1838 } |
1802 | 1839 |
1803 GraphicsLayer* CompositedLayerMapping::parentForSublayers() const | 1840 GraphicsLayer* CompositedLayerMapping::parentForSublayers() const |
1804 { | 1841 { |
1805 if (m_scrollingBlockSelectionLayer) | 1842 if (m_scrollingBlockSelectionLayer) |
1806 return m_scrollingBlockSelectionLayer.get(); | 1843 return m_scrollingBlockSelectionLayer.get(); |
1807 | 1844 |
1808 if (m_scrollingContentsLayer) | 1845 if (m_scrollingContentsLayer) |
1809 return m_scrollingContentsLayer.get(); | 1846 return m_scrollingContentsLayer.get(); |
1810 | 1847 |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2236 } else if (graphicsLayer == m_childClippingMaskLayer.get()) { | 2273 } else if (graphicsLayer == m_childClippingMaskLayer.get()) { |
2237 name = "Child Clipping Mask Layer"; | 2274 name = "Child Clipping Mask Layer"; |
2238 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { | 2275 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { |
2239 name = "Horizontal Scrollbar Layer"; | 2276 name = "Horizontal Scrollbar Layer"; |
2240 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { | 2277 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { |
2241 name = "Vertical Scrollbar Layer"; | 2278 name = "Vertical Scrollbar Layer"; |
2242 } else if (graphicsLayer == m_layerForScrollCorner.get()) { | 2279 } else if (graphicsLayer == m_layerForScrollCorner.get()) { |
2243 name = "Scroll Corner Layer"; | 2280 name = "Scroll Corner Layer"; |
2244 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { | 2281 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { |
2245 name = "Overflow Controls Host Layer"; | 2282 name = "Overflow Controls Host Layer"; |
2283 } else if (graphicsLayer == m_overflowControlsClippingLayer.get()) { | |
2284 name = "Overflow Controls ClipLayer Layer"; | |
2246 } else if (graphicsLayer == m_scrollingLayer.get()) { | 2285 } else if (graphicsLayer == m_scrollingLayer.get()) { |
2247 name = "Scrolling Layer"; | 2286 name = "Scrolling Layer"; |
2248 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2287 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2249 name = "Scrolling Contents Layer"; | 2288 name = "Scrolling Contents Layer"; |
2250 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2289 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2251 name = "Scrolling Block Selection Layer"; | 2290 name = "Scrolling Block Selection Layer"; |
2252 } else { | 2291 } else { |
2253 ASSERT_NOT_REACHED(); | 2292 ASSERT_NOT_REACHED(); |
2254 } | 2293 } |
2255 | 2294 |
2256 return name; | 2295 return name; |
2257 } | 2296 } |
2258 | 2297 |
2259 } // namespace blink | 2298 } // namespace blink |
OLD | NEW |