Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 2457023002: Replace coversExtraPixels with simpler logic (Closed)
Patch Set: Rebaseline Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 // invalidation container (*not* the graphics layer that paints 1599 // invalidation container (*not* the graphics layer that paints
1600 // this object). 1600 // this object).
1601 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling( 1601 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling(
1602 const LayoutBoxModelObject& paintInvalidationContainer) const; 1602 const LayoutBoxModelObject& paintInvalidationContainer) const;
1603 1603
1604 // The returned rect does *not* account for composited scrolling. 1604 // The returned rect does *not* account for composited scrolling.
1605 const LayoutRect& previousPaintInvalidationRect() const { 1605 const LayoutRect& previousPaintInvalidationRect() const {
1606 return m_previousPaintInvalidationRect; 1606 return m_previousPaintInvalidationRect;
1607 } 1607 }
1608 1608
1609 // The previous paint invalidation rect may have been expanded to whole pixels
1610 // or be rotated, skewed, etc., so covers more pixels than the object covers.
1611 bool previousPaintInvalidationRectCoversExtraPixels() const {
1612 return m_bitfields.previousPaintInvalidationRectCoversExtraPixels();
1613 }
1614
1615 // Called when the previous paint invalidation rect(s) is no longer valid. 1609 // Called when the previous paint invalidation rect(s) is no longer valid.
1616 virtual void clearPreviousPaintInvalidationRects(); 1610 virtual void clearPreviousPaintInvalidationRects();
1617 1611
1618 // Only adjusts if the paint invalidation container is not a composited 1612 // Only adjusts if the paint invalidation container is not a composited
1619 // scroller. 1613 // scroller.
1620 void adjustPreviousPaintInvalidationForScrollIfNeeded( 1614 void adjustPreviousPaintInvalidationForScrollIfNeeded(
1621 const DoubleSize& scrollDelta); 1615 const DoubleSize& scrollDelta);
1622 1616
1623 // The previous position of the top-left corner of the object in its previous 1617 // The previous position of the top-left corner of the object in its previous
1624 // paint backing. 1618 // paint backing.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 void clearPaintInvalidationFlags() { 1705 void clearPaintInvalidationFlags() {
1712 m_layoutObject.clearPaintInvalidationFlags(); 1706 m_layoutObject.clearPaintInvalidationFlags();
1713 } 1707 }
1714 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { 1708 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) {
1715 m_layoutObject.setShouldDoFullPaintInvalidation(reason); 1709 m_layoutObject.setShouldDoFullPaintInvalidation(reason);
1716 } 1710 }
1717 void ensureIsReadyForPaintInvalidation() { 1711 void ensureIsReadyForPaintInvalidation() {
1718 m_layoutObject.ensureIsReadyForPaintInvalidation(); 1712 m_layoutObject.ensureIsReadyForPaintInvalidation();
1719 } 1713 }
1720 1714
1721 void setPreviousPaintInvalidationRect(const LayoutRect& r, 1715 void setPreviousPaintInvalidationRect(const LayoutRect& r) {
1722 bool coversExtraPixels) {
1723 m_layoutObject.setPreviousPaintInvalidationRect(r); 1716 m_layoutObject.setPreviousPaintInvalidationRect(r);
1724 m_layoutObject.m_bitfields
1725 .setPreviousPaintInvalidationRectCoversExtraPixels(coversExtraPixels);
1726 } 1717 }
1727 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& p) { 1718 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& p) {
1728 m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p); 1719 m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p);
1729 } 1720 }
1730 void setPreviousBackgroundObscured(bool b) { 1721 void setPreviousBackgroundObscured(bool b) {
1731 m_layoutObject.setPreviousBackgroundObscured(b); 1722 m_layoutObject.setPreviousBackgroundObscured(b);
1732 } 1723 }
1733 void clearPreviousPaintInvalidationRects() { 1724 void clearPreviousPaintInvalidationRects() {
1734 m_layoutObject.clearPreviousPaintInvalidationRects(); 1725 m_layoutObject.clearPreviousPaintInvalidationRects();
1735 } 1726 }
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 m_posChildNeedsLayout(false), 2088 m_posChildNeedsLayout(false),
2098 m_needsSimplifiedNormalFlowLayout(false), 2089 m_needsSimplifiedNormalFlowLayout(false),
2099 m_selfNeedsOverflowRecalcAfterStyleChange(false), 2090 m_selfNeedsOverflowRecalcAfterStyleChange(false),
2100 m_childNeedsOverflowRecalcAfterStyleChange(false), 2091 m_childNeedsOverflowRecalcAfterStyleChange(false),
2101 m_preferredLogicalWidthsDirty(false), 2092 m_preferredLogicalWidthsDirty(false),
2102 m_childShouldCheckForPaintInvalidation(false), 2093 m_childShouldCheckForPaintInvalidation(false),
2103 m_mayNeedPaintInvalidation(false), 2094 m_mayNeedPaintInvalidation(false),
2104 m_mayNeedPaintInvalidationSubtree(false), 2095 m_mayNeedPaintInvalidationSubtree(false),
2105 m_mayNeedPaintInvalidationAnimatedBackgroundImage(false), 2096 m_mayNeedPaintInvalidationAnimatedBackgroundImage(false),
2106 m_shouldInvalidateSelection(false), 2097 m_shouldInvalidateSelection(false),
2107 m_previousPaintInvalidationRectCoversExtraPixels(false),
2108 m_floating(false), 2098 m_floating(false),
2109 m_isAnonymous(!node), 2099 m_isAnonymous(!node),
2110 m_isText(false), 2100 m_isText(false),
2111 m_isBox(false), 2101 m_isBox(false),
2112 m_isInline(true), 2102 m_isInline(true),
2113 m_isAtomicInlineLevel(false), 2103 m_isAtomicInlineLevel(false),
2114 m_horizontalWritingMode(true), 2104 m_horizontalWritingMode(true),
2115 m_hasLayer(false), 2105 m_hasLayer(false),
2116 m_hasOverflowClip(false), 2106 m_hasOverflowClip(false),
2117 m_hasTransformRelatedProperty(false), 2107 m_hasTransformRelatedProperty(false),
(...skipping 11 matching lines...) Expand all
2129 m_previousBackgroundObscured(false), 2119 m_previousBackgroundObscured(false),
2130 m_isBackgroundAttachmentFixedObject(false), 2120 m_isBackgroundAttachmentFixedObject(false),
2131 m_isScrollAnchorObject(false), 2121 m_isScrollAnchorObject(false),
2132 m_scrollAnchorDisablingStyleChanged(false), 2122 m_scrollAnchorDisablingStyleChanged(false),
2133 m_hasBoxDecorationBackground(false), 2123 m_hasBoxDecorationBackground(false),
2134 m_positionedState(IsStaticallyPositioned), 2124 m_positionedState(IsStaticallyPositioned),
2135 m_selectionState(SelectionNone), 2125 m_selectionState(SelectionNone),
2136 m_backgroundObscurationState(BackgroundObscurationStatusInvalid), 2126 m_backgroundObscurationState(BackgroundObscurationStatusInvalid),
2137 m_fullPaintInvalidationReason(PaintInvalidationNone) {} 2127 m_fullPaintInvalidationReason(PaintInvalidationNone) {}
2138 2128
2139 // 32 bits have been used in the first word, and 20 in the second. 2129 // 32 bits have been used in the first word, and 19 in the second.
2140 2130
2141 // Self needs layout means that this layout object is marked for a full 2131 // Self needs layout means that this layout object is marked for a full
2142 // layout. This is the default layout but it is expensive as it recomputes 2132 // layout. This is the default layout but it is expensive as it recomputes
2143 // everything. For CSS boxes, this includes the width (laying out the line 2133 // everything. For CSS boxes, this includes the width (laying out the line
2144 // boxes again), the margins (due to block collapsing margins), the 2134 // boxes again), the margins (due to block collapsing margins), the
2145 // positions, the height and the potential overflow. 2135 // positions, the height and the potential overflow.
2146 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); 2136 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout);
2147 2137
2148 // A positioned movement layout is a specialized type of layout used on 2138 // A positioned movement layout is a specialized type of layout used on
2149 // positioned objects that only visually moved. This layout is used when 2139 // positioned objects that only visually moved. This layout is used when
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 2187
2198 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, 2188 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation,
2199 ChildShouldCheckForPaintInvalidation); 2189 ChildShouldCheckForPaintInvalidation);
2200 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation); 2190 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation);
2201 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree, 2191 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationSubtree,
2202 MayNeedPaintInvalidationSubtree); 2192 MayNeedPaintInvalidationSubtree);
2203 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationAnimatedBackgroundImage, 2193 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidationAnimatedBackgroundImage,
2204 MayNeedPaintInvalidationAnimatedBackgroundImage); 2194 MayNeedPaintInvalidationAnimatedBackgroundImage);
2205 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection); 2195 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection);
2206 2196
2207 ADD_BOOLEAN_BITFIELD(previousPaintInvalidationRectCoversExtraPixels,
2208 PreviousPaintInvalidationRectCoversExtraPixels);
2209
2210 // This boolean is the cached value of 'float' 2197 // This boolean is the cached value of 'float'
2211 // (see ComputedStyle::isFloating). 2198 // (see ComputedStyle::isFloating).
2212 ADD_BOOLEAN_BITFIELD(floating, Floating); 2199 ADD_BOOLEAN_BITFIELD(floating, Floating);
2213 2200
2214 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); 2201 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous);
2215 ADD_BOOLEAN_BITFIELD(isText, IsText); 2202 ADD_BOOLEAN_BITFIELD(isText, IsText);
2216 ADD_BOOLEAN_BITFIELD(isBox, IsBox); 2203 ADD_BOOLEAN_BITFIELD(isBox, IsBox);
2217 2204
2218 // This boolean represents whether the LayoutObject is 'inline-level' 2205 // This boolean represents whether the LayoutObject is 'inline-level'
2219 // (a CSS concept). Inline-level boxes are laid out inside a line. If 2206 // (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
2609 CORE_EXPORT void showLineTree(const blink::LayoutObject*); 2596 CORE_EXPORT void showLineTree(const blink::LayoutObject*);
2610 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); 2597 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1);
2611 // We don't make object2 an optional parameter so that showLayoutTree 2598 // We don't make object2 an optional parameter so that showLayoutTree
2612 // can be called from gdb easily. 2599 // can be called from gdb easily.
2613 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, 2600 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1,
2614 const blink::LayoutObject* object2); 2601 const blink::LayoutObject* object2);
2615 2602
2616 #endif 2603 #endif
2617 2604
2618 #endif // LayoutObject_h 2605 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698