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. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1592 // invalidation container (*not* the graphics layer that paints | 1592 // invalidation container (*not* the graphics layer that paints |
1593 // this object). | 1593 // this object). |
1594 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling( | 1594 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling( |
1595 const LayoutBoxModelObject& paintInvalidationContainer) const; | 1595 const LayoutBoxModelObject& paintInvalidationContainer) const; |
1596 | 1596 |
1597 // The returned rect does *not* account for composited scrolling. | 1597 // The returned rect does *not* account for composited scrolling. |
1598 const LayoutRect& previousPaintInvalidationRect() const { | 1598 const LayoutRect& previousPaintInvalidationRect() const { |
1599 return m_previousPaintInvalidationRect; | 1599 return m_previousPaintInvalidationRect; |
1600 } | 1600 } |
1601 | 1601 |
1602 // The previous paint invalidation rect may have been expanded to whole pixels | |
1603 // or be rotated, skewed, etc., so covers more pixels than the object covers. | |
1604 bool previousPaintInvalidationRectCoversExtraPixels() const { | |
1605 return m_bitfields.previousPaintInvalidationRectCoversExtraPixels(); | |
1606 } | |
1607 | |
1602 // Called when the previous paint invalidation rect(s) is no longer valid. | 1608 // Called when the previous paint invalidation rect(s) is no longer valid. |
1603 virtual void clearPreviousPaintInvalidationRects(); | 1609 virtual void clearPreviousPaintInvalidationRects(); |
1604 | 1610 |
1605 // Only adjusts if the paint invalidation container is not a composited | 1611 // Only adjusts if the paint invalidation container is not a composited |
1606 // scroller. | 1612 // scroller. |
1607 void adjustPreviousPaintInvalidationForScrollIfNeeded( | 1613 void adjustPreviousPaintInvalidationForScrollIfNeeded( |
1608 const DoubleSize& scrollDelta); | 1614 const DoubleSize& scrollDelta); |
1609 | 1615 |
1610 // The previous position of the top-left corner of the object in its previous | 1616 // The previous position of the top-left corner of the object in its previous |
1611 // paint backing. | 1617 // paint backing. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1698 void clearPaintInvalidationFlags() { | 1704 void clearPaintInvalidationFlags() { |
1699 m_layoutObject.clearPaintInvalidationFlags(); | 1705 m_layoutObject.clearPaintInvalidationFlags(); |
1700 } | 1706 } |
1701 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { | 1707 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { |
1702 m_layoutObject.setShouldDoFullPaintInvalidation(reason); | 1708 m_layoutObject.setShouldDoFullPaintInvalidation(reason); |
1703 } | 1709 } |
1704 void ensureIsReadyForPaintInvalidation() { | 1710 void ensureIsReadyForPaintInvalidation() { |
1705 m_layoutObject.ensureIsReadyForPaintInvalidation(); | 1711 m_layoutObject.ensureIsReadyForPaintInvalidation(); |
1706 } | 1712 } |
1707 | 1713 |
1708 void setPreviousPaintInvalidationRect(const LayoutRect& r) { | 1714 void setPreviousPaintInvalidationRect(const LayoutRect& r, |
pdr.
2016/10/26 20:59:29
Idea: Could we refactor this to take a PaintInvali
Xianzhu
2016/10/26 21:05:21
I didn't want to include PaintInvalidator.h from L
| |
1715 bool coversExtraPixels) { | |
1709 m_layoutObject.setPreviousPaintInvalidationRect(r); | 1716 m_layoutObject.setPreviousPaintInvalidationRect(r); |
1717 m_layoutObject.m_bitfields | |
1718 .setPreviousPaintInvalidationRectCoversExtraPixels(coversExtraPixels); | |
1710 } | 1719 } |
1711 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& p) { | 1720 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& p) { |
1712 m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p); | 1721 m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p); |
1713 } | 1722 } |
1714 void setPreviousBackgroundObscured(bool b) { | 1723 void setPreviousBackgroundObscured(bool b) { |
1715 m_layoutObject.setPreviousBackgroundObscured(b); | 1724 m_layoutObject.setPreviousBackgroundObscured(b); |
1716 } | 1725 } |
1717 void clearPreviousPaintInvalidationRects() { | 1726 void clearPreviousPaintInvalidationRects() { |
1718 m_layoutObject.clearPreviousPaintInvalidationRects(); | 1727 m_layoutObject.clearPreviousPaintInvalidationRects(); |
1719 } | 1728 } |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2086 m_posChildNeedsLayout(false), | 2095 m_posChildNeedsLayout(false), |
2087 m_needsSimplifiedNormalFlowLayout(false), | 2096 m_needsSimplifiedNormalFlowLayout(false), |
2088 m_selfNeedsOverflowRecalcAfterStyleChange(false), | 2097 m_selfNeedsOverflowRecalcAfterStyleChange(false), |
2089 m_childNeedsOverflowRecalcAfterStyleChange(false), | 2098 m_childNeedsOverflowRecalcAfterStyleChange(false), |
2090 m_preferredLogicalWidthsDirty(false), | 2099 m_preferredLogicalWidthsDirty(false), |
2091 m_childShouldCheckForPaintInvalidation(false), | 2100 m_childShouldCheckForPaintInvalidation(false), |
2092 m_mayNeedPaintInvalidation(false), | 2101 m_mayNeedPaintInvalidation(false), |
2093 m_mayNeedPaintInvalidationSubtree(false), | 2102 m_mayNeedPaintInvalidationSubtree(false), |
2094 m_mayNeedPaintInvalidationAnimatedBackgroundImage(false), | 2103 m_mayNeedPaintInvalidationAnimatedBackgroundImage(false), |
2095 m_shouldInvalidateSelection(false), | 2104 m_shouldInvalidateSelection(false), |
2105 m_previousPaintInvalidationRectCoversExtraPixels(false), | |
2096 m_floating(false), | 2106 m_floating(false), |
2097 m_isAnonymous(!node), | 2107 m_isAnonymous(!node), |
2098 m_isText(false), | 2108 m_isText(false), |
2099 m_isBox(false), | 2109 m_isBox(false), |
2100 m_isInline(true), | 2110 m_isInline(true), |
2101 m_isAtomicInlineLevel(false), | 2111 m_isAtomicInlineLevel(false), |
2102 m_horizontalWritingMode(true), | 2112 m_horizontalWritingMode(true), |
2103 m_hasLayer(false), | 2113 m_hasLayer(false), |
2104 m_hasOverflowClip(false), | 2114 m_hasOverflowClip(false), |
2105 m_hasTransformRelatedProperty(false), | 2115 m_hasTransformRelatedProperty(false), |
(...skipping 11 matching lines...) Expand all Loading... | |
2117 m_previousBackgroundObscured(false), | 2127 m_previousBackgroundObscured(false), |
2118 m_isBackgroundAttachmentFixedObject(false), | 2128 m_isBackgroundAttachmentFixedObject(false), |
2119 m_isScrollAnchorObject(false), | 2129 m_isScrollAnchorObject(false), |
2120 m_scrollAnchorDisablingStyleChanged(false), | 2130 m_scrollAnchorDisablingStyleChanged(false), |
2121 m_hasBoxDecorationBackground(false), | 2131 m_hasBoxDecorationBackground(false), |
2122 m_positionedState(IsStaticallyPositioned), | 2132 m_positionedState(IsStaticallyPositioned), |
2123 m_selectionState(SelectionNone), | 2133 m_selectionState(SelectionNone), |
2124 m_backgroundObscurationState(BackgroundObscurationStatusInvalid), | 2134 m_backgroundObscurationState(BackgroundObscurationStatusInvalid), |
2125 m_fullPaintInvalidationReason(PaintInvalidationNone) {} | 2135 m_fullPaintInvalidationReason(PaintInvalidationNone) {} |
2126 | 2136 |
2127 // 32 bits have been used in the first word, and 19 in the second. | 2137 // 32 bits have been used in the first word, and 20 in the second. |
2128 | 2138 |
2129 // Self needs layout means that this layout object is marked for a full | 2139 // Self needs layout means that this layout object is marked for a full |
2130 // layout. This is the default layout but it is expensive as it recomputes | 2140 // layout. This is the default layout but it is expensive as it recomputes |
2131 // everything. For CSS boxes, this includes the width (laying out the line | 2141 // everything. For CSS boxes, this includes the width (laying out the line |
2132 // boxes again), the margins (due to block collapsing margins), the | 2142 // boxes again), the margins (due to block collapsing margins), the |
2133 // positions, the height and the potential overflow. | 2143 // positions, the height and the potential overflow. |
2134 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); | 2144 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); |
2135 | 2145 |
2136 // A positioned movement layout is a specialized type of layout used on | 2146 // A positioned movement layout is a specialized type of layout used on |
2137 // positioned objects that only visually moved. This layout is used when | 2147 // positioned objects that only visually moved. This layout is used when |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2185 | 2195 |
2186 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, | 2196 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, |
2187 ChildShouldCheckForPaintInvalidation); | 2197 ChildShouldCheckForPaintInvalidation); |
2188 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation); | 2198 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation); |
2189 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree, | 2199 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree, |
2190 MayNeedPaintInvalidationSubtree); | 2200 MayNeedPaintInvalidationSubtree); |
2191 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationAnimatedBackgroundImage, | 2201 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationAnimatedBackgroundImage, |
2192 MayNeedPaintInvalidationAnimatedBackgroundImage); | 2202 MayNeedPaintInvalidationAnimatedBackgroundImage); |
2193 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection); | 2203 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection); |
2194 | 2204 |
2205 ADD_BOOLEAN_BITFIELD(previousPaintInvalidationRectCoversExtraPixels, | |
2206 PreviousPaintInvalidationRectCoversExtraPixels); | |
2207 | |
2195 // This boolean is the cached value of 'float' | 2208 // This boolean is the cached value of 'float' |
2196 // (see ComputedStyle::isFloating). | 2209 // (see ComputedStyle::isFloating). |
2197 ADD_BOOLEAN_BITFIELD(floating, Floating); | 2210 ADD_BOOLEAN_BITFIELD(floating, Floating); |
2198 | 2211 |
2199 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); | 2212 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); |
2200 ADD_BOOLEAN_BITFIELD(isText, IsText); | 2213 ADD_BOOLEAN_BITFIELD(isText, IsText); |
2201 ADD_BOOLEAN_BITFIELD(isBox, IsBox); | 2214 ADD_BOOLEAN_BITFIELD(isBox, IsBox); |
2202 | 2215 |
2203 // This boolean represents whether the LayoutObject is 'inline-level' | 2216 // This boolean represents whether the LayoutObject is 'inline-level' |
2204 // (a CSS concept). Inline-level boxes are laid out inside a line. If | 2217 // (a CSS concept). Inline-level boxes are laid out inside a line. If |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2594 CORE_EXPORT void showLineTree(const blink::LayoutObject*); | 2607 CORE_EXPORT void showLineTree(const blink::LayoutObject*); |
2595 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); | 2608 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); |
2596 // We don't make object2 an optional parameter so that showLayoutTree | 2609 // We don't make object2 an optional parameter so that showLayoutTree |
2597 // can be called from gdb easily. | 2610 // can be called from gdb easily. |
2598 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, | 2611 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, |
2599 const blink::LayoutObject* object2); | 2612 const blink::LayoutObject* object2); |
2600 | 2613 |
2601 #endif | 2614 #endif |
2602 | 2615 |
2603 #endif // LayoutObject_h | 2616 #endif // LayoutObject_h |
OLD | NEW |