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

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

Issue 2208463003: First step of PaintInvalidator implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 class LayoutFlowThread; 61 class LayoutFlowThread;
62 class LayoutGeometryMap; 62 class LayoutGeometryMap;
63 class LayoutMultiColumnSpannerPlaceholder; 63 class LayoutMultiColumnSpannerPlaceholder;
64 class LayoutView; 64 class LayoutView;
65 class ObjectPaintProperties; 65 class ObjectPaintProperties;
66 class PaintLayer; 66 class PaintLayer;
67 class PseudoStyleRequest; 67 class PseudoStyleRequest;
68 class TransformState; 68 class TransformState;
69 69
70 struct PaintInfo; 70 struct PaintInfo;
71 struct PaintInvalidatorContext;
71 72
72 enum CursorDirective { 73 enum CursorDirective {
73 SetCursorBasedOnStyle, 74 SetCursorBasedOnStyle,
74 SetCursor, 75 SetCursor,
75 DoNotSetCursor 76 DoNotSetCursor
76 }; 77 };
77 78
78 enum HitTestFilter { 79 enum HitTestFilter {
79 HitTestAll, 80 HitTestAll,
80 HitTestSelf, 81 HitTestSelf,
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling(const L ayoutBoxModelObject& paintInvalidationContainer) const; 1301 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling(const L ayoutBoxModelObject& paintInvalidationContainer) const;
1301 LayoutSize previousPaintInvalidationRectSize() const { return previousPaintI nvalidationRect().size(); } 1302 LayoutSize previousPaintInvalidationRectSize() const { return previousPaintI nvalidationRect().size(); }
1302 1303
1303 // Called when the previous paint invalidation rect(s) is no longer valid. 1304 // Called when the previous paint invalidation rect(s) is no longer valid.
1304 virtual void clearPreviousPaintInvalidationRects(); 1305 virtual void clearPreviousPaintInvalidationRects();
1305 1306
1306 // Only adjusts if the paint invalidation container is not a composited scro ller. 1307 // Only adjusts if the paint invalidation container is not a composited scro ller.
1307 void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scro llDelta); 1308 void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scro llDelta);
1308 1309
1309 // The previous position of the top-left corner of the object in its previou s paint backing. 1310 // The previous position of the top-left corner of the object in its previou s paint backing.
1310 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const 1311 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re turn m_previousPositionFromPaintInvalidationBacking; }
1311 { 1312 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki ng = positionFromPaintInvalidationBacking; }
1312 ASSERT(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
1313 return m_previousPositionFromPaintInvalidationBacking;
1314 }
1315 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking)
1316 {
1317 ASSERT(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
1318 m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvali dationBacking;
1319 }
1320 1313
1321 bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const 1314 bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const
1322 { 1315 {
1323 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); 1316 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
1324 return m_previousPositionFromPaintInvalidationBacking != uninitializedPa intOffset() && m_previousPositionFromPaintInvalidationBacking != newPaintOffset; 1317 return m_previousPositionFromPaintInvalidationBacking != uninitializedPa intOffset() && m_previousPositionFromPaintInvalidationBacking != newPaintOffset;
1325 } 1318 }
1326 void setPreviousPaintOffset(const LayoutPoint& paintOffset) 1319 void setPreviousPaintOffset(const LayoutPoint& paintOffset)
1327 { 1320 {
1328 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); 1321 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
1329 m_previousPositionFromPaintInvalidationBacking = paintOffset; 1322 m_previousPositionFromPaintInvalidationBacking = paintOffset;
1330 } 1323 }
1331 1324
1332 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); } 1325 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); }
1333 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; } 1326 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; }
1334 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull); 1327 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull);
1335 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); } 1328 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); }
1336 1329
1337 virtual void clearPaintInvalidationFlags(const PaintInvalidationState&); 1330 virtual void clearPaintInvalidationFlags();
1338 1331
1339 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } 1332 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); }
1340 void setMayNeedPaintInvalidation(); 1333 void setMayNeedPaintInvalidation();
1341 1334
1342 bool mayNeedPaintInvalidationSubtree() const { return m_bitfields.mayNeedPai ntInvalidationSubtree(); } 1335 bool mayNeedPaintInvalidationSubtree() const { return m_bitfields.mayNeedPai ntInvalidationSubtree(); }
1343 void setMayNeedPaintInvalidationSubtree(); 1336 void setMayNeedPaintInvalidationSubtree();
1344 1337
1345 bool mayNeedPaintInvalidationAnimatedBackgroundImage() const { return m_bitf ields.mayNeedPaintInvalidationAnimatedBackgroundImage(); } 1338 bool mayNeedPaintInvalidationAnimatedBackgroundImage() const { return m_bitf ields.mayNeedPaintInvalidationAnimatedBackgroundImage(); }
1346 void setMayNeedPaintInvalidationAnimatgedBackgroundImage(); 1339 void setMayNeedPaintInvalidationAnimatgedBackgroundImage();
1347 1340
(...skipping 26 matching lines...) Expand all
1374 1367
1375 // Sets painting layer needsRepaint, then calls invaldiateDisplayItemClient( ). 1368 // Sets painting layer needsRepaint, then calls invaldiateDisplayItemClient( ).
1376 // Should use this version when PaintInvalidationState is available. 1369 // Should use this version when PaintInvalidationState is available.
1377 void setPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(const PaintI nvalidationState&, const DisplayItemClient&, PaintInvalidationReason) const; 1370 void setPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(const PaintI nvalidationState&, const DisplayItemClient&, PaintInvalidationReason) const;
1378 1371
1379 // The caller should ensure the painting layer has been setNeedsRepaint befo re calling this function. 1372 // The caller should ensure the painting layer has been setNeedsRepaint befo re calling this function.
1380 void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidation Reason) const; 1373 void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidation Reason) const;
1381 1374
1382 void invalidateDisplayItemClientsIncludingNonCompositingDescendants(PaintInv alidationReason) const; 1375 void invalidateDisplayItemClientsIncludingNonCompositingDescendants(PaintInv alidationReason) const;
1383 1376
1377 // New version to replace the above old version.
1378 virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidat orContext&) const;
1379
1380 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients
1381 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc.,
1382 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and
1383 // parts which are invalidated separately (e.g. scrollbars).
1384 // The caller should ensure the painting layer has been setNeedsRepaint befo re calling this function.
1385 virtual void invalidateDisplayItemClients(PaintInvalidationReason) const;
1386
1387 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; }
1388
1389 virtual bool hasNonCompositedScrollbars() const { return false; }
1390
1384 // Called before anonymousChild.setStyle(). Override to set custom styles fo r the child. 1391 // Called before anonymousChild.setStyle(). Override to set custom styles fo r the child.
1385 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C omputedStyle& style) const { } 1392 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C omputedStyle& style) const { }
1386 1393
1387 // Painters can use const methods only, except for these explicitly declared methods. 1394 // Painters can use const methods only, except for these explicitly declared methods.
1388 class MutableForPainting { 1395 class MutableForPainting {
1389 public: 1396 public:
1390 void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutOb ject.setPreviousPaintOffset(paintOffset); } 1397 void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutOb ject.setPreviousPaintOffset(paintOffset); }
1391 PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidationS tate& paintInvalidationState) { return m_layoutObject.invalidatePaintIfNeeded(pa intInvalidationState); } 1398 void clearPaintInvalidationFlags() { m_layoutObject.clearPaintInvalidati onFlags(); }
1392 void clearPaintInvalidationFlags(const PaintInvalidationState& paintInva lidationState) { m_layoutObject.clearPaintInvalidationFlags(paintInvalidationSta te); } 1399 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { m_layoutObject.setShouldDoFullPaintInvalidation(reason); }
1393 void setShouldDoDelayedFullPaintInvalidation() { m_layoutObject.setShoul dDoFullPaintInvalidation(PaintInvalidationDelayedFull); } 1400
1401 void setPreviousPaintInvalidationRect(const LayoutRect& r) { m_layoutObj ect.setPreviousPaintInvalidationRect(r); }
1402 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& p) { m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p); }
1403 void setPreviousBackgroundObscured(bool b) { m_layoutObject.setPreviousB ackgroundObscured(b); }
1394 1404
1395 private: 1405 private:
1396 friend class PaintPropertyTreeBuilder; 1406 friend class PaintPropertyTreeBuilder;
1397 // The following two functions can be called from PaintPropertyTreeBuild er only. 1407 // The following two functions can be called from PaintPropertyTreeBuild er only.
1398 ObjectPaintProperties& ensureObjectPaintProperties() { return m_layoutOb ject.ensureObjectPaintProperties(); } 1408 ObjectPaintProperties& ensureObjectPaintProperties() { return m_layoutOb ject.ensureObjectPaintProperties(); }
1399 ObjectPaintProperties* objectPaintProperties() { return const_cast<Objec tPaintProperties*>(m_layoutObject.objectPaintProperties()); } 1409 ObjectPaintProperties* objectPaintProperties() { return const_cast<Objec tPaintProperties*>(m_layoutObject.objectPaintProperties()); }
1400 1410
1401 friend class LayoutObject; 1411 friend class LayoutObject;
1402 MutableForPainting(const LayoutObject& layoutObject) : m_layoutObject(co nst_cast<LayoutObject&>(layoutObject)) { } 1412 MutableForPainting(const LayoutObject& layoutObject) : m_layoutObject(co nst_cast<LayoutObject&>(layoutObject)) { }
1403 1413
1404 LayoutObject& m_layoutObject; 1414 LayoutObject& m_layoutObject;
1405 }; 1415 };
1406 MutableForPainting getMutableForPainting() const { return MutableForPainting (*this); } 1416 MutableForPainting getMutableForPainting() const { return MutableForPainting (*this); }
1407 1417
1408 void setIsScrollAnchorObject() { m_bitfields.setIsScrollAnchorObject(true); } 1418 void setIsScrollAnchorObject() { m_bitfields.setIsScrollAnchorObject(true); }
1409 // Clears the IsScrollAnchorObject bit, unless any ScrollAnchor still refers to us. 1419 // Clears the IsScrollAnchorObject bit, unless any ScrollAnchor still refers to us.
1410 void maybeClearIsScrollAnchorObject(); 1420 void maybeClearIsScrollAnchorObject();
1411 1421
1412 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); } 1422 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); }
1413 1423
1414 bool compositedScrollsWithRespectTo(const LayoutBoxModelObject& paintInvalid ationContainer) const; 1424 bool compositedScrollsWithRespectTo(const LayoutBoxModelObject& paintInvalid ationContainer) const;
1415 IntSize scrollAdjustmentForPaintInvalidation(const LayoutBoxModelObject& pai ntInvalidationContainer) const; 1425 IntSize scrollAdjustmentForPaintInvalidation(const LayoutBoxModelObject& pai ntInvalidationContainer) const;
1416 1426
1427 bool previousBackgroundObscured() const { return m_bitfields.previousBackgro undObscured(); }
1428 void setPreviousBackgroundObscured(bool b) { m_bitfields.setPreviousBackgrou ndObscured(b); }
1429
1417 protected: 1430 protected:
1418 enum LayoutObjectType { 1431 enum LayoutObjectType {
1419 LayoutObjectBr, 1432 LayoutObjectBr,
1420 LayoutObjectCanvas, 1433 LayoutObjectCanvas,
1421 LayoutObjectFieldset, 1434 LayoutObjectFieldset,
1422 LayoutObjectCounter, 1435 LayoutObjectCounter,
1423 LayoutObjectDetailsMarker, 1436 LayoutObjectDetailsMarker,
1424 LayoutObjectEmbeddedObject, 1437 LayoutObjectEmbeddedObject,
1425 LayoutObjectFileUploadControl, 1438 LayoutObjectFileUploadControl,
1426 LayoutObjectFrame, 1439 LayoutObjectFrame,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 // be a container for child elements. Any rect wholly contained by container Rect can be 1541 // be a container for child elements. Any rect wholly contained by container Rect can be
1529 // skipped. 1542 // skipped.
1530 virtual void addLayerHitTestRects(LayerHitTestRects&, const PaintLayer* curr entLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) const ; 1543 virtual void addLayerHitTestRects(LayerHitTestRects&, const PaintLayer* curr entLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) const ;
1531 1544
1532 // Add hit-test rects for this layoutObject only to the provided list. layer Offset is the offset 1545 // Add hit-test rects for this layoutObject only to the provided list. layer Offset is the offset
1533 // of this layoutObject within the current layer that should be used for eac h result. 1546 // of this layoutObject within the current layer that should be used for eac h result.
1534 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const { } 1547 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const { }
1535 1548
1536 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; } 1549 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; }
1537 1550
1538 virtual PaintInvalidationReason getPaintInvalidationReason(const PaintInvali dationState&,
1539 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi onFromPaintInvalidationBacking,
1540 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi onFromPaintInvalidationBacking) const;
1541
1542 // This function tries to minimize the amount of invalidation
1543 // generated by invalidating the "difference" between |oldBounds|
1544 // and |newBounds|. This means invalidating the union of the
1545 // previous rectangles but not their intersection.
1546 //
1547 // The use case is when an element only requires a paint
1548 // invalidation (which means that its content didn't change)
1549 // and its bounds changed but its location didn't.
1550 //
1551 // If we don't meet the criteria for an incremental paint, the
1552 // alternative is a full paint invalidation.
1553 virtual void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintI nvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const LayoutPoint& positionFromPaintInvalidationBacking);
1554
1555 virtual bool hasNonCompositedScrollbars() const { return false; }
1556
1557 #if ENABLE(ASSERT) 1551 #if ENABLE(ASSERT)
1558 virtual bool paintInvalidationStateIsDirty() const 1552 virtual bool paintInvalidationStateIsDirty() const
1559 { 1553 {
1560 return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState (); 1554 return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState ();
1561 } 1555 }
1562 #endif 1556 #endif
1563 1557
1564 // This function walks the descendants of |this|, following a 1558 // This function walks the descendants of |this|, following a
1565 // layout ordering. 1559 // layout ordering.
1566 // 1560 //
1567 // The ordering is important for PaintInvalidationState, as 1561 // The ordering is important for PaintInvalidationState, as
1568 // it requires to be called following a descendant/container 1562 // it requires to be called following a descendant/container
1569 // relationship. 1563 // relationship.
1570 // 1564 //
1571 // The function is overridden to handle special children 1565 // The function is overridden to handle special children
1572 // (e.g. percentage height descendants or reflections). 1566 // (e.g. percentage height descendants or reflections).
1573 virtual void invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState); 1567 virtual void invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState);
1574 1568
1575 // This function generates the invalidation for this object only. 1569 // This function generates the invalidation for this object only.
1576 // It doesn't recurse into other object, as this is handled 1570 // It doesn't recurse into other object, as this is handled
1577 // by invalidatePaintOfSubtreesIfNeeded. 1571 // by invalidatePaintOfSubtreesIfNeeded.
1578 virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidat ionState&); 1572 virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidat ionState&);
1579 1573
1580 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients
1581 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc.,
1582 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and
1583 // parts which are invalidated separately (e.g. scrollbars).
1584 // The caller should ensure the painting layer has been setNeedsRepaint befo re calling this function.
1585 virtual void invalidateDisplayItemClients(PaintInvalidationReason) const;
1586
1587 // Sets painting layer needsRepaint, then calls invalidateDisplayItemClients ().
1588 // Should use this version when PaintInvalidationState is available.
1589 void invalidateDisplayItemClientsWithPaintInvalidationState(const PaintInval idationState&, PaintInvalidationReason) const;
1590
1591 void setIsBackgroundAttachmentFixedObject(bool); 1574 void setIsBackgroundAttachmentFixedObject(bool);
1592 1575
1593 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); } 1576 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); }
1594 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } 1577 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); }
1595 1578
1596 // Remove this object and all descendants from the containing LayoutFlowThre ad. 1579 // Remove this object and all descendants from the containing LayoutFlowThre ad.
1597 void removeFromLayoutFlowThread(); 1580 void removeFromLayoutFlowThread();
1598 1581
1599 bool containsInlineWithOutlineAndContinuation() const { return m_bitfields.c ontainsInlineWithOutlineAndContinuation(); } 1582 bool containsInlineWithOutlineAndContinuation() const { return m_bitfields.c ontainsInlineWithOutlineAndContinuation(); }
1600 void setContainsInlineWithOutlineAndContinuation(bool b) { m_bitfields.setCo ntainsInlineWithOutlineAndContinuation(b); } 1583 void setContainsInlineWithOutlineAndContinuation(bool b) { m_bitfields.setCo ntainsInlineWithOutlineAndContinuation(b); }
1601 1584
1602 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; }
1603
1604 private: 1585 private:
1605 // This function generates a full invalidation, which
1606 // means invalidating both |oldBounds| and |newBounds|.
1607 //
1608 // This is the default choice when generating an invalidation,
1609 // as it is always correct, albeit it may force some extra painting.
1610 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne wBounds);
1611
1612 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid ationRect| and |m_previousPositionFromPaintInvalidationBacking| 1586 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid ationRect| and |m_previousPositionFromPaintInvalidationBacking|
1613 // to be in the space of the |paintInvalidationContainer|, 1587 // to be in the space of the |paintInvalidationContainer|,
1614 // if needed. They can be different only if |paintInvalidationContainer| is a composited scroller. 1588 // if needed. They can be different only if |paintInvalidationContainer| is a composited scroller.
1615 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB oxModelObject& paintInvalidationContainer) const; 1589 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB oxModelObject& paintInvalidationContainer) const;
1616 1590
1617 void clearLayoutRootIfNeeded() const; 1591 void clearLayoutRootIfNeeded() const;
1618 1592
1619 bool isInert() const; 1593 bool isInert() const;
1620 1594
1621 void updateImage(StyleImage*, StyleImage*); 1595 void updateImage(StyleImage*, StyleImage*);
1622 1596
1623 void scheduleRelayout(); 1597 void scheduleRelayout();
1624 1598
1625 void updateShapeImage(const ShapeValue*, const ShapeValue*); 1599 void updateShapeImage(const ShapeValue*, const ShapeValue*);
1626 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers ); 1600 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers );
1627 void updateCursorImages(const CursorList* oldCursors, const CursorList* newC ursors); 1601 void updateCursorImages(const CursorList* oldCursors, const CursorList* newC ursors);
1628 1602
1629 void setNeedsOverflowRecalcAfterStyleChange(); 1603 void setNeedsOverflowRecalcAfterStyleChange();
1630 1604
1631 // FIXME: This should be 'markContaingBoxChainForOverflowRecalc when we make LayoutBox 1605 // FIXME: This should be 'markContaingBoxChainForOverflowRecalc when we make LayoutBox
1632 // recomputeOverflow-capable. crbug.com/437012 and crbug.com/434700. 1606 // recomputeOverflow-capable. crbug.com/437012 and crbug.com/434700.
1633 inline void markAncestorsForOverflowRecalcIfNeeded(); 1607 inline void markAncestorsForOverflowRecalcIfNeeded();
1634 1608
1635 inline void markAncestorsForPaintInvalidation(); 1609 inline void markAncestorsForPaintInvalidation();
1636 1610
1637 inline void invalidateSelectionIfNeeded(const LayoutBoxModelObject& paintInv alidationContainer, const PaintInvalidationState&, PaintInvalidationReason);
1638
1639 inline void invalidateContainerPreferredLogicalWidths(); 1611 inline void invalidateContainerPreferredLogicalWidths();
1640 1612
1641 void invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(const L ayoutBoxModelObject& paintInvalidationContainer); 1613 void invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(const L ayoutBoxModelObject& paintInvalidationContainer);
1642 1614
1643 // The caller should ensure the painting layer has been setNeedsRepaint befo re calling this function. 1615 // The caller should ensure the painting layer has been setNeedsRepaint befo re calling this function.
1644 void invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBoxModelObje ct& paintInvalidationContainer, PaintInvalidationReason); 1616 void invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBoxModelObje ct& paintInvalidationContainer, PaintInvalidationReason);
1645 1617
1646 LayoutRect previousSelectionRectForPaintInvalidation() const;
1647 void setPreviousSelectionRectForPaintInvalidation(const LayoutRect&);
1648
1649 LayoutObject* containerForAbsolutePosition(const LayoutBoxModelObject* ances tor = nullptr, bool* ancestorSkipped = nullptr, bool* filterOrReflectionSkipped = nullptr) const; 1618 LayoutObject* containerForAbsolutePosition(const LayoutBoxModelObject* ances tor = nullptr, bool* ancestorSkipped = nullptr, bool* filterOrReflectionSkipped = nullptr) const;
1650 1619
1651 const LayoutBoxModelObject* enclosingCompositedContainer() const; 1620 const LayoutBoxModelObject* enclosingCompositedContainer() const;
1652 1621
1653 LayoutFlowThread* locateFlowThreadContainingBlock() const; 1622 LayoutFlowThread* locateFlowThreadContainingBlock() const;
1654 void removeFromLayoutFlowThreadRecursive(LayoutFlowThread*); 1623 void removeFromLayoutFlowThreadRecursive(LayoutFlowThread*);
1655 1624
1656 ComputedStyle* cachedFirstLineStyle() const; 1625 ComputedStyle* cachedFirstLineStyle() const;
1657 StyleDifference adjustStyleDifference(StyleDifference) const; 1626 StyleDifference adjustStyleDifference(StyleDifference) const;
1658 1627
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
2187 void showTree(const blink::LayoutObject*); 2156 void showTree(const blink::LayoutObject*);
2188 void showLineTree(const blink::LayoutObject*); 2157 void showLineTree(const blink::LayoutObject*);
2189 void showLayoutTree(const blink::LayoutObject* object1); 2158 void showLayoutTree(const blink::LayoutObject* object1);
2190 // We don't make object2 an optional parameter so that showLayoutTree 2159 // We don't make object2 an optional parameter so that showLayoutTree
2191 // can be called from gdb easily. 2160 // can be called from gdb easily.
2192 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 2161 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
2193 2162
2194 #endif 2163 #endif
2195 2164
2196 #endif // LayoutObject_h 2165 #endif // LayoutObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698