| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 }; | 596 }; |
| 597 | 597 |
| 598 void getTextDecorations(unsigned decorations, AppliedTextDecoration& underli
ne, AppliedTextDecoration& overline, AppliedTextDecoration& linethrough, bool qu
irksMode = false, bool firstlineStyle = false); | 598 void getTextDecorations(unsigned decorations, AppliedTextDecoration& underli
ne, AppliedTextDecoration& overline, AppliedTextDecoration& linethrough, bool qu
irksMode = false, bool firstlineStyle = false); |
| 599 | 599 |
| 600 // Return the RenderLayerModelObject in the container chain which is respons
ible for painting this object, or 0 | 600 // Return the RenderLayerModelObject in the container chain which is respons
ible for painting this object, or 0 |
| 601 // if painting is root-relative. This is the container that should be passed
to the 'forPaintInvalidation' | 601 // if painting is root-relative. This is the container that should be passed
to the 'forPaintInvalidation' |
| 602 // methods. | 602 // methods. |
| 603 const RenderLayerModelObject* containerForPaintInvalidation() const; | 603 const RenderLayerModelObject* containerForPaintInvalidation() const; |
| 604 const RenderLayerModelObject* adjustCompositedContainerForSpecialAncestors(c
onst RenderLayerModelObject* paintInvalidationContainer) const; | 604 const RenderLayerModelObject* adjustCompositedContainerForSpecialAncestors(c
onst RenderLayerModelObject* paintInvalidationContainer) const; |
| 605 | 605 |
| 606 LayoutRect computePaintInvalidationRect() | |
| 607 { | |
| 608 return computePaintInvalidationRect(containerForPaintInvalidation()); | |
| 609 } | |
| 610 | |
| 611 // Returns the paint invalidation rect for this RenderObject in the coordina
te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation
Container|. | |
| 612 LayoutRect computePaintInvalidationRect(const RenderLayerModelObject* paintI
nvalidationContainer, const PaintInvalidationState* = 0) const; | |
| 613 | |
| 614 // Returns the rect bounds needed to invalidate the paint of this object, in
the coordinate space of the rendering backing of |paintInvalidationContainer| | |
| 615 LayoutRect boundsRectForPaintInvalidation(const RenderLayerModelObject* pain
tInvalidationContainer, const PaintInvalidationState* = 0) const; | |
| 616 | |
| 617 // Walk the tree after layout issuing paint invalidations for renderers that
have changed or moved, updating bounds that have changed, and clearing paint in
validation state. | 606 // Walk the tree after layout issuing paint invalidations for renderers that
have changed or moved, updating bounds that have changed, and clearing paint in
validation state. |
| 618 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); | 607 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); |
| 619 | 608 |
| 620 // Returns the rect that should have paint invalidated whenever this object
changes. The rect is in the view's | |
| 621 // coordinate space. This method deals with outlines and overflow. | |
| 622 LayoutRect absoluteClippedOverflowRect() const; | |
| 623 IntRect pixelSnappedAbsoluteClippedOverflowRect() const; | |
| 624 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer
ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons
t; | |
| 625 virtual LayoutRect rectWithOutlineForPaintInvalidation(const RenderLayerMode
lObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalid
ationState* = 0) const; | |
| 626 | |
| 627 // Given a rect in the object's coordinate space, compute a rect suitable fo
r invalidating paints of | 609 // Given a rect in the object's coordinate space, compute a rect suitable fo
r invalidating paints of |
| 628 // that rect in the coordinate space of paintInvalidationContainer. | 610 // that rect in the coordinate space of paintInvalidationContainer. |
| 629 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const; | 611 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const; |
| 630 virtual void computeFloatRectForPaintInvalidation(const RenderLayerModelObje
ct* paintInvalidationContainer, FloatRect& paintInvalidationRect, const PaintInv
alidationState*) const; | |
| 631 | 612 |
| 632 virtual unsigned length() const { return 1; } | 613 virtual unsigned length() const { return 1; } |
| 633 | 614 |
| 634 // FIXME(sky): Remove | 615 // FIXME(sky): Remove |
| 635 bool isFloatingOrOutOfFlowPositioned() const { return isOutOfFlowPositioned(
); } | 616 bool isFloatingOrOutOfFlowPositioned() const { return isOutOfFlowPositioned(
); } |
| 636 | 617 |
| 637 bool isTransparent() const { return style()->hasOpacity(); } | 618 bool isTransparent() const { return style()->hasOpacity(); } |
| 638 float opacity() const { return style()->opacity(); } | 619 float opacity() const { return style()->opacity(); } |
| 639 | 620 |
| 640 enum SelectionState { | 621 enum SelectionState { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 void setPreviousPositionFromPaintInvalidationContainer(const LayoutPoint& lo
cation) { m_previousPositionFromPaintInvalidationContainer = location; } | 715 void setPreviousPositionFromPaintInvalidationContainer(const LayoutPoint& lo
cation) { m_previousPositionFromPaintInvalidationContainer = location; } |
| 735 | 716 |
| 736 bool shouldDoFullPaintInvalidation() const { return m_bitfields.shouldDoFull
PaintInvalidation(); } | 717 bool shouldDoFullPaintInvalidation() const { return m_bitfields.shouldDoFull
PaintInvalidation(); } |
| 737 void setShouldDoFullPaintInvalidation(bool, MarkingBehavior = MarkContaining
BlockChain); | 718 void setShouldDoFullPaintInvalidation(bool, MarkingBehavior = MarkContaining
BlockChain); |
| 738 | 719 |
| 739 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv
alidateOverflowForPaint(); } | 720 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv
alidateOverflowForPaint(); } |
| 740 | 721 |
| 741 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee
dedPositionedMovementLayout(); } | 722 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee
dedPositionedMovementLayout(); } |
| 742 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed
edPositionedMovementLayout(b); } | 723 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed
edPositionedMovementLayout(b); } |
| 743 | 724 |
| 744 virtual void clearPaintInvalidationState(const PaintInvalidationState&); | 725 void clearPaintInvalidationState(const PaintInvalidationState&); |
| 745 | 726 |
| 746 // layoutDidGetCalled indicates whether this render object was re-laid-out | 727 // layoutDidGetCalled indicates whether this render object was re-laid-out |
| 747 // since the last call to setLayoutDidGetCalled(false) on this object. | 728 // since the last call to setLayoutDidGetCalled(false) on this object. |
| 748 bool layoutDidGetCalled() const { return m_bitfields.layoutDidGetCalled(); } | 729 bool layoutDidGetCalled() const { return m_bitfields.layoutDidGetCalled(); } |
| 749 void setLayoutDidGetCalled(bool b) | 730 void setLayoutDidGetCalled(bool b) |
| 750 { | 731 { |
| 751 // FIXME(sky): Get rid of this once we get rid of all paint invalidation
. | 732 // FIXME(sky): Get rid of this once we get rid of all paint invalidation
. |
| 752 m_bitfields.setLayoutDidGetCalled(b); | 733 m_bitfields.setLayoutDidGetCalled(b); |
| 753 } | 734 } |
| 754 | 735 |
| 755 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval
idation(); } | 736 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval
idation(); } |
| 756 | 737 |
| 757 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout
BecauseOfChildren(); } | 738 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout
BecauseOfChildren(); } |
| 758 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB
ecauseOfChildren(b); } | 739 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB
ecauseOfChildren(b); } |
| 759 | 740 |
| 760 bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInva
lidationState) | 741 bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInva
lidationState) |
| 761 { | 742 { |
| 762 return paintInvalidationState.forceCheckForPaintInvalidation() || should
CheckForPaintInvalidationRegardlessOfPaintInvalidationState(); | 743 return paintInvalidationState.forceCheckForPaintInvalidation() || |
| 763 } | 744 layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFullPa
intInvalidation(); |
| 764 | |
| 765 bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() | |
| 766 { | |
| 767 return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFul
lPaintInvalidation(); | |
| 768 } | 745 } |
| 769 | 746 |
| 770 bool supportsPaintInvalidationStateCachedOffsets() const { return !hasTransf
orm(); } | 747 bool supportsPaintInvalidationStateCachedOffsets() const { return !hasTransf
orm(); } |
| 771 | 748 |
| 772 void setNeedsOverflowRecalcAfterStyleChange(); | 749 void setNeedsOverflowRecalcAfterStyleChange(); |
| 773 void markContainingBlocksForOverflowRecalc(); | 750 void markContainingBlocksForOverflowRecalc(); |
| 774 | 751 |
| 775 protected: | 752 protected: |
| 776 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time | 753 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time |
| 777 // this function will be called. | 754 // this function will be called. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 802 void clearLayoutRootIfNeeded() const; | 779 void clearLayoutRootIfNeeded() const; |
| 803 virtual void willBeDestroyed(); | 780 virtual void willBeDestroyed(); |
| 804 void postDestroy(); | 781 void postDestroy(); |
| 805 | 782 |
| 806 void insertedIntoTree(); | 783 void insertedIntoTree(); |
| 807 void willBeRemovedFromTree(); | 784 void willBeRemovedFromTree(); |
| 808 | 785 |
| 809 void setDocumentForAnonymous(Document* document) { ASSERT(isAnonymous()); m_
node = document; } | 786 void setDocumentForAnonymous(Document* document) { ASSERT(isAnonymous()); m_
node = document; } |
| 810 | 787 |
| 811 #if ENABLE(ASSERT) | 788 #if ENABLE(ASSERT) |
| 812 virtual bool paintInvalidationStateIsDirty() const | 789 bool paintInvalidationStateIsDirty() const |
| 813 { | 790 { |
| 814 return layoutDidGetCalled() || shouldDoFullPaintInvalidation() | 791 return layoutDidGetCalled() || shouldDoFullPaintInvalidation() |
| 815 || onlyNeededPositionedMovementLayout() || neededLayoutBecauseOfChil
dren() || mayNeedPaintInvalidation(); | 792 || onlyNeededPositionedMovementLayout() || neededLayoutBecauseOfChil
dren() || mayNeedPaintInvalidation(); |
| 816 } | 793 } |
| 817 #endif | 794 #endif |
| 818 | 795 |
| 819 private: | 796 private: |
| 820 bool hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor() const; | 797 bool hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor() const; |
| 821 | 798 |
| 822 StyleDifference adjustStyleDifference(StyleDifference) const; | 799 StyleDifference adjustStyleDifference(StyleDifference) const; |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 void showTree(const blink::RenderObject*); | 1087 void showTree(const blink::RenderObject*); |
| 1111 void showLineTree(const blink::RenderObject*); | 1088 void showLineTree(const blink::RenderObject*); |
| 1112 void showRenderTree(const blink::RenderObject* object1); | 1089 void showRenderTree(const blink::RenderObject* object1); |
| 1113 // We don't make object2 an optional parameter so that showRenderTree | 1090 // We don't make object2 an optional parameter so that showRenderTree |
| 1114 // can be called from gdb easily. | 1091 // can be called from gdb easily. |
| 1115 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); | 1092 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); |
| 1116 | 1093 |
| 1117 #endif | 1094 #endif |
| 1118 | 1095 |
| 1119 #endif // SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ | 1096 #endif // SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ |
| OLD | NEW |