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

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: 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 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 1009
1010 // Returns the paint invalidation rect for this LayoutObject in the coordina te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation Container|. 1010 // Returns the paint invalidation rect for this LayoutObject in the coordina te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation Container|.
1011 LayoutRect computePaintInvalidationRect(const LayoutBoxModelObject* paintInv alidationContainer, const PaintInvalidationState* = nullptr) const; 1011 LayoutRect computePaintInvalidationRect(const LayoutBoxModelObject* paintInv alidationContainer, const PaintInvalidationState* = nullptr) const;
1012 1012
1013 // Returns the rect bounds needed to invalidate the paint of this object, in the coordinate space of the layoutObject backing of |paintInvalidationContainer | 1013 // Returns the rect bounds needed to invalidate the paint of this object, in the coordinate space of the layoutObject backing of |paintInvalidationContainer |
1014 LayoutRect boundsRectForPaintInvalidation(const LayoutBoxModelObject* paintI nvalidationContainer, const PaintInvalidationState* = nullptr) const; 1014 LayoutRect boundsRectForPaintInvalidation(const LayoutBoxModelObject* paintI nvalidationContainer, const PaintInvalidationState* = nullptr) const;
1015 1015
1016 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space 1016 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space
1017 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same 1017 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same
1018 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing. 1018 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing.
1019 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida tionContainer, const LayoutRect&, PaintInvalidationReason) const; 1019 // In synchronized painting mode, this method appends the rect into paintInv alidationRects without sending the rect
1020 // to the GraphicsLayer backing.
1021 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida tionContainer, const LayoutRect&, PaintInvalidationReason, Vector<LayoutRect>& p aintInvalidationRects) const;
1020 1022
1021 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space. 1023 // Invalidate the paint of a specific subrectangle within a given object. Th e rect is in this object's coordinate space.
1022 void invalidatePaintRectangle(const LayoutRect&) const; 1024 void invalidatePaintRectangle(const LayoutRect& r) const { invalidatePaintRe ctangleForDisplayItemClient(*this, r); }
1023 void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutR ect&) const; 1025
1026 void invalidatePaintRectangleForDisplayItemClient(const DisplayItemClientWra pper&, const LayoutRect&) const;
1024 1027
1025 // 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. 1028 // 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.
1026 virtual void invalidateTreeIfNeeded(PaintInvalidationState&); 1029 virtual void invalidateTreeIfNeeded(PaintInvalidationState&);
1027 1030
1028 virtual void invalidatePaintForOverflow(); 1031 virtual void invalidatePaintForOverflow();
1029 void invalidatePaintForOverflowIfNeeded(); 1032 void invalidatePaintForOverflowIfNeeded();
1030 1033
1031 void invalidatePaintIncludingNonCompositingDescendants(); 1034 void invalidatePaintIncludingNonCompositingDescendants();
1032 void invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBox ModelObject& paintInvalidationContainer); 1035 void invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBox ModelObject& paintInvalidationContainer);
1033 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); 1036 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 // skipped. 1394 // skipped.
1392 virtual void addLayerHitTestRects(LayerHitTestRects&, const PaintLayer* curr entLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) const ; 1395 virtual void addLayerHitTestRects(LayerHitTestRects&, const PaintLayer* curr entLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) const ;
1393 1396
1394 // Add hit-test rects for this layoutObject only to the provided list. layer Offset is the offset 1397 // Add hit-test rects for this layoutObject only to the provided list. layer Offset is the offset
1395 // of this layoutObject within the current layer that should be used for eac h result. 1398 // of this layoutObject within the current layer that should be used for eac h result.
1396 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const { } 1399 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const { }
1397 1400
1398 virtual PaintInvalidationReason paintInvalidationReason(const LayoutBoxModel Object& paintInvalidationContainer, 1401 virtual PaintInvalidationReason paintInvalidationReason(const LayoutBoxModel Object& paintInvalidationContainer,
1399 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi onFromPaintInvalidationBacking, 1402 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi onFromPaintInvalidationBacking,
1400 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi onFromPaintInvalidationBacking) const; 1403 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi onFromPaintInvalidationBacking) const;
1401 virtual void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintI nvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const LayoutPoint& positionFromPaintInvalidationBacking); 1404 virtual void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintI nvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const LayoutPoint& positionFromPaintInvalidationBacking, Vector<LayoutRect>& pai ntInvalidationRects);
1402 1405
1403 virtual bool hasNonCompositedScrollbars() const { return false; } 1406 virtual bool hasNonCompositedScrollbars() const { return false; }
1404 1407
1405 #if ENABLE(ASSERT) 1408 #if ENABLE(ASSERT)
1406 virtual bool paintInvalidationStateIsDirty() const 1409 virtual bool paintInvalidationStateIsDirty() const
1407 { 1410 {
1408 return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPain tInvalidationRegardlessOfPaintInvalidationState(); 1411 return m_bitfields.neededLayoutBecauseOfChildren() || shouldCheckForPain tInvalidationRegardlessOfPaintInvalidationState();
1409 } 1412 }
1410 #endif 1413 #endif
1411 1414
1412 virtual void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& child PaintInvalidationState); 1415 virtual void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& child PaintInvalidationState);
1413 virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationSta te&, const LayoutBoxModelObject& paintInvalidationContainer); 1416 virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationSta te&, const LayoutBoxModelObject& paintInvalidationContainer);
1414 void invalidatePaintIfNeededForSynchronizedPainting(const PaintInfo&); 1417 void invalidatePaintIfNeededForSynchronizedPainting(const PaintInfo&);
1415 1418
1416 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients 1419 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients
1417 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc., 1420 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc.,
1418 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and 1421 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and
1419 // parts which are invalidated separately (e.g. scrollbars). 1422 // parts which are invalidated separately (e.g. scrollbars).
1420 virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer, PaintInvalidationReason, const LayoutRect& previousPaintIn validationRect, const LayoutRect& newPaintInvalidationRect) const; 1423 virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer, PaintInvalidationReason, const Vector<LayoutRect>& paintIn validationRects) const;
1421 1424
1422 void setIsBackgroundAttachmentFixedObject(bool); 1425 void setIsBackgroundAttachmentFixedObject(bool);
1423 1426
1424 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); } 1427 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); }
1425 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); } 1428 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); }
1426 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate OverflowForPaint(true); } 1429 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate OverflowForPaint(true); }
1427 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } 1430 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); }
1428 1431
1429 // Remove this object and all descendants from the containing LayoutFlowThre ad. 1432 // Remove this object and all descendants from the containing LayoutFlowThre ad.
1430 void removeFromLayoutFlowThread(); 1433 void removeFromLayoutFlowThread();
1431 1434
1432 bool containsInlineWithOutlineAndContinuation() const { return m_bitfields.c ontainsInlineWithOutlineAndContinuation(); } 1435 bool containsInlineWithOutlineAndContinuation() const { return m_bitfields.c ontainsInlineWithOutlineAndContinuation(); }
1433 void setContainsInlineWithOutlineAndContinuation(bool b) { m_bitfields.setCo ntainsInlineWithOutlineAndContinuation(b); } 1436 void setContainsInlineWithOutlineAndContinuation(bool b) { m_bitfields.setCo ntainsInlineWithOutlineAndContinuation(b); }
1434 1437
1435 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; } 1438 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; }
1436 1439
1437 private: 1440 private:
1438 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne wBounds); 1441 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne wBounds, Vector<LayoutRect>& paintInvalidationRects);
1439 1442
1440 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid ationRect| and |m_previousPositionFromPaintInvalidationBacking| 1443 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid ationRect| and |m_previousPositionFromPaintInvalidationBacking|
1441 // to be in the space of the |paintInvalidationContainer|, 1444 // to be in the space of the |paintInvalidationContainer|,
1442 // if needed. They can be different only if |paintInvalidationContainer| is a composited scroller. 1445 // if needed. They can be different only if |paintInvalidationContainer| is a composited scroller.
1443 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB oxModelObject& paintInvalidationContainer) const; 1446 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB oxModelObject& paintInvalidationContainer) const;
1444 1447
1445 void clearLayoutRootIfNeeded() const; 1448 void clearLayoutRootIfNeeded() const;
1446 1449
1447 bool isInert() const; 1450 bool isInert() const;
1448 1451
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 void removeShapeImageClient(ShapeValue*); 1488 void removeShapeImageClient(ShapeValue*);
1486 1489
1487 #if ENABLE(ASSERT) 1490 #if ENABLE(ASSERT)
1488 void checkBlockPositionedObjectsNeedLayout(); 1491 void checkBlockPositionedObjectsNeedLayout();
1489 #endif 1492 #endif
1490 1493
1491 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; } 1494 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; }
1492 1495
1493 static bool isAllowedToModifyLayoutTreeStructure(Document&); 1496 static bool isAllowedToModifyLayoutTreeStructure(Document&);
1494 1497
1495 // The passed rect is mutated into the coordinate space of the paint invalid ation container.
1496 const LayoutBoxModelObject* invalidatePaintRectangleInternal(LayoutRect&) co nst;
1497
1498 static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUni t::max(), LayoutUnit::max()); } 1498 static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUni t::max(), LayoutUnit::max()); }
1499 1499
1500 RefPtr<ComputedStyle> m_style; 1500 RefPtr<ComputedStyle> m_style;
1501 1501
1502 // Oilpan: raw pointer back to the owning Node is considered safe. 1502 // Oilpan: raw pointer back to the owning Node is considered safe.
1503 GC_PLUGIN_IGNORE("http://crbug.com/509911") 1503 GC_PLUGIN_IGNORE("http://crbug.com/509911")
1504 Node* m_node; 1504 Node* m_node;
1505 1505
1506 LayoutObject* m_parent; 1506 LayoutObject* m_parent;
1507 LayoutObject* m_previous; 1507 LayoutObject* m_previous;
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
2001 void showTree(const blink::LayoutObject*); 2001 void showTree(const blink::LayoutObject*);
2002 void showLineTree(const blink::LayoutObject*); 2002 void showLineTree(const blink::LayoutObject*);
2003 void showLayoutTree(const blink::LayoutObject* object1); 2003 void showLayoutTree(const blink::LayoutObject* object1);
2004 // We don't make object2 an optional parameter so that showLayoutTree 2004 // We don't make object2 an optional parameter so that showLayoutTree
2005 // can be called from gdb easily. 2005 // can be called from gdb easily.
2006 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 2006 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
2007 2007
2008 #endif 2008 #endif
2009 2009
2010 #endif // LayoutObject_h 2010 #endif // LayoutObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698