OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 LayoutRect rect() const { return LayoutRect(location(), LayoutSize(size()));
} | 262 LayoutRect rect() const { return LayoutRect(location(), LayoutSize(size()));
} |
263 | 263 |
264 bool isRootLayer() const { return m_isRootLayer; } | 264 bool isRootLayer() const { return m_isRootLayer; } |
265 | 265 |
266 PaintLayerCompositor* compositor() const; | 266 PaintLayerCompositor* compositor() const; |
267 | 267 |
268 // Notification from the layoutObject that its content changed (e.g. current
frame of image changed). | 268 // Notification from the layoutObject that its content changed (e.g. current
frame of image changed). |
269 // Allows updates of layer content without invalidating paint. | 269 // Allows updates of layer content without invalidating paint. |
270 void contentChanged(ContentChangeType); | 270 void contentChanged(ContentChangeType); |
271 | 271 |
| 272 void updateLayerPosition(); |
| 273 |
272 void updateLayerPositionsAfterLayout(); | 274 void updateLayerPositionsAfterLayout(); |
273 void updateLayerPositionsAfterOverflowScroll(const DoubleSize& scrollDelta); | 275 void updateLayerPositionsAfterOverflowScroll(const DoubleSize& scrollDelta); |
274 | 276 |
275 PaintLayer* enclosingPaginationLayer() const { return m_rareData ? m_rareDat
a->enclosingPaginationLayer : nullptr; } | 277 PaintLayer* enclosingPaginationLayer() const { return m_rareData ? m_rareDat
a->enclosingPaginationLayer : nullptr; } |
276 | 278 |
277 void updateTransformationMatrix(); | 279 void updateTransformationMatrix(); |
278 PaintLayer* renderingContextRoot(); | 280 PaintLayer* renderingContextRoot(); |
279 const PaintLayer* renderingContextRoot() const; | 281 const PaintLayer* renderingContextRoot() const; |
280 | 282 |
281 LayoutSize offsetForInFlowPosition() const { return m_rareData ? m_rareData-
>offsetForInFlowPosition : LayoutSize(); } | 283 LayoutSize offsetForInFlowPosition() const { return m_rareData ? m_rareData-
>offsetForInFlowPosition : LayoutSize(); } |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 , nearestFixedPositionLayer(nullptr) | 539 , nearestFixedPositionLayer(nullptr) |
538 , scrollParent(nullptr) | 540 , scrollParent(nullptr) |
539 , clipParent(nullptr) | 541 , clipParent(nullptr) |
540 { } | 542 { } |
541 | 543 |
542 bool isDefault() const { return !opacityAncestor && !transformAncestor &
& !filterAncestor && !ancestorScrollingLayer && !nearestFixedPositionLayer && !s
crollParent && !clipParent; } | 544 bool isDefault() const { return !opacityAncestor && !transformAncestor &
& !filterAncestor && !ancestorScrollingLayer && !nearestFixedPositionLayer && !s
crollParent && !clipParent; } |
543 | 545 |
544 const PaintLayer* opacityAncestor; | 546 const PaintLayer* opacityAncestor; |
545 const PaintLayer* transformAncestor; | 547 const PaintLayer* transformAncestor; |
546 const PaintLayer* filterAncestor; | 548 const PaintLayer* filterAncestor; |
| 549 |
| 550 // The fist ancestor which can scroll. This is a subset of the |
| 551 // ancestorOverflowLayer chain where the scrolling layer is visible and |
| 552 // has a larger scroll content than its bounds. |
547 const PaintLayer* ancestorScrollingLayer; | 553 const PaintLayer* ancestorScrollingLayer; |
548 const PaintLayer* nearestFixedPositionLayer; | 554 const PaintLayer* nearestFixedPositionLayer; |
549 | 555 |
550 // A scroll parent is a compositor concept. It's only needed in blink | 556 // A scroll parent is a compositor concept. It's only needed in blink |
551 // because we need to use it as a promotion trigger. A layer has a | 557 // because we need to use it as a promotion trigger. A layer has a |
552 // scroll parent if neither its compositor scrolling ancestor, nor any | 558 // scroll parent if neither its compositor scrolling ancestor, nor any |
553 // other layer scrolled by this ancestor, is a stacking ancestor of this | 559 // other layer scrolled by this ancestor, is a stacking ancestor of this |
554 // layer. Layers with scroll parents must be scrolled with the main | 560 // layer. Layers with scroll parents must be scrolled with the main |
555 // scrolling layer by the compositor. | 561 // scrolling layer by the compositor. |
556 const PaintLayer* scrollParent; | 562 const PaintLayer* scrollParent; |
557 | 563 |
558 // A clip parent is another compositor concept that has leaked into | 564 // A clip parent is another compositor concept that has leaked into |
559 // blink so that it may be used as a promotion trigger. Layers with clip | 565 // blink so that it may be used as a promotion trigger. Layers with clip |
560 // parents escape the clip of a stacking tree ancestor. The compositor | 566 // parents escape the clip of a stacking tree ancestor. The compositor |
561 // needs to know about clip parents in order to circumvent its normal | 567 // needs to know about clip parents in order to circumvent its normal |
562 // clipping logic. | 568 // clipping logic. |
563 const PaintLayer* clipParent; | 569 const PaintLayer* clipParent; |
564 }; | 570 }; |
565 | 571 |
566 void setNeedsCompositingInputsUpdate(); | 572 void setNeedsCompositingInputsUpdate(); |
567 bool childNeedsCompositingInputsUpdate() const { return m_childNeedsComposit
ingInputsUpdate; } | 573 bool childNeedsCompositingInputsUpdate() const { return m_childNeedsComposit
ingInputsUpdate; } |
568 bool needsCompositingInputsUpdate() const | 574 bool needsCompositingInputsUpdate() const |
569 { | 575 { |
570 // While we're updating the compositing inputs, these values may differ. | 576 // While we're updating the compositing inputs, these values may differ. |
571 // We should never be asking for this value when that is the case. | 577 // We should never be asking for this value when that is the case. |
572 ASSERT(m_needsDescendantDependentCompositingInputsUpdate == m_needsAnces
torDependentCompositingInputsUpdate); | 578 ASSERT(m_needsDescendantDependentCompositingInputsUpdate == m_needsAnces
torDependentCompositingInputsUpdate); |
573 return m_needsDescendantDependentCompositingInputsUpdate; | 579 return m_needsDescendantDependentCompositingInputsUpdate; |
574 } | 580 } |
575 | 581 |
| 582 void updateAncestorOverflowLayer(const PaintLayer* ancestorOverflowLayer) {
m_ancestorOverflowLayer = ancestorOverflowLayer; } |
576 void updateAncestorDependentCompositingInputs(const AncestorDependentComposi
tingInputs&, const RareAncestorDependentCompositingInputs&, bool hasAncestorWith
ClipPath); | 583 void updateAncestorDependentCompositingInputs(const AncestorDependentComposi
tingInputs&, const RareAncestorDependentCompositingInputs&, bool hasAncestorWith
ClipPath); |
577 void updateDescendantDependentCompositingInputs(bool hasDescendantWithClipPa
th, bool hasNonIsolatedDescendantWithBlendMode); | 584 void updateDescendantDependentCompositingInputs(bool hasDescendantWithClipPa
th, bool hasNonIsolatedDescendantWithBlendMode); |
578 void didUpdateCompositingInputs(); | 585 void didUpdateCompositingInputs(); |
579 | 586 |
580 IntRect clippedAbsoluteBoundingBox() const { ASSERT(!m_needsAncestorDependen
tCompositingInputsUpdate); return m_ancestorDependentCompositingInputs.clippedAb
soluteBoundingBox; } | 587 IntRect clippedAbsoluteBoundingBox() const { ASSERT(!m_needsAncestorDependen
tCompositingInputsUpdate); return m_ancestorDependentCompositingInputs.clippedAb
soluteBoundingBox; } |
581 const PaintLayer* opacityAncestor() const { ASSERT(!m_needsAncestorDependent
CompositingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_ra
reAncestorDependentCompositingInputs->opacityAncestor : nullptr; } | 588 const PaintLayer* opacityAncestor() const { ASSERT(!m_needsAncestorDependent
CompositingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_ra
reAncestorDependentCompositingInputs->opacityAncestor : nullptr; } |
582 const PaintLayer* transformAncestor() const { ASSERT(!m_needsAncestorDepende
ntCompositingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_
rareAncestorDependentCompositingInputs->transformAncestor : nullptr; } | 589 const PaintLayer* transformAncestor() const { ASSERT(!m_needsAncestorDepende
ntCompositingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_
rareAncestorDependentCompositingInputs->transformAncestor : nullptr; } |
583 const PaintLayer* filterAncestor() const { ASSERT(!m_needsAncestorDependentC
ompositingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_rar
eAncestorDependentCompositingInputs->filterAncestor : nullptr; } | 590 const PaintLayer* filterAncestor() const { ASSERT(!m_needsAncestorDependentC
ompositingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_rar
eAncestorDependentCompositingInputs->filterAncestor : nullptr; } |
584 const LayoutObject* clippingContainer() const { ASSERT(!m_needsAncestorDepen
dentCompositingInputsUpdate); return m_ancestorDependentCompositingInputs.clippi
ngContainer; } | 591 const LayoutObject* clippingContainer() const { ASSERT(!m_needsAncestorDepen
dentCompositingInputsUpdate); return m_ancestorDependentCompositingInputs.clippi
ngContainer; } |
| 592 const PaintLayer* ancestorOverflowLayer() const { return m_ancestorOverflowL
ayer; } |
585 const PaintLayer* ancestorScrollingLayer() const { ASSERT(!m_needsAncestorDe
pendentCompositingInputsUpdate); return m_rareAncestorDependentCompositingInputs
? m_rareAncestorDependentCompositingInputs->ancestorScrollingLayer : nullptr; } | 593 const PaintLayer* ancestorScrollingLayer() const { ASSERT(!m_needsAncestorDe
pendentCompositingInputsUpdate); return m_rareAncestorDependentCompositingInputs
? m_rareAncestorDependentCompositingInputs->ancestorScrollingLayer : nullptr; } |
586 const PaintLayer* nearestFixedPositionLayer() const { ASSERT(!m_needsAncesto
rDependentCompositingInputsUpdate); return m_rareAncestorDependentCompositingInp
uts ? m_rareAncestorDependentCompositingInputs->nearestFixedPositionLayer : null
ptr; } | 594 const PaintLayer* nearestFixedPositionLayer() const { ASSERT(!m_needsAncesto
rDependentCompositingInputsUpdate); return m_rareAncestorDependentCompositingInp
uts ? m_rareAncestorDependentCompositingInputs->nearestFixedPositionLayer : null
ptr; } |
587 const PaintLayer* scrollParent() const { ASSERT(!m_needsAncestorDependentCom
positingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_rareA
ncestorDependentCompositingInputs->scrollParent : nullptr; } | 595 const PaintLayer* scrollParent() const { ASSERT(!m_needsAncestorDependentCom
positingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_rareA
ncestorDependentCompositingInputs->scrollParent : nullptr; } |
588 const PaintLayer* clipParent() const { ASSERT(!m_needsAncestorDependentCompo
sitingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_rareAnc
estorDependentCompositingInputs->clipParent : nullptr; } | 596 const PaintLayer* clipParent() const { ASSERT(!m_needsAncestorDependentCompo
sitingInputsUpdate); return m_rareAncestorDependentCompositingInputs ? m_rareAnc
estorDependentCompositingInputs->clipParent : nullptr; } |
589 bool hasAncestorWithClipPath() const { ASSERT(!m_needsAncestorDependentCompo
sitingInputsUpdate); return m_hasAncestorWithClipPath; } | 597 bool hasAncestorWithClipPath() const { ASSERT(!m_needsAncestorDependentCompo
sitingInputsUpdate); return m_hasAncestorWithClipPath; } |
590 bool hasDescendantWithClipPath() const { ASSERT(!m_needsDescendantDependentC
ompositingInputsUpdate); return m_hasDescendantWithClipPath; } | 598 bool hasDescendantWithClipPath() const { ASSERT(!m_needsDescendantDependentC
ompositingInputsUpdate); return m_hasDescendantWithClipPath; } |
591 bool hasNonIsolatedDescendantWithBlendMode() const; | 599 bool hasNonIsolatedDescendantWithBlendMode() const; |
592 | 600 |
593 bool lostGroupedMapping() const { ASSERT(isAllowedToQueryCompositingState())
; return m_lostGroupedMapping; } | 601 bool lostGroupedMapping() const { ASSERT(isAllowedToQueryCompositingState())
; return m_lostGroupedMapping; } |
594 void setLostGroupedMapping(bool b) { m_lostGroupedMapping = b; } | 602 void setLostGroupedMapping(bool b) { m_lostGroupedMapping = b; } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 void clearClipRectsCache() const { m_clipRectsCache.clear(); } | 700 void clearClipRectsCache() const { m_clipRectsCache.clear(); } |
693 | 701 |
694 private: | 702 private: |
695 // Bounding box in the coordinates of this layer. | 703 // Bounding box in the coordinates of this layer. |
696 LayoutRect logicalBoundingBox() const; | 704 LayoutRect logicalBoundingBox() const; |
697 | 705 |
698 bool hasOverflowControls() const; | 706 bool hasOverflowControls() const; |
699 | 707 |
700 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 708 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
701 | 709 |
702 // Returns true if the position changed. | |
703 bool updateLayerPosition(); | |
704 | |
705 void updateLayerPositionRecursive(); | 710 void updateLayerPositionRecursive(); |
706 void updateLayerPositionsAfterScrollRecursive(const DoubleSize& scrollDelta,
bool paintInvalidationContainerWasScrolled); | 711 void updateLayerPositionsAfterScrollRecursive(const DoubleSize& scrollDelta,
bool paintInvalidationContainerWasScrolled); |
707 | 712 |
708 void setNextSibling(PaintLayer* next) { m_next = next; } | 713 void setNextSibling(PaintLayer* next) { m_next = next; } |
709 void setPreviousSibling(PaintLayer* prev) { m_previous = prev; } | 714 void setPreviousSibling(PaintLayer* prev) { m_previous = prev; } |
710 void setFirstChild(PaintLayer* first) { m_first = first; } | 715 void setFirstChild(PaintLayer* first) { m_first = first; } |
711 void setLastChild(PaintLayer* last) { m_last = last; } | 716 void setLastChild(PaintLayer* last) { m_last = last; } |
712 | 717 |
713 void updateHasSelfPaintingLayerDescendant() const; | 718 void updateHasSelfPaintingLayerDescendant() const; |
714 PaintLayer* hitTestLayer(PaintLayer* rootLayer, PaintLayer* containerLayer,
HitTestResult&, | 719 PaintLayer* hitTestLayer(PaintLayer* rootLayer, PaintLayer* containerLayer,
HitTestResult&, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 // The layer's size. | 854 // The layer's size. |
850 // | 855 // |
851 // If the associated LayoutBoxModelObject is a LayoutBox, it's its border | 856 // If the associated LayoutBoxModelObject is a LayoutBox, it's its border |
852 // box. Otherwise, this is the LayoutInline's lines' bounding box. | 857 // box. Otherwise, this is the LayoutInline's lines' bounding box. |
853 IntSize m_size; | 858 IntSize m_size; |
854 | 859 |
855 // Cached normal flow values for absolute positioned elements with static le
ft/top values. | 860 // Cached normal flow values for absolute positioned elements with static le
ft/top values. |
856 LayoutUnit m_staticInlinePosition; | 861 LayoutUnit m_staticInlinePosition; |
857 LayoutUnit m_staticBlockPosition; | 862 LayoutUnit m_staticBlockPosition; |
858 | 863 |
| 864 // The first ancestor having a non visible overflow. |
| 865 const PaintLayer* m_ancestorOverflowLayer; |
| 866 |
859 AncestorDependentCompositingInputs m_ancestorDependentCompositingInputs; | 867 AncestorDependentCompositingInputs m_ancestorDependentCompositingInputs; |
860 OwnPtr<RareAncestorDependentCompositingInputs> m_rareAncestorDependentCompos
itingInputs; | 868 OwnPtr<RareAncestorDependentCompositingInputs> m_rareAncestorDependentCompos
itingInputs; |
861 | 869 |
862 OwnPtrWillBePersistent<PaintLayerScrollableArea> m_scrollableArea; | 870 OwnPtrWillBePersistent<PaintLayerScrollableArea> m_scrollableArea; |
863 | 871 |
864 mutable OwnPtr<ClipRectsCache> m_clipRectsCache; | 872 mutable OwnPtr<ClipRectsCache> m_clipRectsCache; |
865 | 873 |
866 OwnPtr<PaintLayerStackingNode> m_stackingNode; | 874 OwnPtr<PaintLayerStackingNode> m_stackingNode; |
867 | 875 |
868 IntSize m_previousScrollOffsetAccumulationForPainting; | 876 IntSize m_previousScrollOffsetAccumulationForPainting; |
869 RefPtr<ClipRects> m_previousPaintingClipRects; | 877 RefPtr<ClipRects> m_previousPaintingClipRects; |
870 LayoutRect m_previousPaintDirtyRect; | 878 LayoutRect m_previousPaintDirtyRect; |
871 | 879 |
872 OwnPtr<PaintLayerRareData> m_rareData; | 880 OwnPtr<PaintLayerRareData> m_rareData; |
873 }; | 881 }; |
874 | 882 |
875 } // namespace blink | 883 } // namespace blink |
876 | 884 |
877 #ifndef NDEBUG | 885 #ifndef NDEBUG |
878 // Outside the WebCore namespace for ease of invocation from gdb. | 886 // Outside the WebCore namespace for ease of invocation from gdb. |
879 void showLayerTree(const blink::PaintLayer*); | 887 void showLayerTree(const blink::PaintLayer*); |
880 void showLayerTree(const blink::LayoutObject*); | 888 void showLayerTree(const blink::LayoutObject*); |
881 #endif | 889 #endif |
882 | 890 |
883 #endif // Layer_h | 891 #endif // Layer_h |
OLD | NEW |