Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutObject.h |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h |
| index f417cda7e924dfa9a6c8d8b82ffda4a83e200ad5..8aede092bb0d15c5482e4b438b27d235c2512135 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.h |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.h |
| @@ -1128,7 +1128,6 @@ public: |
| // Invalidate the paint of a specific subrectangle within a given object. The rect is in the object's coordinate space. |
| void invalidatePaintRectangle(const LayoutRect&) const; |
| - void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutRect&) const; |
| // Walk the tree after layout issuing paint invalidations for layoutObjects that have changed or moved, updating bounds that have changed, and clearing paint invalidation state. |
| virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); |
| @@ -1376,8 +1375,21 @@ public: |
| virtual LayoutRect viewRect() const; |
| - void invalidateDisplayItemClient(const DisplayItemClient&) const; |
| - void invalidateDisplayItemClientsIncludingNonCompositingDescendants(const LayoutBoxModelObject* paintInvalidationContainer, PaintInvalidationReason) const; |
| + // TODO(wangxianzhu): Change the call sites to use the faster version if possible. |
| + void slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(const DisplayItemClient& client, PaintInvalidationReason reason) const |
| + { |
| + slowSetPaintingLayerNeedsRepaint(); |
|
chrishtr
2016/06/13 20:18:52
Document why it's slow.
Xianzhu
2016/06/13 20:52:01
Done.
|
| + invalidateDisplayItemClient(client, reason); |
| + } |
| + |
| + // The caller should ensure the painting layer has been setNeedsRepaint before calling this function. |
| + void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidationReason) const; |
| + |
| + // Sets painting layer needsRepaint, then calls invaldiateDisplayItemClient(). |
| + // Should use this version when PaintInvalidationState is available. |
| + void invalidateDisplayItemClientWithPaintInvalidationState(const PaintInvalidationState&, const DisplayItemClient&, PaintInvalidationReason) const; |
| + |
| + void invalidateDisplayItemClientsIncludingNonCompositingDescendants(PaintInvalidationReason) const; |
| // Called before anonymousChild.setStyle(). Override to set custom styles for the child. |
| virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, ComputedStyle& style) const { } |
| @@ -1575,14 +1587,14 @@ protected: |
| // not including children which will be invalidated normally during invalidateTreeIfNeeded() and |
| // parts which are invalidated separately (e.g. scrollbars). |
| // The caller should ensure the painting layer has been setNeedsRepaint before calling this function. |
| - virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason) const; |
| + virtual void invalidateDisplayItemClients(PaintInvalidationReason) const; |
| // If possible, use the faster paintInvalidationState.paintingLayer().setNeedsRepaint(). |
| - void setPaintingLayerNeedsRepaint() const; |
| + void slowSetPaintingLayerNeedsRepaint() const; |
| - // Sets enclosing layer needsRepaint, then calls invalidateDisplayItemClients(). |
| + // Sets painting layer needsRepaint, then calls invalidateDisplayItemClients(). |
| // Should use this version when PaintInvalidationState is available. |
| - void invalidateDisplayItemClientsWithPaintInvalidationState(const LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState&, PaintInvalidationReason) const; |
| + void invalidateDisplayItemClientsWithPaintInvalidationState(const PaintInvalidationState&, PaintInvalidationReason) const; |
| void setIsBackgroundAttachmentFixedObject(bool); |
| @@ -1664,9 +1676,6 @@ private: |
| static bool isAllowedToModifyLayoutTreeStructure(Document&); |
| - // The passed rect is mutated into the coordinate space of the paint invalidation container. |
| - const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRect&) const; |
| - |
| // Returns the parent for paint invalidation. |
| // - For LayoutView, returns the owner layout object in the containing frame if any or nullptr; |
| // - For multi-column spanner, returns the spanner placeholder; |