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(); |
| 486 |
482 private: | 487 private: |
| 488 class AncestorDependentPropertyCache { |
| 489 WTF_MAKE_NONCOPYABLE(AncestorDependentPropertyCache); |
| 490 public: |
| 491 AncestorDependentPropertyCache(); |
| 492 |
| 493 RenderLayer* ancestorCompositedScrollingLayer() const; |
| 494 void setAncestorCompositedScrollingLayer(RenderLayer*); |
| 495 |
| 496 RenderLayer* scrollParent() const; |
| 497 void setScrollParent(RenderLayer*); |
| 498 |
| 499 bool ancestorCompositedScrollingLayerDirty() const { return m_ancestorCo
mpositedScrollingLayerDirty; } |
| 500 bool scrollParentDirty() const { return m_scrollParentDirty; } |
| 501 |
| 502 private: |
| 503 RenderLayer* m_ancestorCompositedScrollingLayer; |
| 504 RenderLayer* m_scrollParent; |
| 505 |
| 506 bool m_ancestorCompositedScrollingLayerDirty; |
| 507 bool m_scrollParentDirty; |
| 508 }; |
| 509 |
| 510 void ensureAncestorDependentPropertyCache() const; |
| 511 |
483 bool hasOverflowControls() const; | 512 bool hasOverflowControls() const; |
484 | 513 |
485 void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDes
cendant = isUnclippedDescendant; } | 514 void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDes
cendant = isUnclippedDescendant; } |
486 | 515 |
487 void setAncestorChainHasSelfPaintingLayerDescendant(); | 516 void setAncestorChainHasSelfPaintingLayerDescendant(); |
488 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 517 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
489 | 518 |
490 void setAncestorChainHasOutOfFlowPositionedDescendant(); | 519 void setAncestorChainHasOutOfFlowPositionedDescendant(); |
491 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); | 520 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); |
492 | 521 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 600 |
572 bool hitTestContents(const HitTestRequest&, HitTestResult&, const LayoutRect
& layerBounds, const HitTestLocation&, HitTestFilter) const; | 601 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; | 602 bool hitTestContentsForFragments(const LayerFragments&, const HitTestRequest
&, HitTestResult&, const HitTestLocation&, HitTestFilter, bool& insideClipRect)
const; |
574 RenderLayer* hitTestTransformedLayerInFragments(RenderLayer* rootLayer, Rend
erLayer* containerLayer, const HitTestRequest&, HitTestResult&, | 603 RenderLayer* hitTestTransformedLayerInFragments(RenderLayer* rootLayer, Rend
erLayer* containerLayer, const HitTestRequest&, HitTestResult&, |
575 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0); | 604 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0); |
576 | 605 |
577 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; | 606 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; |
578 | 607 |
579 bool shouldBeSelfPaintingLayer() const; | 608 bool shouldBeSelfPaintingLayer() const; |
580 | 609 |
581 private: | |
582 // FIXME: We should only create the stacking node if needed. | 610 // FIXME: We should only create the stacking node if needed. |
583 bool requiresStackingNode() const { return true; } | 611 bool requiresStackingNode() const { return true; } |
584 void updateStackingNode(); | 612 void updateStackingNode(); |
585 | 613 |
586 void updateReflectionInfo(const RenderStyle*); | 614 void updateReflectionInfo(const RenderStyle*); |
587 | 615 |
588 // FIXME: We could lazily allocate our ScrollableArea based on style propert
ies ('overflow', ...) | 616 // 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. | 617 // but for now, we are always allocating it for RenderBox as it's safer. |
590 bool requiresScrollableArea() const { return renderBox(); } | 618 bool requiresScrollableArea() const { return renderBox(); } |
591 void updateScrollableArea(); | 619 void updateScrollableArea(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 bool lostGroupedMapping() const { return m_compositingProperties.lostGrouped
Mapping; } | 651 bool lostGroupedMapping() const { return m_compositingProperties.lostGrouped
Mapping; } |
624 void setLostGroupedMapping(bool b) { m_compositingProperties.lostGroupedMapp
ing = b; } | 652 void setLostGroupedMapping(bool b) { m_compositingProperties.lostGroupedMapp
ing = b; } |
625 | 653 |
626 void setCompositingReasons(CompositingReasons); | 654 void setCompositingReasons(CompositingReasons); |
627 CompositingReasons compositingReasons() const { return m_compositingProperti
es.compositingReasons; } | 655 CompositingReasons compositingReasons() const { return m_compositingProperti
es.compositingReasons; } |
628 | 656 |
629 friend class CompositedLayerMapping; | 657 friend class CompositedLayerMapping; |
630 friend class RenderLayerCompositor; | 658 friend class RenderLayerCompositor; |
631 friend class RenderLayerModelObject; | 659 friend class RenderLayerModelObject; |
632 | 660 |
633 private: | |
634 LayerType m_layerType; | 661 LayerType m_layerType; |
635 | 662 |
636 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting | 663 // 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. | 664 // 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. | 665 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. |
639 unsigned m_isSelfPaintingLayer : 1; | 666 unsigned m_isSelfPaintingLayer : 1; |
640 | 667 |
641 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to | 668 // 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). | 669 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). |
643 unsigned m_hasSelfPaintingLayerDescendant : 1; | 670 unsigned m_hasSelfPaintingLayerDescendant : 1; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 IntSize offsetFromSquashingLayerOrigin; | 776 IntSize offsetFromSquashingLayerOrigin; |
750 }; | 777 }; |
751 | 778 |
752 CompositingProperties m_compositingProperties; | 779 CompositingProperties m_compositingProperties; |
753 | 780 |
754 IntRect m_blockSelectionGapsBounds; | 781 IntRect m_blockSelectionGapsBounds; |
755 | 782 |
756 OwnPtr<CompositedLayerMapping> m_compositedLayerMapping; | 783 OwnPtr<CompositedLayerMapping> m_compositedLayerMapping; |
757 OwnPtr<RenderLayerScrollableArea> m_scrollableArea; | 784 OwnPtr<RenderLayerScrollableArea> m_scrollableArea; |
758 | 785 |
| 786 mutable OwnPtr<AncestorDependentPropertyCache> m_ancestorDependentPropertyCa
che; |
| 787 |
759 CompositedLayerMapping* m_groupedMapping; | 788 CompositedLayerMapping* m_groupedMapping; |
760 | 789 |
761 RenderLayerRepainter m_repainter; | 790 RenderLayerRepainter m_repainter; |
762 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? | 791 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? |
763 OwnPtr<RenderLayerStackingNode> m_stackingNode; | 792 OwnPtr<RenderLayerStackingNode> m_stackingNode; |
764 OwnPtr<RenderLayerReflectionInfo> m_reflectionInfo; | 793 OwnPtr<RenderLayerReflectionInfo> m_reflectionInfo; |
765 RenderLayerBlendInfo m_blendInfo; | 794 RenderLayerBlendInfo m_blendInfo; |
766 }; | 795 }; |
767 | 796 |
768 } // namespace WebCore | 797 } // namespace WebCore |
769 | 798 |
770 #ifndef NDEBUG | 799 #ifndef NDEBUG |
771 // Outside the WebCore namespace for ease of invocation from gdb. | 800 // Outside the WebCore namespace for ease of invocation from gdb. |
772 void showLayerTree(const WebCore::RenderLayer*); | 801 void showLayerTree(const WebCore::RenderLayer*); |
773 void showLayerTree(const WebCore::RenderObject*); | 802 void showLayerTree(const WebCore::RenderObject*); |
774 #endif | 803 #endif |
775 | 804 |
776 #endif // RenderLayer_h | 805 #endif // RenderLayer_h |
OLD | NEW |