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

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

Issue 1416053003: Let synchronized painting generate correct paint invalidation rects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: For landing Created 5 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. 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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 LayoutRect computePaintInvalidationRect(const LayoutBoxModelObject* paintInv alidationContainer, const PaintInvalidationState* = nullptr) const; 1048 LayoutRect computePaintInvalidationRect(const LayoutBoxModelObject* paintInv alidationContainer, const PaintInvalidationState* = nullptr) const;
1049 1049
1050 // Returns the rect bounds needed to invalidate the paint of this object, in the coordinate space of the layoutObject backing of |paintInvalidationContainer | 1050 // Returns the rect bounds needed to invalidate the paint of this object, in the coordinate space of the layoutObject backing of |paintInvalidationContainer |
1051 LayoutRect boundsRectForPaintInvalidation(const LayoutBoxModelObject* paintI nvalidationContainer, const PaintInvalidationState* = nullptr) const; 1051 LayoutRect boundsRectForPaintInvalidation(const LayoutBoxModelObject* paintI nvalidationContainer, const PaintInvalidationState* = nullptr) const;
1052 1052
1053 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space 1053 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space
1054 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same 1054 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same
1055 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing. 1055 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing.
1056 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida tionContainer, const LayoutRect&, PaintInvalidationReason) const; 1056 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida tionContainer, const LayoutRect&, PaintInvalidationReason) const;
1057 1057
1058 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space. 1058 // Invalidate the paint of a specific subrectangle within a given object. Th e rect is in the object's coordinate space.
1059 void invalidatePaintRectangle(const LayoutRect&) const; 1059 void invalidatePaintRectangle(const LayoutRect&) const;
1060 void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutR ect&) const; 1060 void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutR ect&) const;
1061 1061
1062 // 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. 1062 // 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.
1063 virtual void invalidateTreeIfNeeded(PaintInvalidationState&); 1063 virtual void invalidateTreeIfNeeded(PaintInvalidationState&);
1064 1064
1065 virtual void invalidatePaintForOverflow(); 1065 virtual void invalidatePaintForOverflow();
1066 void invalidatePaintForOverflowIfNeeded(); 1066 void invalidatePaintForOverflowIfNeeded();
1067 1067
1068 void invalidatePaintIncludingNonCompositingDescendants(); 1068 void invalidatePaintIncludingNonCompositingDescendants();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 // FIXME: should we hook up scrollbar parts in the layout tree? crbug.com/48 4263. 1302 // FIXME: should we hook up scrollbar parts in the layout tree? crbug.com/48 4263.
1303 void invalidateDisplayItemClientForNonCompositingDescendantsOf(const LayoutO bject&) const; 1303 void invalidateDisplayItemClientForNonCompositingDescendantsOf(const LayoutO bject&) const;
1304 1304
1305 // Called before anonymousChild.setStyle(). Override to set custom styles fo r the child. 1305 // Called before anonymousChild.setStyle(). Override to set custom styles fo r the child.
1306 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C omputedStyle& style) const { } 1306 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C omputedStyle& style) const { }
1307 1307
1308 // Painters can use const methods only, except for these explicitly declared methods. 1308 // Painters can use const methods only, except for these explicitly declared methods.
1309 class MutableForPainting { 1309 class MutableForPainting {
1310 public: 1310 public:
1311 void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutOb ject.setPreviousPaintOffset(paintOffset); } 1311 void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutOb ject.setPreviousPaintOffset(paintOffset); }
1312 void invalidatePaintIfNeeded(const PaintInfo& paintInfo) { m_layoutObjec t.invalidatePaintIfNeededForSynchronizedPainting(paintInfo); }
1313 1312
1314 private: 1313 private:
1315 friend class LayoutObject; 1314 friend class LayoutObject;
1316 MutableForPainting(const LayoutObject& layoutObject) : m_layoutObject(co nst_cast<LayoutObject&>(layoutObject)) { } 1315 MutableForPainting(const LayoutObject& layoutObject) : m_layoutObject(co nst_cast<LayoutObject&>(layoutObject)) { }
1317 1316
1318 LayoutObject& m_layoutObject; 1317 LayoutObject& m_layoutObject;
1319 }; 1318 };
1320 MutableForPainting mutableForPainting() const { return MutableForPainting(*t his); } 1319 MutableForPainting mutableForPainting() const { return MutableForPainting(*t his); }
1321 1320
1322 protected: 1321 protected:
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 1442
1444 #if ENABLE(ASSERT) 1443 #if ENABLE(ASSERT)
1445 virtual bool paintInvalidationStateIsDirty() const 1444 virtual bool paintInvalidationStateIsDirty() const
1446 { 1445 {
1447 return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPain tInvalidationRegardlessOfPaintInvalidationState(); 1446 return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPain tInvalidationRegardlessOfPaintInvalidationState();
1448 } 1447 }
1449 #endif 1448 #endif
1450 1449
1451 virtual void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& child PaintInvalidationState); 1450 virtual void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& child PaintInvalidationState);
1452 virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationSta te&, const LayoutBoxModelObject& paintInvalidationContainer); 1451 virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationSta te&, const LayoutBoxModelObject& paintInvalidationContainer);
1453 void invalidatePaintIfNeededForSynchronizedPainting(const PaintInfo&);
1454 1452
1455 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients 1453 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients
1456 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc., 1454 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc.,
1457 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and 1455 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and
1458 // parts which are invalidated separately (e.g. scrollbars). 1456 // parts which are invalidated separately (e.g. scrollbars).
1459 virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer, PaintInvalidationReason, const LayoutRect& previousPaintIn validationRect, const LayoutRect& newPaintInvalidationRect) const; 1457 // |paintInvalidationRect| can be nullptr if we know it's unchanged and Pain tController has cached the
1458 // previous value; otherwise we must pass a correct value.
1459 virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer, PaintInvalidationReason, const LayoutRect* paintInvalidati onRect) const;
1460 1460
1461 void setIsBackgroundAttachmentFixedObject(bool); 1461 void setIsBackgroundAttachmentFixedObject(bool);
1462 1462
1463 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); } 1463 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); }
1464 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); } 1464 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); }
1465 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate OverflowForPaint(true); } 1465 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate OverflowForPaint(true); }
1466 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } 1466 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); }
1467 1467
1468 // Remove this object and all descendants from the containing LayoutFlowThre ad. 1468 // Remove this object and all descendants from the containing LayoutFlowThre ad.
1469 void removeFromLayoutFlowThread(); 1469 void removeFromLayoutFlowThread();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 1525
1526 #if ENABLE(ASSERT) 1526 #if ENABLE(ASSERT)
1527 void checkBlockPositionedObjectsNeedLayout(); 1527 void checkBlockPositionedObjectsNeedLayout();
1528 #endif 1528 #endif
1529 1529
1530 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; } 1530 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; }
1531 1531
1532 static bool isAllowedToModifyLayoutTreeStructure(Document&); 1532 static bool isAllowedToModifyLayoutTreeStructure(Document&);
1533 1533
1534 // The passed rect is mutated into the coordinate space of the paint invalid ation container. 1534 // The passed rect is mutated into the coordinate space of the paint invalid ation container.
1535 const LayoutBoxModelObject* invalidatePaintRectangleInternal(LayoutRect&) co nst; 1535 const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRec t&) const;
1536 1536
1537 static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUni t::max(), LayoutUnit::max()); } 1537 static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUni t::max(), LayoutUnit::max()); }
1538 1538
1539 RefPtr<ComputedStyle> m_style; 1539 RefPtr<ComputedStyle> m_style;
1540 1540
1541 // Oilpan: raw pointer back to the owning Node is considered safe. 1541 // Oilpan: raw pointer back to the owning Node is considered safe.
1542 GC_PLUGIN_IGNORE("http://crbug.com/509911") 1542 GC_PLUGIN_IGNORE("http://crbug.com/509911")
1543 Node* m_node; 1543 Node* m_node;
1544 1544
1545 LayoutObject* m_parent; 1545 LayoutObject* m_parent;
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 void showTree(const blink::LayoutObject*); 2040 void showTree(const blink::LayoutObject*);
2041 void showLineTree(const blink::LayoutObject*); 2041 void showLineTree(const blink::LayoutObject*);
2042 void showLayoutTree(const blink::LayoutObject* object1); 2042 void showLayoutTree(const blink::LayoutObject* object1);
2043 // We don't make object2 an optional parameter so that showLayoutTree 2043 // We don't make object2 an optional parameter so that showLayoutTree
2044 // can be called from gdb easily. 2044 // can be called from gdb easily.
2045 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 2045 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
2046 2046
2047 #endif 2047 #endif
2048 2048
2049 #endif // LayoutObject_h 2049 #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