| 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 TRACE_LAYER_INVALIDATION(layers[i].paintLayer, InspectorLayerInvalid
ationTrackingEvent::SquashingLayerGeometryWasUpdated); | 656 TRACE_LAYER_INVALIDATION(layers[i].paintLayer, InspectorLayerInvalid
ationTrackingEvent::SquashingLayerGeometryWasUpdated); |
| 657 layersNeedingPaintInvalidation.append(layers[i].paintLayer); | 657 layersNeedingPaintInvalidation.append(layers[i].paintLayer); |
| 658 } | 658 } |
| 659 layers[i].offsetFromLayoutObject = newOffsetFromLayoutObject; | 659 layers[i].offsetFromLayoutObject = newOffsetFromLayoutObject; |
| 660 layers[i].offsetFromLayoutObjectSet = true; | 660 layers[i].offsetFromLayoutObjectSet = true; |
| 661 | 661 |
| 662 layers[i].paintLayer->setSubpixelAccumulation(subpixelAccumulation); | 662 layers[i].paintLayer->setSubpixelAccumulation(subpixelAccumulation); |
| 663 } | 663 } |
| 664 | 664 |
| 665 squashingLayer->setPosition(squashLayerBounds.location()); | 665 squashingLayer->setPosition(squashLayerBounds.location()); |
| 666 squashingLayer->setSize(squashLayerBounds.size()); | 666 squashingLayer->setSize(FloatSize(squashLayerBounds.size())); |
| 667 | 667 |
| 668 *offsetFromTransformedAncestor = referenceOffsetFromTransformedAncestor; | 668 *offsetFromTransformedAncestor = referenceOffsetFromTransformedAncestor; |
| 669 offsetFromTransformedAncestor->move(squashLayerOriginInOwningLayerSpace); | 669 offsetFromTransformedAncestor->move(squashLayerOriginInOwningLayerSpace); |
| 670 | 670 |
| 671 for (size_t i = 0; i < layers.size(); ++i) | 671 for (size_t i = 0; i < layers.size(); ++i) |
| 672 layers[i].localClipRectForSquashedLayer = localClipRectForSquashedLayer(
referenceLayer, layers[i], layers); | 672 layers[i].localClipRectForSquashedLayer = localClipRectForSquashedLayer(
referenceLayer, layers[i], layers); |
| 673 } | 673 } |
| 674 | 674 |
| 675 void CompositedLayerMapping::updateGraphicsLayerGeometry(const PaintLayer* compo
sitingContainer, const PaintLayer* compositingStackingContext, Vector<PaintLayer
*>& layersNeedingPaintInvalidation) | 675 void CompositedLayerMapping::updateGraphicsLayerGeometry(const PaintLayer* compo
sitingContainer, const PaintLayer* compositingStackingContext, Vector<PaintLayer
*>& layersNeedingPaintInvalidation) |
| 676 { | 676 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 704 IntPoint snappedOffsetFromCompositedAncestor; | 704 IntPoint snappedOffsetFromCompositedAncestor; |
| 705 computeBoundsOfOwningLayer(compositingContainer, localCompositingBounds, rel
ativeCompositingBounds, offsetFromCompositedAncestor, snappedOffsetFromComposite
dAncestor); | 705 computeBoundsOfOwningLayer(compositingContainer, localCompositingBounds, rel
ativeCompositingBounds, offsetFromCompositedAncestor, snappedOffsetFromComposite
dAncestor); |
| 706 | 706 |
| 707 IntPoint graphicsLayerParentLocation; | 707 IntPoint graphicsLayerParentLocation; |
| 708 computeGraphicsLayerParentLocation(compositingContainer, ancestorCompositing
Bounds, graphicsLayerParentLocation); | 708 computeGraphicsLayerParentLocation(compositingContainer, ancestorCompositing
Bounds, graphicsLayerParentLocation); |
| 709 | 709 |
| 710 // Might update graphicsLayerParentLocation. | 710 // Might update graphicsLayerParentLocation. |
| 711 updateAncestorClippingLayerGeometry(compositingContainer, snappedOffsetFromC
ompositedAncestor, graphicsLayerParentLocation); | 711 updateAncestorClippingLayerGeometry(compositingContainer, snappedOffsetFromC
ompositedAncestor, graphicsLayerParentLocation); |
| 712 updateOverflowControlsHostLayerGeometry(compositingStackingContext, composit
ingContainer); | 712 updateOverflowControlsHostLayerGeometry(compositingStackingContext, composit
ingContainer); |
| 713 | 713 |
| 714 FloatSize contentsSize = relativeCompositingBounds.size(); | 714 FloatSize contentsSize(relativeCompositingBounds.size()); |
| 715 | 715 |
| 716 updateMainGraphicsLayerGeometry(relativeCompositingBounds, localCompositingB
ounds, graphicsLayerParentLocation); | 716 updateMainGraphicsLayerGeometry(relativeCompositingBounds, localCompositingB
ounds, graphicsLayerParentLocation); |
| 717 updateContentsOffsetInCompositingLayer(snappedOffsetFromCompositedAncestor,
graphicsLayerParentLocation); | 717 updateContentsOffsetInCompositingLayer(snappedOffsetFromCompositedAncestor,
graphicsLayerParentLocation); |
| 718 updateSquashingLayerGeometry(offsetFromCompositedAncestor, graphicsLayerPare
ntLocation, m_owningLayer, m_squashedLayers, m_squashingLayer.get(), &m_squashin
gLayerOffsetFromTransformedAncestor, layersNeedingPaintInvalidation); | 718 updateSquashingLayerGeometry(offsetFromCompositedAncestor, graphicsLayerPare
ntLocation, m_owningLayer, m_squashedLayers, m_squashingLayer.get(), &m_squashin
gLayerOffsetFromTransformedAncestor, layersNeedingPaintInvalidation); |
| 719 | 719 |
| 720 // If we have a layer that clips children, position it. | 720 // If we have a layer that clips children, position it. |
| 721 IntRect clippingBox; | 721 IntRect clippingBox; |
| 722 if (m_childContainmentLayer) | 722 if (m_childContainmentLayer) |
| 723 clippingBox = clipBox(toLayoutBox(layoutObject())); | 723 clippingBox = clipBox(toLayoutBox(layoutObject())); |
| 724 | 724 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 754 | 754 |
| 755 updateCompositingReasons(); | 755 updateCompositingReasons(); |
| 756 } | 756 } |
| 757 | 757 |
| 758 void CompositedLayerMapping::updateMainGraphicsLayerGeometry(const IntRect& rela
tiveCompositingBounds, const IntRect& localCompositingBounds, const IntPoint& gr
aphicsLayerParentLocation) | 758 void CompositedLayerMapping::updateMainGraphicsLayerGeometry(const IntRect& rela
tiveCompositingBounds, const IntRect& localCompositingBounds, const IntPoint& gr
aphicsLayerParentLocation) |
| 759 { | 759 { |
| 760 m_graphicsLayer->setPosition(FloatPoint(relativeCompositingBounds.location()
- graphicsLayerParentLocation)); | 760 m_graphicsLayer->setPosition(FloatPoint(relativeCompositingBounds.location()
- graphicsLayerParentLocation)); |
| 761 m_graphicsLayer->setOffsetFromLayoutObject(toIntSize(localCompositingBounds.
location())); | 761 m_graphicsLayer->setOffsetFromLayoutObject(toIntSize(localCompositingBounds.
location())); |
| 762 | 762 |
| 763 FloatSize oldSize = m_graphicsLayer->size(); | 763 FloatSize oldSize = m_graphicsLayer->size(); |
| 764 const IntSize& contentsSize = relativeCompositingBounds.size(); | 764 const FloatSize contentsSize(relativeCompositingBounds.size()); |
| 765 if (oldSize != contentsSize) | 765 if (oldSize != contentsSize) |
| 766 m_graphicsLayer->setSize(contentsSize); | 766 m_graphicsLayer->setSize(contentsSize); |
| 767 | 767 |
| 768 // m_graphicsLayer is the corresponding GraphicsLayer for this PaintLayer an
d its non-compositing | 768 // m_graphicsLayer is the corresponding GraphicsLayer for this PaintLayer an
d its non-compositing |
| 769 // descendants. So, the visibility flag for m_graphicsLayer should be true i
f there are any | 769 // descendants. So, the visibility flag for m_graphicsLayer should be true i
f there are any |
| 770 // non-compositing visible layers. | 770 // non-compositing visible layers. |
| 771 bool contentsVisible = m_owningLayer.hasVisibleContent() || hasVisibleNonCom
positingDescendant(&m_owningLayer); | 771 bool contentsVisible = m_owningLayer.hasVisibleContent() || hasVisibleNonCom
positingDescendant(&m_owningLayer); |
| 772 if (layoutObject()->isVideo()) { | 772 if (layoutObject()->isVideo()) { |
| 773 HTMLVideoElement* videoElement = toHTMLVideoElement(layoutObject()->node
()); | 773 HTMLVideoElement* videoElement = toHTMLVideoElement(layoutObject()->node
()); |
| 774 if (videoElement->isFullscreen() && videoElement->usesOverlayFullscreenV
ideo()) | 774 if (videoElement->isFullscreen() && videoElement->usesOverlayFullscreenV
ideo()) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 | 807 |
| 808 void CompositedLayerMapping::updateAncestorClippingLayerGeometry(const PaintLaye
r* compositingContainer, const IntPoint& snappedOffsetFromCompositedAncestor, In
tPoint& graphicsLayerParentLocation) | 808 void CompositedLayerMapping::updateAncestorClippingLayerGeometry(const PaintLaye
r* compositingContainer, const IntPoint& snappedOffsetFromCompositedAncestor, In
tPoint& graphicsLayerParentLocation) |
| 809 { | 809 { |
| 810 if (!compositingContainer || !m_ancestorClippingLayer) | 810 if (!compositingContainer || !m_ancestorClippingLayer) |
| 811 return; | 811 return; |
| 812 | 812 |
| 813 ClipRectsContext clipRectsContext(compositingContainer, PaintingClipRectsIgn
oringOverflowClip, IgnoreOverlayScrollbarSize); | 813 ClipRectsContext clipRectsContext(compositingContainer, PaintingClipRectsIgn
oringOverflowClip, IgnoreOverlayScrollbarSize); |
| 814 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer.clipper().backgro
undClipRect(clipRectsContext).rect()); | 814 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer.clipper().backgro
undClipRect(clipRectsContext).rect()); |
| 815 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); | 815 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); |
| 816 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location() -
graphicsLayerParentLocation)); | 816 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location() -
graphicsLayerParentLocation)); |
| 817 m_ancestorClippingLayer->setSize(parentClipRect.size()); | 817 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size())); |
| 818 | 818 |
| 819 // backgroundRect is relative to compositingContainer, so subtract snappedOf
fsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y to get back t
o local coords. | 819 // backgroundRect is relative to compositingContainer, so subtract snappedOf
fsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y to get back t
o local coords. |
| 820 m_ancestorClippingLayer->setOffsetFromLayoutObject(parentClipRect.location()
- snappedOffsetFromCompositedAncestor); | 820 m_ancestorClippingLayer->setOffsetFromLayoutObject(parentClipRect.location()
- snappedOffsetFromCompositedAncestor); |
| 821 | 821 |
| 822 // The primary layer is then parented in, and positioned relative to this cl
ipping layer. | 822 // The primary layer is then parented in, and positioned relative to this cl
ipping layer. |
| 823 graphicsLayerParentLocation = parentClipRect.location(); | 823 graphicsLayerParentLocation = parentClipRect.location(); |
| 824 } | 824 } |
| 825 | 825 |
| 826 void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry(const Paint
Layer* compositingStackingContext, const PaintLayer* compositingContainer) | 826 void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry(const Paint
Layer* compositingStackingContext, const PaintLayer* compositingContainer) |
| 827 { | 827 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 FloatPoint clipPositionInLayoutObjectSpace(clippingBox.location() - localCom
positingBounds.location() + roundedIntSize(m_owningLayer.subpixelAccumulation())
); | 867 FloatPoint clipPositionInLayoutObjectSpace(clippingBox.location() - localCom
positingBounds.location() + roundedIntSize(m_owningLayer.subpixelAccumulation())
); |
| 868 | 868 |
| 869 // If there are layers between the the child containment layer and | 869 // If there are layers between the the child containment layer and |
| 870 // m_graphicsLayer (eg, the child transform layer), we must adjust the clip | 870 // m_graphicsLayer (eg, the child transform layer), we must adjust the clip |
| 871 // position to get it in the correct space. | 871 // position to get it in the correct space. |
| 872 FloatPoint clipPositionInParentSpace = clipPositionInLayoutObjectSpace; | 872 FloatPoint clipPositionInParentSpace = clipPositionInLayoutObjectSpace; |
| 873 for (GraphicsLayer* ancestor = m_childContainmentLayer->parent(); ancestor !
= mainGraphicsLayer(); ancestor = ancestor->parent()) | 873 for (GraphicsLayer* ancestor = m_childContainmentLayer->parent(); ancestor !
= mainGraphicsLayer(); ancestor = ancestor->parent()) |
| 874 clipPositionInParentSpace -= toFloatSize(ancestor->position()); | 874 clipPositionInParentSpace -= toFloatSize(ancestor->position()); |
| 875 | 875 |
| 876 m_childContainmentLayer->setPosition(clipPositionInParentSpace); | 876 m_childContainmentLayer->setPosition(clipPositionInParentSpace); |
| 877 m_childContainmentLayer->setSize(clippingBox.size()); | 877 m_childContainmentLayer->setSize(FloatSize(clippingBox.size())); |
| 878 m_childContainmentLayer->setOffsetFromLayoutObject(toIntSize(clippingBox.loc
ation())); | 878 m_childContainmentLayer->setOffsetFromLayoutObject(toIntSize(clippingBox.loc
ation())); |
| 879 if (m_childClippingMaskLayer && !m_scrollingLayer && !layoutObject()->style(
)->clipPath()) { | 879 if (m_childClippingMaskLayer && !m_scrollingLayer && !layoutObject()->style(
)->clipPath()) { |
| 880 m_childClippingMaskLayer->setSize(m_childContainmentLayer->size()); | 880 m_childClippingMaskLayer->setSize(m_childContainmentLayer->size()); |
| 881 m_childClippingMaskLayer->setOffsetFromLayoutObject(m_childContainmentLa
yer->offsetFromLayoutObject()); | 881 m_childClippingMaskLayer->setOffsetFromLayoutObject(m_childContainmentLa
yer->offsetFromLayoutObject()); |
| 882 } | 882 } |
| 883 } | 883 } |
| 884 | 884 |
| 885 void CompositedLayerMapping::updateChildTransformLayerGeometry() | 885 void CompositedLayerMapping::updateChildTransformLayerGeometry() |
| 886 { | 886 { |
| 887 if (!m_childTransformLayer) | 887 if (!m_childTransformLayer) |
| 888 return; | 888 return; |
| 889 const IntRect borderBox = toLayoutBox(m_owningLayer.layoutObject())->pixelSn
appedBorderBoxRect(); | 889 const IntRect borderBox = toLayoutBox(m_owningLayer.layoutObject())->pixelSn
appedBorderBoxRect(); |
| 890 m_childTransformLayer->setSize(borderBox.size()); | 890 m_childTransformLayer->setSize(FloatSize(borderBox.size())); |
| 891 m_childTransformLayer->setPosition(FloatPoint(contentOffsetInCompositingLaye
r())); | 891 m_childTransformLayer->setPosition(FloatPoint(contentOffsetInCompositingLaye
r())); |
| 892 } | 892 } |
| 893 | 893 |
| 894 void CompositedLayerMapping::updateMaskLayerGeometry() | 894 void CompositedLayerMapping::updateMaskLayerGeometry() |
| 895 { | 895 { |
| 896 if (!m_maskLayer) | 896 if (!m_maskLayer) |
| 897 return; | 897 return; |
| 898 | 898 |
| 899 if (m_maskLayer->size() != m_graphicsLayer->size()) { | 899 if (m_maskLayer->size() != m_graphicsLayer->size()) { |
| 900 m_maskLayer->setSize(m_graphicsLayer->size()); | 900 m_maskLayer->setSize(m_graphicsLayer->size()); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 void CompositedLayerMapping::updateScrollingLayerGeometry(const IntRect& localCo
mpositingBounds) | 944 void CompositedLayerMapping::updateScrollingLayerGeometry(const IntRect& localCo
mpositingBounds) |
| 945 { | 945 { |
| 946 if (!m_scrollingLayer) | 946 if (!m_scrollingLayer) |
| 947 return; | 947 return; |
| 948 | 948 |
| 949 ASSERT(m_scrollingContentsLayer); | 949 ASSERT(m_scrollingContentsLayer); |
| 950 LayoutBox* layoutBox = toLayoutBox(layoutObject()); | 950 LayoutBox* layoutBox = toLayoutBox(layoutObject()); |
| 951 IntRect overflowClipRect = enclosingIntRect(layoutBox->overflowClipRect(Layo
utPoint())); | 951 IntRect overflowClipRect = enclosingIntRect(layoutBox->overflowClipRect(Layo
utPoint())); |
| 952 DoubleSize adjustedScrollOffset = m_owningLayer.scrollableArea()->adjustedSc
rollOffset(); | 952 DoubleSize adjustedScrollOffset = m_owningLayer.scrollableArea()->adjustedSc
rollOffset(); |
| 953 m_scrollingLayer->setPosition(FloatPoint(overflowClipRect.location() - local
CompositingBounds.location() + roundedIntSize(m_owningLayer.subpixelAccumulation
()))); | 953 m_scrollingLayer->setPosition(FloatPoint(overflowClipRect.location() - local
CompositingBounds.location() + roundedIntSize(m_owningLayer.subpixelAccumulation
()))); |
| 954 m_scrollingLayer->setSize(overflowClipRect.size()); | 954 m_scrollingLayer->setSize(FloatSize(overflowClipRect.size())); |
| 955 | 955 |
| 956 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromLayoutObject()
; | 956 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromLayoutObject()
; |
| 957 m_scrollingLayer->setOffsetFromLayoutObject(-toIntSize(overflowClipRect.loca
tion())); | 957 m_scrollingLayer->setOffsetFromLayoutObject(-toIntSize(overflowClipRect.loca
tion())); |
| 958 | 958 |
| 959 if (m_childClippingMaskLayer && !layoutObject()->style()->clipPath()) { | 959 if (m_childClippingMaskLayer && !layoutObject()->style()->clipPath()) { |
| 960 m_childClippingMaskLayer->setPosition(m_scrollingLayer->position()); | 960 m_childClippingMaskLayer->setPosition(m_scrollingLayer->position()); |
| 961 m_childClippingMaskLayer->setSize(m_scrollingLayer->size()); | 961 m_childClippingMaskLayer->setSize(m_scrollingLayer->size()); |
| 962 m_childClippingMaskLayer->setOffsetFromLayoutObject(toIntSize(overflowCl
ipRect.location())); | 962 m_childClippingMaskLayer->setOffsetFromLayoutObject(toIntSize(overflowCl
ipRect.location())); |
| 963 } | 963 } |
| 964 | 964 |
| 965 bool overflowClipRectOffsetChanged = oldScrollingLayerOffset != m_scrollingL
ayer->offsetFromLayoutObject(); | 965 bool overflowClipRectOffsetChanged = oldScrollingLayerOffset != m_scrollingL
ayer->offsetFromLayoutObject(); |
| 966 | 966 |
| 967 IntSize scrollSize(layoutBox->scrollWidth(), layoutBox->scrollHeight()); | 967 IntSize scrollSize(layoutBox->scrollWidth(), layoutBox->scrollHeight()); |
| 968 if (scrollSize != m_scrollingContentsLayer->size() || overflowClipRectOffset
Changed) | 968 if (scrollSize != m_scrollingContentsLayer->size() || overflowClipRectOffset
Changed) |
| 969 m_scrollingContentsLayer->setNeedsDisplay(); | 969 m_scrollingContentsLayer->setNeedsDisplay(); |
| 970 | 970 |
| 971 DoubleSize scrollingContentsOffset(overflowClipRect.location().x() - adjuste
dScrollOffset.width(), overflowClipRect.location().y() - adjustedScrollOffset.he
ight()); | 971 DoubleSize scrollingContentsOffset(overflowClipRect.location().x() - adjuste
dScrollOffset.width(), overflowClipRect.location().y() - adjustedScrollOffset.he
ight()); |
| 972 // The scroll offset change is compared using floating point so that fractio
nal scroll offset | 972 // The scroll offset change is compared using floating point so that fractio
nal scroll offset |
| 973 // change can be propagated to compositor. | 973 // change can be propagated to compositor. |
| 974 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetDoubleFromLay
outObject() || scrollSize != m_scrollingContentsLayer->size()) { | 974 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetDoubleFromLay
outObject() || scrollSize != m_scrollingContentsLayer->size()) { |
| 975 bool coordinatorHandlesOffset = compositor()->scrollingLayerDidChange(&m
_owningLayer); | 975 bool coordinatorHandlesOffset = compositor()->scrollingLayerDidChange(&m
_owningLayer); |
| 976 m_scrollingContentsLayer->setPosition(coordinatorHandlesOffset ? FloatPo
int() : FloatPoint(-toFloatSize(adjustedScrollOffset))); | 976 m_scrollingContentsLayer->setPosition(coordinatorHandlesOffset ? FloatPo
int() : FloatPoint(-toFloatSize(adjustedScrollOffset))); |
| 977 } | 977 } |
| 978 | 978 |
| 979 m_scrollingContentsLayer->setSize(scrollSize); | 979 m_scrollingContentsLayer->setSize(FloatSize(scrollSize)); |
| 980 // FIXME: The paint offset and the scroll offset should really be separate c
oncepts. | 980 // FIXME: The paint offset and the scroll offset should really be separate c
oncepts. |
| 981 m_scrollingContentsLayer->setOffsetDoubleFromLayoutObject(scrollingContentsO
ffset, GraphicsLayer::DontSetNeedsDisplay); | 981 m_scrollingContentsLayer->setOffsetDoubleFromLayoutObject(scrollingContentsO
ffset, GraphicsLayer::DontSetNeedsDisplay); |
| 982 | 982 |
| 983 if (m_foregroundLayer) { | 983 if (m_foregroundLayer) { |
| 984 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) | 984 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) |
| 985 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); | 985 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); |
| 986 m_foregroundLayer->setNeedsDisplay(); | 986 m_foregroundLayer->setNeedsDisplay(); |
| 987 m_foregroundLayer->setOffsetFromLayoutObject(m_scrollingContentsLayer->o
ffsetFromLayoutObject()); | 987 m_foregroundLayer->setOffsetFromLayoutObject(m_scrollingContentsLayer->o
ffsetFromLayoutObject()); |
| 988 } | 988 } |
| 989 | 989 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 void CompositedLayerMapping::updateBackgroundLayerGeometry(const FloatSize& rela
tiveCompositingBoundsSize) | 1041 void CompositedLayerMapping::updateBackgroundLayerGeometry(const FloatSize& rela
tiveCompositingBoundsSize) |
| 1042 { | 1042 { |
| 1043 if (!m_backgroundLayer) | 1043 if (!m_backgroundLayer) |
| 1044 return; | 1044 return; |
| 1045 | 1045 |
| 1046 FloatSize backgroundSize = relativeCompositingBoundsSize; | 1046 FloatSize backgroundSize = relativeCompositingBoundsSize; |
| 1047 if (backgroundLayerPaintsFixedRootBackground()) { | 1047 if (backgroundLayerPaintsFixedRootBackground()) { |
| 1048 FrameView* frameView = toLayoutView(layoutObject())->frameView(); | 1048 FrameView* frameView = toLayoutView(layoutObject())->frameView(); |
| 1049 backgroundSize = frameView->visibleContentRect().size(); | 1049 backgroundSize = FloatSize(frameView->visibleContentRect().size()); |
| 1050 } | 1050 } |
| 1051 m_backgroundLayer->setPosition(FloatPoint()); | 1051 m_backgroundLayer->setPosition(FloatPoint()); |
| 1052 if (backgroundSize != m_backgroundLayer->size()) { | 1052 if (backgroundSize != m_backgroundLayer->size()) { |
| 1053 m_backgroundLayer->setSize(backgroundSize); | 1053 m_backgroundLayer->setSize(backgroundSize); |
| 1054 m_backgroundLayer->setNeedsDisplay(); | 1054 m_backgroundLayer->setNeedsDisplay(); |
| 1055 } | 1055 } |
| 1056 m_backgroundLayer->setOffsetFromLayoutObject(m_graphicsLayer->offsetFromLayo
utObject()); | 1056 m_backgroundLayer->setOffsetFromLayoutObject(m_graphicsLayer->offsetFromLayo
utObject()); |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 void CompositedLayerMapping::registerScrollingLayers() | 1059 void CompositedLayerMapping::registerScrollingLayers() |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 const bool shouldDrawContent = !blockSelectionGapsBounds.isEmpty(); | 1201 const bool shouldDrawContent = !blockSelectionGapsBounds.isEmpty(); |
| 1202 m_scrollingBlockSelectionLayer->setDrawsContent(shouldDrawContent); | 1202 m_scrollingBlockSelectionLayer->setDrawsContent(shouldDrawContent); |
| 1203 if (!shouldDrawContent) | 1203 if (!shouldDrawContent) |
| 1204 return; | 1204 return; |
| 1205 // FIXME: Remove the flooredIntSize conversion. crbug.com/414283. | 1205 // FIXME: Remove the flooredIntSize conversion. crbug.com/414283. |
| 1206 const IntPoint position = blockSelectionGapsBounds.location() + flooredIntSi
ze(m_owningLayer.scrollableArea()->adjustedScrollOffset()); | 1206 const IntPoint position = blockSelectionGapsBounds.location() + flooredIntSi
ze(m_owningLayer.scrollableArea()->adjustedScrollOffset()); |
| 1207 if (m_scrollingBlockSelectionLayer->size() == blockSelectionGapsBounds.size(
) && m_scrollingBlockSelectionLayer->position() == position) | 1207 if (m_scrollingBlockSelectionLayer->size() == blockSelectionGapsBounds.size(
) && m_scrollingBlockSelectionLayer->position() == position) |
| 1208 return; | 1208 return; |
| 1209 | 1209 |
| 1210 m_scrollingBlockSelectionLayer->setPosition(position); | 1210 m_scrollingBlockSelectionLayer->setPosition(position); |
| 1211 m_scrollingBlockSelectionLayer->setSize(blockSelectionGapsBounds.size()); | 1211 m_scrollingBlockSelectionLayer->setSize(FloatSize(blockSelectionGapsBounds.s
ize())); |
| 1212 m_scrollingBlockSelectionLayer->setOffsetFromLayoutObject(toIntSize(blockSel
ectionGapsBounds.location()), GraphicsLayer::SetNeedsDisplay); | 1212 m_scrollingBlockSelectionLayer->setOffsetFromLayoutObject(toIntSize(blockSel
ectionGapsBounds.location()), GraphicsLayer::SetNeedsDisplay); |
| 1213 } | 1213 } |
| 1214 | 1214 |
| 1215 void CompositedLayerMapping::updateDrawsContent() | 1215 void CompositedLayerMapping::updateDrawsContent() |
| 1216 { | 1216 { |
| 1217 bool hasPaintedContent = containsPaintedContent(); | 1217 bool hasPaintedContent = containsPaintedContent(); |
| 1218 m_graphicsLayer->setDrawsContent(hasPaintedContent); | 1218 m_graphicsLayer->setDrawsContent(hasPaintedContent); |
| 1219 | 1219 |
| 1220 if (m_scrollingLayer) { | 1220 if (m_scrollingLayer) { |
| 1221 // m_scrollingLayer never has backing store. | 1221 // m_scrollingLayer never has backing store. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 return horizontalScrollbarLayerChanged || verticalScrollbarLayerChanged || s
crollCornerLayerChanged; | 1357 return horizontalScrollbarLayerChanged || verticalScrollbarLayerChanged || s
crollCornerLayerChanged; |
| 1358 } | 1358 } |
| 1359 | 1359 |
| 1360 void CompositedLayerMapping::positionOverflowControlsLayers() | 1360 void CompositedLayerMapping::positionOverflowControlsLayers() |
| 1361 { | 1361 { |
| 1362 IntSize offsetFromLayoutObject = m_graphicsLayer->offsetFromLayoutObject() -
roundedIntSize(m_owningLayer.subpixelAccumulation()); | 1362 IntSize offsetFromLayoutObject = m_graphicsLayer->offsetFromLayoutObject() -
roundedIntSize(m_owningLayer.subpixelAccumulation()); |
| 1363 if (GraphicsLayer* layer = layerForHorizontalScrollbar()) { | 1363 if (GraphicsLayer* layer = layerForHorizontalScrollbar()) { |
| 1364 Scrollbar* hBar = m_owningLayer.scrollableArea()->horizontalScrollbar(); | 1364 Scrollbar* hBar = m_owningLayer.scrollableArea()->horizontalScrollbar(); |
| 1365 if (hBar) { | 1365 if (hBar) { |
| 1366 layer->setPosition(hBar->frameRect().location() - offsetFromLayoutOb
ject); | 1366 layer->setPosition(hBar->frameRect().location() - offsetFromLayoutOb
ject); |
| 1367 layer->setSize(hBar->frameRect().size()); | 1367 layer->setSize(FloatSize(hBar->frameRect().size())); |
| 1368 if (layer->hasContentsLayer()) | 1368 if (layer->hasContentsLayer()) |
| 1369 layer->setContentsRect(IntRect(IntPoint(), hBar->frameRect().siz
e())); | 1369 layer->setContentsRect(IntRect(IntPoint(), hBar->frameRect().siz
e())); |
| 1370 } | 1370 } |
| 1371 layer->setDrawsContent(hBar && !layer->hasContentsLayer()); | 1371 layer->setDrawsContent(hBar && !layer->hasContentsLayer()); |
| 1372 } | 1372 } |
| 1373 | 1373 |
| 1374 if (GraphicsLayer* layer = layerForVerticalScrollbar()) { | 1374 if (GraphicsLayer* layer = layerForVerticalScrollbar()) { |
| 1375 Scrollbar* vBar = m_owningLayer.scrollableArea()->verticalScrollbar(); | 1375 Scrollbar* vBar = m_owningLayer.scrollableArea()->verticalScrollbar(); |
| 1376 if (vBar) { | 1376 if (vBar) { |
| 1377 layer->setPosition(vBar->frameRect().location() - offsetFromLayoutOb
ject); | 1377 layer->setPosition(vBar->frameRect().location() - offsetFromLayoutOb
ject); |
| 1378 layer->setSize(vBar->frameRect().size()); | 1378 layer->setSize(FloatSize(vBar->frameRect().size())); |
| 1379 if (layer->hasContentsLayer()) | 1379 if (layer->hasContentsLayer()) |
| 1380 layer->setContentsRect(IntRect(IntPoint(), vBar->frameRect().siz
e())); | 1380 layer->setContentsRect(IntRect(IntPoint(), vBar->frameRect().siz
e())); |
| 1381 } | 1381 } |
| 1382 layer->setDrawsContent(vBar && !layer->hasContentsLayer()); | 1382 layer->setDrawsContent(vBar && !layer->hasContentsLayer()); |
| 1383 } | 1383 } |
| 1384 | 1384 |
| 1385 if (GraphicsLayer* layer = layerForScrollCorner()) { | 1385 if (GraphicsLayer* layer = layerForScrollCorner()) { |
| 1386 const IntRect& scrollCornerAndResizer = m_owningLayer.scrollableArea()->
scrollCornerAndResizerRect(); | 1386 const IntRect& scrollCornerAndResizer = m_owningLayer.scrollableArea()->
scrollCornerAndResizerRect(); |
| 1387 layer->setPosition(FloatPoint(scrollCornerAndResizer.location() - offset
FromLayoutObject)); | 1387 layer->setPosition(FloatPoint(scrollCornerAndResizer.location() - offset
FromLayoutObject)); |
| 1388 layer->setSize(FloatSize(scrollCornerAndResizer.size())); | 1388 layer->setSize(FloatSize(scrollCornerAndResizer.size())); |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2511 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2511 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
| 2512 name = "Scrolling Block Selection Layer"; | 2512 name = "Scrolling Block Selection Layer"; |
| 2513 } else { | 2513 } else { |
| 2514 ASSERT_NOT_REACHED(); | 2514 ASSERT_NOT_REACHED(); |
| 2515 } | 2515 } |
| 2516 | 2516 |
| 2517 return name; | 2517 return name; |
| 2518 } | 2518 } |
| 2519 | 2519 |
| 2520 } // namespace blink | 2520 } // namespace blink |
| OLD | NEW |