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

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

Issue 2080593002: Revert of Let FrameView track object paint invalidations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@TrackInvalidation
Patch Set: Created 4 years, 6 months 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. 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 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 1121
1122 bool isPaintInvalidationContainer() const; 1122 bool isPaintInvalidationContainer() const;
1123 1123
1124 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space 1124 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space
1125 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same 1125 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same
1126 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing. 1126 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing.
1127 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida tionContainer, const LayoutRect&, PaintInvalidationReason) const; 1127 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida tionContainer, const LayoutRect&, PaintInvalidationReason) const;
1128 1128
1129 // Invalidate the paint of a specific subrectangle within a given object. Th e rect is in the object's coordinate space. 1129 // Invalidate the paint of a specific subrectangle within a given object. Th e rect is in the object's coordinate space.
1130 void invalidatePaintRectangle(const LayoutRect&) const; 1130 void invalidatePaintRectangle(const LayoutRect&) const;
1131 void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutR ect&) const;
1131 1132
1132 // 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. 1133 // 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.
1133 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); 1134 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&);
1134 1135
1135 // This function only invalidates the visual overflow. 1136 // This function only invalidates the visual overflow.
1136 // 1137 //
1137 // Note that overflow is a box concept but this function 1138 // Note that overflow is a box concept but this function
1138 // is only supported for block-flow. 1139 // is only supported for block-flow.
1139 virtual void invalidatePaintForOverflow(); 1140 virtual void invalidatePaintForOverflow();
1140 void invalidatePaintForOverflowIfNeeded(); 1141 void invalidatePaintForOverflowIfNeeded();
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState (); 1369 || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState ();
1369 } 1370 }
1370 1371
1371 bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() con st 1372 bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() con st
1372 { 1373 {
1373 return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection() || m_bitfields.childShouldCheckForPaintInvalidation( ); 1374 return mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldInvalidateSelection() || m_bitfields.childShouldCheckForPaintInvalidation( );
1374 } 1375 }
1375 1376
1376 virtual LayoutRect viewRect() const; 1377 virtual LayoutRect viewRect() const;
1377 1378
1378 // TODO(wangxianzhu): Change the call sites to use the faster version if pos sible. 1379 void invalidateDisplayItemClient(const DisplayItemClient&) const;
1379 void slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(const Di splayItemClient& client, PaintInvalidationReason reason) const 1380 void invalidateDisplayItemClientsIncludingNonCompositingDescendants(const La youtBoxModelObject* paintInvalidationContainer, PaintInvalidationReason) const;
1380 {
1381 slowSetPaintingLayerNeedsRepaint();
1382 invalidateDisplayItemClient(client, reason);
1383 }
1384
1385 // Sets painting layer needsRepaint, then calls invaldiateDisplayItemClient( ).
1386 // Should use this version when PaintInvalidationState is available.
1387 void setPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(const PaintI nvalidationState&, const DisplayItemClient&, PaintInvalidationReason) const;
1388
1389 // The caller should ensure the painting layer has been setNeedsRepaint befo re calling this function.
1390 void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidation Reason) const;
1391
1392 void invalidateDisplayItemClientsIncludingNonCompositingDescendants(PaintInv alidationReason) const;
1393 1381
1394 // Called before anonymousChild.setStyle(). Override to set custom styles fo r the child. 1382 // Called before anonymousChild.setStyle(). Override to set custom styles fo r the child.
1395 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C omputedStyle& style) const { } 1383 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C omputedStyle& style) const { }
1396 1384
1397 // Painters can use const methods only, except for these explicitly declared methods. 1385 // Painters can use const methods only, except for these explicitly declared methods.
1398 class MutableForPainting { 1386 class MutableForPainting {
1399 public: 1387 public:
1400 void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutOb ject.setPreviousPaintOffset(paintOffset); } 1388 void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutOb ject.setPreviousPaintOffset(paintOffset); }
1401 ObjectPaintProperties& ensureObjectPaintProperties() { return m_layoutOb ject.ensureObjectPaintProperties(); } 1389 ObjectPaintProperties& ensureObjectPaintProperties() { return m_layoutOb ject.ensureObjectPaintProperties(); }
1402 void clearObjectPaintProperties() { m_layoutObject.clearObjectPaintPrope rties(); } 1390 void clearObjectPaintProperties() { m_layoutObject.clearObjectPaintPrope rties(); }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 // This function generates the invalidation for this object only. 1568 // This function generates the invalidation for this object only.
1581 // It doesn't recurse into other object, as this is handled 1569 // It doesn't recurse into other object, as this is handled
1582 // by invalidatePaintOfSubtreesIfNeeded. 1570 // by invalidatePaintOfSubtreesIfNeeded.
1583 virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidat ionState&); 1571 virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidat ionState&);
1584 1572
1585 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients 1573 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients
1586 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc., 1574 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc.,
1587 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and 1575 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and
1588 // parts which are invalidated separately (e.g. scrollbars). 1576 // parts which are invalidated separately (e.g. scrollbars).
1589 // The caller should ensure the painting layer has been setNeedsRepaint befo re calling this function. 1577 // The caller should ensure the painting layer has been setNeedsRepaint befo re calling this function.
1590 virtual void invalidateDisplayItemClients(PaintInvalidationReason) const; 1578 virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer, PaintInvalidationReason) const;
1591 1579
1592 // This calls paintingLayer() which walks up the tree.
1593 // If possible, use the faster paintInvalidationState.paintingLayer().setNee dsRepaint(). 1580 // If possible, use the faster paintInvalidationState.paintingLayer().setNee dsRepaint().
1594 void slowSetPaintingLayerNeedsRepaint() const; 1581 void setPaintingLayerNeedsRepaint() const;
1595 1582
1596 // Sets painting layer needsRepaint, then calls invalidateDisplayItemClients (). 1583 // Sets enclosing layer needsRepaint, then calls invalidateDisplayItemClient s().
1597 // Should use this version when PaintInvalidationState is available. 1584 // Should use this version when PaintInvalidationState is available.
1598 void invalidateDisplayItemClientsWithPaintInvalidationState(const PaintInval idationState&, PaintInvalidationReason) const; 1585 void invalidateDisplayItemClientsWithPaintInvalidationState(const LayoutBoxM odelObject& paintInvalidationContainer, const PaintInvalidationState&, PaintInva lidationReason) const;
1599 1586
1600 void setIsBackgroundAttachmentFixedObject(bool); 1587 void setIsBackgroundAttachmentFixedObject(bool);
1601 1588
1602 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); } 1589 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); }
1603 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate OverflowForPaint(true); } 1590 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate OverflowForPaint(true); }
1604 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } 1591 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); }
1605 1592
1606 // Remove this object and all descendants from the containing LayoutFlowThre ad. 1593 // Remove this object and all descendants from the containing LayoutFlowThre ad.
1607 void removeFromLayoutFlowThread(); 1594 void removeFromLayoutFlowThread();
1608 1595
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 void removeShapeImageClient(ShapeValue*); 1657 void removeShapeImageClient(ShapeValue*);
1671 1658
1672 #if ENABLE(ASSERT) 1659 #if ENABLE(ASSERT)
1673 void checkBlockPositionedObjectsNeedLayout(); 1660 void checkBlockPositionedObjectsNeedLayout();
1674 #endif 1661 #endif
1675 1662
1676 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; } 1663 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; }
1677 1664
1678 static bool isAllowedToModifyLayoutTreeStructure(Document&); 1665 static bool isAllowedToModifyLayoutTreeStructure(Document&);
1679 1666
1667 // The passed rect is mutated into the coordinate space of the paint invalid ation container.
1668 const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRec t&) const;
1669
1680 // Returns the parent for paint invalidation. 1670 // Returns the parent for paint invalidation.
1681 // - For LayoutView, returns the owner layout object in the containing frame if any or nullptr; 1671 // - For LayoutView, returns the owner layout object in the containing frame if any or nullptr;
1682 // - For multi-column spanner, returns the spanner placeholder; 1672 // - For multi-column spanner, returns the spanner placeholder;
1683 // - Otherwise returns parent(). 1673 // - Otherwise returns parent().
1684 LayoutObject* paintInvalidationParent() const; 1674 LayoutObject* paintInvalidationParent() const;
1685 1675
1686 static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUni t::max(), LayoutUnit::max()); } 1676 static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUni t::max(), LayoutUnit::max()); }
1687 1677
1688 RefPtr<ComputedStyle> m_style; 1678 RefPtr<ComputedStyle> m_style;
1689 1679
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2202 void showTree(const blink::LayoutObject*); 2192 void showTree(const blink::LayoutObject*);
2203 void showLineTree(const blink::LayoutObject*); 2193 void showLineTree(const blink::LayoutObject*);
2204 void showLayoutTree(const blink::LayoutObject* object1); 2194 void showLayoutTree(const blink::LayoutObject* object1);
2205 // We don't make object2 an optional parameter so that showLayoutTree 2195 // We don't make object2 an optional parameter so that showLayoutTree
2206 // can be called from gdb easily. 2196 // can be called from gdb easily.
2207 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 2197 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
2208 2198
2209 #endif 2199 #endif
2210 2200
2211 #endif // LayoutObject_h 2201 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.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