| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 void* operator new(size_t); | 351 void* operator new(size_t); |
| 352 // Only safe to call from RenderLayerModelObject::destroyLayer() | 352 // Only safe to call from RenderLayerModelObject::destroyLayer() |
| 353 void operator delete(void*); | 353 void operator delete(void*); |
| 354 | 354 |
| 355 CompositingState compositingState() const; | 355 CompositingState compositingState() const; |
| 356 | 356 |
| 357 // This returns true if our document is in a phase of its lifestyle during w
hich | 357 // This returns true if our document is in a phase of its lifestyle during w
hich |
| 358 // compositing state may legally be read. | 358 // compositing state may legally be read. |
| 359 bool isAllowedToQueryCompositingState() const; | 359 bool isAllowedToQueryCompositingState() const; |
| 360 | 360 |
| 361 // This returns true if our current phase is the compositing update. |
| 362 bool isInCompositingUpdate() const; |
| 363 |
| 361 CompositedLayerMappingPtr compositedLayerMapping() const; | 364 CompositedLayerMappingPtr compositedLayerMapping() const; |
| 362 CompositedLayerMappingPtr ensureCompositedLayerMapping(); | 365 CompositedLayerMappingPtr ensureCompositedLayerMapping(); |
| 363 | 366 |
| 364 // NOTE: If you are using hasCompositedLayerMapping to determine the state o
f compositing for this layer, | 367 // NOTE: If you are using hasCompositedLayerMapping to determine the state o
f compositing for this layer, |
| 365 // (and not just to do bookkeeping related to the mapping like, say, allocat
ing or deallocating a mapping), | 368 // (and not just to do bookkeeping related to the mapping like, say, allocat
ing or deallocating a mapping), |
| 366 // then you may have incorrect logic. Use compositingState() instead. | 369 // then you may have incorrect logic. Use compositingState() instead. |
| 367 bool hasCompositedLayerMapping() const { return m_compositedLayerMapping.get
(); } | 370 bool hasCompositedLayerMapping() const { return m_compositedLayerMapping.get
(); } |
| 368 void clearCompositedLayerMapping(bool layerBeingDestroyed = false); | 371 void clearCompositedLayerMapping(bool layerBeingDestroyed = false); |
| 369 | 372 |
| 370 CompositedLayerMapping* groupedMapping() const { return m_groupedMapping; } | 373 CompositedLayerMapping* groupedMapping() const { return m_groupedMapping; } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 475 |
| 473 RenderLayerBlendInfo& blendInfo() { return m_blendInfo; } | 476 RenderLayerBlendInfo& blendInfo() { return m_blendInfo; } |
| 474 | 477 |
| 475 void setOffsetFromSquashingLayerOrigin(IntSize offset) { m_compositingProper
ties.offsetFromSquashingLayerOrigin = offset; } | 478 void setOffsetFromSquashingLayerOrigin(IntSize offset) { m_compositingProper
ties.offsetFromSquashingLayerOrigin = offset; } |
| 476 IntSize offsetFromSquashingLayerOrigin() const { return m_compositingPropert
ies.offsetFromSquashingLayerOrigin; } | 479 IntSize offsetFromSquashingLayerOrigin() const { return m_compositingPropert
ies.offsetFromSquashingLayerOrigin; } |
| 477 | 480 |
| 478 bool scrollsOverflow() const; | 481 bool scrollsOverflow() const; |
| 479 | 482 |
| 480 bool hasDirectReasonsForCompositing() const { return compositingReasons() &
CompositingReasonComboAllDirectReasons; } | 483 bool hasDirectReasonsForCompositing() const { return compositingReasons() &
CompositingReasonComboAllDirectReasons; } |
| 481 | 484 |
| 485 void clearAncestorDependentPropertyCache() { m_ancestorDependentPropertyCach
e.clear(); } |
| 486 |
| 482 private: | 487 private: |
| 488 struct AncestorDependentPropertyCache { |
| 489 AncestorDependentPropertyCache(); |
| 490 RenderObject* containingBlock; |
| 491 RenderLayer* ancestorCompositedScrollingLayer; |
| 492 RenderLayer* scrollParent; |
| 493 }; |
| 494 |
| 483 bool hasOverflowControls() const; | 495 bool hasOverflowControls() const; |
| 484 | 496 |
| 485 void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDes
cendant = isUnclippedDescendant; } | 497 void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDes
cendant = isUnclippedDescendant; } |
| 486 | 498 |
| 487 void setAncestorChainHasSelfPaintingLayerDescendant(); | 499 void setAncestorChainHasSelfPaintingLayerDescendant(); |
| 488 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 500 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| 489 | 501 |
| 490 void setAncestorChainHasOutOfFlowPositionedDescendant(); | 502 void setAncestorChainHasOutOfFlowPositionedDescendant(); |
| 491 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); | 503 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); |
| 492 | 504 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 | 583 |
| 572 bool hitTestContents(const HitTestRequest&, HitTestResult&, const LayoutRect
& layerBounds, const HitTestLocation&, HitTestFilter) const; | 584 bool hitTestContents(const HitTestRequest&, HitTestResult&, const LayoutRect
& layerBounds, const HitTestLocation&, HitTestFilter) const; |
| 573 bool hitTestContentsForFragments(const LayerFragments&, const HitTestRequest
&, HitTestResult&, const HitTestLocation&, HitTestFilter, bool& insideClipRect)
const; | 585 bool hitTestContentsForFragments(const LayerFragments&, const HitTestRequest
&, HitTestResult&, const HitTestLocation&, HitTestFilter, bool& insideClipRect)
const; |
| 574 RenderLayer* hitTestTransformedLayerInFragments(RenderLayer* rootLayer, Rend
erLayer* containerLayer, const HitTestRequest&, HitTestResult&, | 586 RenderLayer* hitTestTransformedLayerInFragments(RenderLayer* rootLayer, Rend
erLayer* containerLayer, const HitTestRequest&, HitTestResult&, |
| 575 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0); | 587 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0); |
| 576 | 588 |
| 577 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; | 589 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; |
| 578 | 590 |
| 579 bool shouldBeSelfPaintingLayer() const; | 591 bool shouldBeSelfPaintingLayer() const; |
| 580 | 592 |
| 581 private: | |
| 582 // FIXME: We should only create the stacking node if needed. | 593 // FIXME: We should only create the stacking node if needed. |
| 583 bool requiresStackingNode() const { return true; } | 594 bool requiresStackingNode() const { return true; } |
| 584 void updateStackingNode(); | 595 void updateStackingNode(); |
| 585 | 596 |
| 586 void updateReflectionInfo(const RenderStyle*); | 597 void updateReflectionInfo(const RenderStyle*); |
| 587 | 598 |
| 588 // FIXME: We could lazily allocate our ScrollableArea based on style propert
ies ('overflow', ...) | 599 // FIXME: We could lazily allocate our ScrollableArea based on style propert
ies ('overflow', ...) |
| 589 // but for now, we are always allocating it for RenderBox as it's safer. | 600 // but for now, we are always allocating it for RenderBox as it's safer. |
| 590 bool requiresScrollableArea() const { return renderBox(); } | 601 bool requiresScrollableArea() const { return renderBox(); } |
| 591 void updateScrollableArea(); | 602 void updateScrollableArea(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 bool lostGroupedMapping() const { return m_compositingProperties.lostGrouped
Mapping; } | 634 bool lostGroupedMapping() const { return m_compositingProperties.lostGrouped
Mapping; } |
| 624 void setLostGroupedMapping(bool b) { m_compositingProperties.lostGroupedMapp
ing = b; } | 635 void setLostGroupedMapping(bool b) { m_compositingProperties.lostGroupedMapp
ing = b; } |
| 625 | 636 |
| 626 void setCompositingReasons(CompositingReasons); | 637 void setCompositingReasons(CompositingReasons); |
| 627 CompositingReasons compositingReasons() const { return m_compositingProperti
es.compositingReasons; } | 638 CompositingReasons compositingReasons() const { return m_compositingProperti
es.compositingReasons; } |
| 628 | 639 |
| 629 friend class CompositedLayerMapping; | 640 friend class CompositedLayerMapping; |
| 630 friend class RenderLayerCompositor; | 641 friend class RenderLayerCompositor; |
| 631 friend class RenderLayerModelObject; | 642 friend class RenderLayerModelObject; |
| 632 | 643 |
| 633 private: | |
| 634 LayerType m_layerType; | 644 LayerType m_layerType; |
| 635 | 645 |
| 636 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting | 646 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting |
| 637 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. | 647 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. |
| 638 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. | 648 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. |
| 639 unsigned m_isSelfPaintingLayer : 1; | 649 unsigned m_isSelfPaintingLayer : 1; |
| 640 | 650 |
| 641 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to | 651 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to |
| 642 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). | 652 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). |
| 643 unsigned m_hasSelfPaintingLayerDescendant : 1; | 653 unsigned m_hasSelfPaintingLayerDescendant : 1; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 IntSize offsetFromSquashingLayerOrigin; | 759 IntSize offsetFromSquashingLayerOrigin; |
| 750 }; | 760 }; |
| 751 | 761 |
| 752 CompositingProperties m_compositingProperties; | 762 CompositingProperties m_compositingProperties; |
| 753 | 763 |
| 754 IntRect m_blockSelectionGapsBounds; | 764 IntRect m_blockSelectionGapsBounds; |
| 755 | 765 |
| 756 OwnPtr<CompositedLayerMapping> m_compositedLayerMapping; | 766 OwnPtr<CompositedLayerMapping> m_compositedLayerMapping; |
| 757 OwnPtr<RenderLayerScrollableArea> m_scrollableArea; | 767 OwnPtr<RenderLayerScrollableArea> m_scrollableArea; |
| 758 | 768 |
| 769 OwnPtr<AncestorDependentPropertyCache> m_ancestorDependentPropertyCache; |
| 770 |
| 759 CompositedLayerMapping* m_groupedMapping; | 771 CompositedLayerMapping* m_groupedMapping; |
| 760 | 772 |
| 761 RenderLayerRepainter m_repainter; | 773 RenderLayerRepainter m_repainter; |
| 762 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? | 774 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? |
| 763 OwnPtr<RenderLayerStackingNode> m_stackingNode; | 775 OwnPtr<RenderLayerStackingNode> m_stackingNode; |
| 764 OwnPtr<RenderLayerReflectionInfo> m_reflectionInfo; | 776 OwnPtr<RenderLayerReflectionInfo> m_reflectionInfo; |
| 765 RenderLayerBlendInfo m_blendInfo; | 777 RenderLayerBlendInfo m_blendInfo; |
| 766 }; | 778 }; |
| 767 | 779 |
| 768 } // namespace WebCore | 780 } // namespace WebCore |
| 769 | 781 |
| 770 #ifndef NDEBUG | 782 #ifndef NDEBUG |
| 771 // Outside the WebCore namespace for ease of invocation from gdb. | 783 // Outside the WebCore namespace for ease of invocation from gdb. |
| 772 void showLayerTree(const WebCore::RenderLayer*); | 784 void showLayerTree(const WebCore::RenderLayer*); |
| 773 void showLayerTree(const WebCore::RenderObject*); | 785 void showLayerTree(const WebCore::RenderObject*); |
| 774 #endif | 786 #endif |
| 775 | 787 |
| 776 #endif // RenderLayer_h | 788 #endif // RenderLayer_h |
| OLD | NEW |