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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same | 1117 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same |
1118 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. | 1118 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. |
1119 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida
tionContainer, const LayoutRect&, PaintInvalidationReason) const; | 1119 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida
tionContainer, const LayoutRect&, PaintInvalidationReason) const; |
1120 | 1120 |
1121 // Invalidate the paint of a specific subrectangle within a given object. Th
e rect is in the object's coordinate space. | 1121 // Invalidate the paint of a specific subrectangle within a given object. Th
e rect is in the object's coordinate space. |
1122 void invalidatePaintRectangle(const LayoutRect&) const; | 1122 void invalidatePaintRectangle(const LayoutRect&) const; |
1123 | 1123 |
1124 // Walk the tree after layout issuing paint invalidations for layoutObjects
that have changed or moved, updating bounds that have changed, and clearing pain
t invalidation state. | 1124 // Walk the tree after layout issuing paint invalidations for layoutObjects
that have changed or moved, updating bounds that have changed, and clearing pain
t invalidation state. |
1125 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); | 1125 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); |
1126 | 1126 |
1127 // This function only invalidates the visual overflow. | |
1128 // | |
1129 // Note that overflow is a box concept but this function | |
1130 // is only supported for block-flow. | |
1131 virtual void invalidatePaintForOverflow(); | |
1132 void invalidatePaintForOverflowIfNeeded(); | |
1133 | |
1134 void invalidatePaintIncludingNonCompositingDescendants(); | 1127 void invalidatePaintIncludingNonCompositingDescendants(); |
1135 void invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBox
ModelObject& paintInvalidationContainer); | 1128 void invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBox
ModelObject& paintInvalidationContainer); |
1136 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); | 1129 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); |
1137 | 1130 |
1138 // Returns the rect that should have paint invalidated whenever this object
changes. The rect is in the view's | 1131 // Returns the rect that should have paint invalidated whenever this object
changes. The rect is in the view's |
1139 // coordinate space. This method deals with outlines and overflow. | 1132 // coordinate space. This method deals with outlines and overflow. |
1140 virtual LayoutRect absoluteClippedOverflowRect() const; | 1133 virtual LayoutRect absoluteClippedOverflowRect() const; |
1141 | 1134 |
1142 // Returns the rect that should have paint invalidated whenever this object
changes. The rect is in the object's | 1135 // Returns the rect that should have paint invalidated whenever this object
changes. The rect is in the object's |
1143 // local coordinate space. This is for non-SVG objects and LayoutSVGRoot onl
y. SVG objects (except LayoutSVGRoot) | 1136 // local coordinate space. This is for non-SVG objects and LayoutSVGRoot onl
y. SVG objects (except LayoutSVGRoot) |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 { | 1327 { |
1335 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | 1328 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
1336 m_previousPositionFromPaintInvalidationBacking = paintOffset; | 1329 m_previousPositionFromPaintInvalidationBacking = paintOffset; |
1337 } | 1330 } |
1338 | 1331 |
1339 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi
elds.fullPaintInvalidationReason(); } | 1332 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi
elds.fullPaintInvalidationReason(); } |
1340 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv
alidationReason() != PaintInvalidationNone; } | 1333 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv
alidationReason() != PaintInvalidationNone; } |
1341 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid
ationFull); | 1334 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid
ationFull); |
1342 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida
tionReason(PaintInvalidationNone); } | 1335 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida
tionReason(PaintInvalidationNone); } |
1343 | 1336 |
1344 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv
alidateOverflowForPaint(); } | |
1345 | |
1346 virtual void clearPaintInvalidationFlags(const PaintInvalidationState&); | 1337 virtual void clearPaintInvalidationFlags(const PaintInvalidationState&); |
1347 | 1338 |
1348 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval
idation(); } | 1339 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval
idation(); } |
1349 void setMayNeedPaintInvalidation(); | 1340 void setMayNeedPaintInvalidation(); |
1350 | 1341 |
1351 bool mayNeedPaintInvalidationSubtree() const { return m_bitfields.mayNeedPai
ntInvalidationSubtree(); } | 1342 bool mayNeedPaintInvalidationSubtree() const { return m_bitfields.mayNeedPai
ntInvalidationSubtree(); } |
1352 void setMayNeedPaintInvalidationSubtree(); | 1343 void setMayNeedPaintInvalidationSubtree(); |
1353 | 1344 |
1354 bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidate
Selection(); } | 1345 bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidate
Selection(); } |
1355 void setShouldInvalidateSelection(); | 1346 void setShouldInvalidateSelection(); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 // If possible, use the faster paintInvalidationState.paintingLayer().setNee
dsRepaint(). | 1576 // If possible, use the faster paintInvalidationState.paintingLayer().setNee
dsRepaint(). |
1586 void slowSetPaintingLayerNeedsRepaint() const; | 1577 void slowSetPaintingLayerNeedsRepaint() const; |
1587 | 1578 |
1588 // Sets painting layer needsRepaint, then calls invalidateDisplayItemClients
(). | 1579 // Sets painting layer needsRepaint, then calls invalidateDisplayItemClients
(). |
1589 // Should use this version when PaintInvalidationState is available. | 1580 // Should use this version when PaintInvalidationState is available. |
1590 void invalidateDisplayItemClientsWithPaintInvalidationState(const PaintInval
idationState&, PaintInvalidationReason) const; | 1581 void invalidateDisplayItemClientsWithPaintInvalidationState(const PaintInval
idationState&, PaintInvalidationReason) const; |
1591 | 1582 |
1592 void setIsBackgroundAttachmentFixedObject(bool); | 1583 void setIsBackgroundAttachmentFixedObject(bool); |
1593 | 1584 |
1594 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee
dsOverflowRecalcAfterStyleChange(false); } | 1585 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee
dsOverflowRecalcAfterStyleChange(false); } |
1595 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate
OverflowForPaint(true); } | |
1596 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } | 1586 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } |
1597 | 1587 |
1598 // Remove this object and all descendants from the containing LayoutFlowThre
ad. | 1588 // Remove this object and all descendants from the containing LayoutFlowThre
ad. |
1599 void removeFromLayoutFlowThread(); | 1589 void removeFromLayoutFlowThread(); |
1600 | 1590 |
1601 bool containsInlineWithOutlineAndContinuation() const { return m_bitfields.c
ontainsInlineWithOutlineAndContinuation(); } | 1591 bool containsInlineWithOutlineAndContinuation() const { return m_bitfields.c
ontainsInlineWithOutlineAndContinuation(); } |
1602 void setContainsInlineWithOutlineAndContinuation(bool b) { m_bitfields.setCo
ntainsInlineWithOutlineAndContinuation(b); } | 1592 void setContainsInlineWithOutlineAndContinuation(bool b) { m_bitfields.setCo
ntainsInlineWithOutlineAndContinuation(b); } |
1603 | 1593 |
1604 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP
aintInvalidationRect; } | 1594 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP
aintInvalidationRect; } |
1605 | 1595 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 // of the memory constraints on layout objects. | 1718 // of the memory constraints on layout objects. |
1729 LayoutObjectBitfields(Node* node) | 1719 LayoutObjectBitfields(Node* node) |
1730 : m_selfNeedsLayout(false) | 1720 : m_selfNeedsLayout(false) |
1731 , m_needsPositionedMovementLayout(false) | 1721 , m_needsPositionedMovementLayout(false) |
1732 , m_normalChildNeedsLayout(false) | 1722 , m_normalChildNeedsLayout(false) |
1733 , m_posChildNeedsLayout(false) | 1723 , m_posChildNeedsLayout(false) |
1734 , m_needsSimplifiedNormalFlowLayout(false) | 1724 , m_needsSimplifiedNormalFlowLayout(false) |
1735 , m_selfNeedsOverflowRecalcAfterStyleChange(false) | 1725 , m_selfNeedsOverflowRecalcAfterStyleChange(false) |
1736 , m_childNeedsOverflowRecalcAfterStyleChange(false) | 1726 , m_childNeedsOverflowRecalcAfterStyleChange(false) |
1737 , m_preferredLogicalWidthsDirty(false) | 1727 , m_preferredLogicalWidthsDirty(false) |
1738 , m_shouldInvalidateOverflowForPaint(false) | |
1739 , m_childShouldCheckForPaintInvalidation(false) | 1728 , m_childShouldCheckForPaintInvalidation(false) |
1740 , m_mayNeedPaintInvalidation(false) | 1729 , m_mayNeedPaintInvalidation(false) |
1741 , m_mayNeedPaintInvalidationSubtree(false) | 1730 , m_mayNeedPaintInvalidationSubtree(false) |
1742 , m_shouldInvalidateSelection(false) | 1731 , m_shouldInvalidateSelection(false) |
1743 , m_neededLayoutBecauseOfChildren(false) | 1732 , m_neededLayoutBecauseOfChildren(false) |
1744 , m_floating(false) | 1733 , m_floating(false) |
1745 , m_isAnonymous(!node) | 1734 , m_isAnonymous(!node) |
1746 , m_isText(false) | 1735 , m_isText(false) |
1747 , m_isBox(false) | 1736 , m_isBox(false) |
1748 , m_isInline(true) | 1737 , m_isInline(true) |
(...skipping 18 matching lines...) Expand all Loading... |
1767 , m_lastBoxDecorationBackgroundObscured(false) | 1756 , m_lastBoxDecorationBackgroundObscured(false) |
1768 , m_isBackgroundAttachmentFixedObject(false) | 1757 , m_isBackgroundAttachmentFixedObject(false) |
1769 , m_isScrollAnchorObject(false) | 1758 , m_isScrollAnchorObject(false) |
1770 , m_positionedState(IsStaticallyPositioned) | 1759 , m_positionedState(IsStaticallyPositioned) |
1771 , m_selectionState(SelectionNone) | 1760 , m_selectionState(SelectionNone) |
1772 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) | 1761 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) |
1773 , m_fullPaintInvalidationReason(PaintInvalidationNone) | 1762 , m_fullPaintInvalidationReason(PaintInvalidationNone) |
1774 { | 1763 { |
1775 } | 1764 } |
1776 | 1765 |
1777 // 32 bits have been used in the first word, and 18 in the second. | 1766 // 32 bits have been used in the first word, and 17 in the second. |
1778 | 1767 |
1779 // Self needs layout means that this layout object is marked for a full
layout. | 1768 // Self needs layout means that this layout object is marked for a full
layout. |
1780 // This is the default layout but it is expensive as it recomputes every
thing. | 1769 // This is the default layout but it is expensive as it recomputes every
thing. |
1781 // For CSS boxes, this includes the width (laying out the line boxes aga
in), the margins | 1770 // For CSS boxes, this includes the width (laying out the line boxes aga
in), the margins |
1782 // (due to block collapsing margins), the positions, the height and the
potential overflow. | 1771 // (due to block collapsing margins), the positions, the height and the
potential overflow. |
1783 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); | 1772 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); |
1784 | 1773 |
1785 // A positioned movement layout is a specialized type of layout used on
positioned objects | 1774 // A positioned movement layout is a specialized type of layout used on
positioned objects |
1786 // that only visually moved. This layout is used when changing 'top'/'le
ft' on a positioned | 1775 // that only visually moved. This layout is used when changing 'top'/'le
ft' on a positioned |
1787 // element or margins on an out-of-flow one. Because the following opera
tions don't impact | 1776 // element or margins on an out-of-flow one. Because the following opera
tions don't impact |
(...skipping 27 matching lines...) Expand all Loading... |
1815 // selfNeedsOverflowRecalcAfterStyleChange. This is needed as a descenda
nt overflow can | 1804 // selfNeedsOverflowRecalcAfterStyleChange. This is needed as a descenda
nt overflow can |
1816 // bleed into its containing block's so we have to recompute it in some
cases. | 1805 // bleed into its containing block's so we have to recompute it in some
cases. |
1817 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, ChildNeed
sOverflowRecalcAfterStyleChange); | 1806 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, ChildNeed
sOverflowRecalcAfterStyleChange); |
1818 | 1807 |
1819 // This boolean marks preferred logical widths for lazy recomputation. | 1808 // This boolean marks preferred logical widths for lazy recomputation. |
1820 // | 1809 // |
1821 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS above about those | 1810 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS above about those |
1822 // widths. | 1811 // widths. |
1823 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths
Dirty); | 1812 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths
Dirty); |
1824 | 1813 |
1825 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO
verflowForPaint); // TODO(wangxianzhu): Remove for slimming paint v2. | |
1826 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCh
eckForPaintInvalidation); | 1814 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCh
eckForPaintInvalidation); |
1827 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation)
; | 1815 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation)
; |
1828 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree, MayNeedPaintInvali
dationSubtree); | 1816 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree, MayNeedPaintInvali
dationSubtree); |
1829 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelectio
n); // TODO(wangxianzhu): Remove for slimming paint v2. | 1817 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelectio
n); // TODO(wangxianzhu): Remove for slimming paint v2. |
1830 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO
fChildren); // TODO(wangxianzhu): Remove for slimming paint v2. | 1818 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO
fChildren); // TODO(wangxianzhu): Remove for slimming paint v2. |
1831 | 1819 |
1832 // This boolean is the cached value of 'float' | 1820 // This boolean is the cached value of 'float' |
1833 // (see ComputedStyle::isFloating). | 1821 // (see ComputedStyle::isFloating). |
1834 ADD_BOOLEAN_BITFIELD(floating, Floating); | 1822 ADD_BOOLEAN_BITFIELD(floating, Floating); |
1835 | 1823 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 #undef ADD_BOOLEAN_BITFIELD | 1930 #undef ADD_BOOLEAN_BITFIELD |
1943 | 1931 |
1944 LayoutObjectBitfields m_bitfields; | 1932 LayoutObjectBitfields m_bitfields; |
1945 | 1933 |
1946 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } | 1934 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } |
1947 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition
edMovementLayout(b); } | 1935 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition
edMovementLayout(b); } |
1948 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo
ut(b); } | 1936 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo
ut(b); } |
1949 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b);
} | 1937 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b);
} |
1950 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli
fiedNormalFlowLayout(b); } | 1938 void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimpli
fiedNormalFlowLayout(b); } |
1951 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } | 1939 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } |
1952 void clearShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalida
teOverflowForPaint(false); } | |
1953 void setSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNeeds
OverflowRecalcAfterStyleChange(true); } | 1940 void setSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNeeds
OverflowRecalcAfterStyleChange(true); } |
1954 void setChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildNee
dsOverflowRecalcAfterStyleChange(true); } | 1941 void setChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildNee
dsOverflowRecalcAfterStyleChange(true); } |
1955 | 1942 |
1956 private: | 1943 private: |
1957 // Store state between styleWillChange and styleDidChange | 1944 // Store state between styleWillChange and styleDidChange |
1958 static bool s_affectsParentBlock; | 1945 static bool s_affectsParentBlock; |
1959 | 1946 |
1960 // This stores the paint invalidation rect from the previous frame. This rec
t does *not* account for composited scrolling. See | 1947 // This stores the paint invalidation rect from the previous frame. This rec
t does *not* account for composited scrolling. See |
1961 // adjustInvalidationRectForCompositedScrolling(). | 1948 // adjustInvalidationRectForCompositedScrolling(). |
1962 LayoutRect m_previousPaintInvalidationRect; | 1949 LayoutRect m_previousPaintInvalidationRect; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2194 void showTree(const blink::LayoutObject*); | 2181 void showTree(const blink::LayoutObject*); |
2195 void showLineTree(const blink::LayoutObject*); | 2182 void showLineTree(const blink::LayoutObject*); |
2196 void showLayoutTree(const blink::LayoutObject* object1); | 2183 void showLayoutTree(const blink::LayoutObject* object1); |
2197 // We don't make object2 an optional parameter so that showLayoutTree | 2184 // We don't make object2 an optional parameter so that showLayoutTree |
2198 // can be called from gdb easily. | 2185 // can be called from gdb easily. |
2199 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); | 2186 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); |
2200 | 2187 |
2201 #endif | 2188 #endif |
2202 | 2189 |
2203 #endif // LayoutObject_h | 2190 #endif // LayoutObject_h |
OLD | NEW |