OLD | NEW |
---|---|
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. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1568 // container (*not* the graphics layer that paints this object). | 1568 // container (*not* the graphics layer that paints this object). |
1569 LayoutRect previousVisualRectIncludingCompositedScrolling( | 1569 LayoutRect previousVisualRectIncludingCompositedScrolling( |
1570 const LayoutBoxModelObject& paintInvalidationContainer) const; | 1570 const LayoutBoxModelObject& paintInvalidationContainer) const; |
1571 | 1571 |
1572 // The returned rect does *not* account for composited scrolling. | 1572 // The returned rect does *not* account for composited scrolling. |
1573 const LayoutRect& previousVisualRect() const { return m_previousVisualRect; } | 1573 const LayoutRect& previousVisualRect() const { return m_previousVisualRect; } |
1574 | 1574 |
1575 // Called when the previous visual rect(s) is no longer valid. | 1575 // Called when the previous visual rect(s) is no longer valid. |
1576 virtual void clearPreviousVisualRects(); | 1576 virtual void clearPreviousVisualRects(); |
1577 | 1577 |
1578 const LayoutPoint& previousPaintOffset() const { | 1578 const LayoutPoint& paintOffset() const { return m_paintOffset; } |
1579 return m_previousPaintOffset; | |
1580 } | |
1581 | 1579 |
1582 PaintInvalidationReason fullPaintInvalidationReason() const { | 1580 PaintInvalidationReason fullPaintInvalidationReason() const { |
1583 return m_bitfields.fullPaintInvalidationReason(); | 1581 return m_bitfields.fullPaintInvalidationReason(); |
1584 } | 1582 } |
1585 bool shouldDoFullPaintInvalidation() const { | 1583 bool shouldDoFullPaintInvalidation() const { |
1586 return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; | 1584 return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; |
1587 } | 1585 } |
1588 void setShouldDoFullPaintInvalidation( | 1586 void setShouldDoFullPaintInvalidation( |
1589 PaintInvalidationReason = PaintInvalidationFull); | 1587 PaintInvalidationReason = PaintInvalidationFull); |
1590 void clearShouldDoFullPaintInvalidation() { | 1588 void clearShouldDoFullPaintInvalidation() { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1669 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { | 1667 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { |
1670 m_layoutObject.setShouldDoFullPaintInvalidation(reason); | 1668 m_layoutObject.setShouldDoFullPaintInvalidation(reason); |
1671 } | 1669 } |
1672 void setBackgroundChangedSinceLastPaintInvalidation() { | 1670 void setBackgroundChangedSinceLastPaintInvalidation() { |
1673 m_layoutObject.setBackgroundChangedSinceLastPaintInvalidation(); | 1671 m_layoutObject.setBackgroundChangedSinceLastPaintInvalidation(); |
1674 } | 1672 } |
1675 void ensureIsReadyForPaintInvalidation() { | 1673 void ensureIsReadyForPaintInvalidation() { |
1676 m_layoutObject.ensureIsReadyForPaintInvalidation(); | 1674 m_layoutObject.ensureIsReadyForPaintInvalidation(); |
1677 } | 1675 } |
1678 | 1676 |
1677 // The following setters store the current values as calculated during the | |
1678 // pre-paint tree walk. TODO(wangxianzhu): Add check of lifecycle states. | |
Xianzhu
2017/01/06 19:24:18
The TODO means I'm not sure for now if we can chec
pdr.
2017/01/06 19:40:01
SGTM
What about the paintOffset accessor (line 15
Xianzhu
2017/01/06 22:12:18
I would like to defer the decision to the TODO. Fo
| |
1679 void setPreviousVisualRect(const LayoutRect& r) { | 1679 void setPreviousVisualRect(const LayoutRect& r) { |
1680 m_layoutObject.setPreviousVisualRect(r); | 1680 m_layoutObject.setPreviousVisualRect(r); |
1681 } | 1681 } |
1682 void setPreviousPaintOffset(const LayoutPoint& p) { | 1682 void setPaintOffset(const LayoutPoint& p) { |
1683 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | 1683 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
1684 m_layoutObject.m_previousPaintOffset = p; | 1684 DCHECK_EQ(m_layoutObject.document().lifecycle().state(), |
1685 DocumentLifecycle::InPrePaint); | |
1686 m_layoutObject.m_paintOffset = p; | |
1685 } | 1687 } |
1686 void setHasPreviousLocationInBacking(bool b) { | 1688 void setHasPreviousLocationInBacking(bool b) { |
1687 m_layoutObject.m_bitfields.setHasPreviousLocationInBacking(b); | 1689 m_layoutObject.m_bitfields.setHasPreviousLocationInBacking(b); |
1688 } | 1690 } |
1689 void setHasPreviousSelectionVisualRect(bool b) { | 1691 void setHasPreviousSelectionVisualRect(bool b) { |
1690 m_layoutObject.m_bitfields.setHasPreviousSelectionVisualRect(b); | 1692 m_layoutObject.m_bitfields.setHasPreviousSelectionVisualRect(b); |
1691 } | 1693 } |
1692 void setHasPreviousBoxGeometries(bool b) { | 1694 void setHasPreviousBoxGeometries(bool b) { |
1693 m_layoutObject.m_bitfields.setHasPreviousBoxGeometries(b); | 1695 m_layoutObject.m_bitfields.setHasPreviousBoxGeometries(b); |
1694 } | 1696 } |
1695 void setPreviousBackgroundObscured(bool b) { | 1697 void setPreviousBackgroundObscured(bool b) { |
1696 m_layoutObject.setPreviousBackgroundObscured(b); | 1698 m_layoutObject.setPreviousBackgroundObscured(b); |
1697 } | 1699 } |
1700 | |
1698 void clearPreviousVisualRects() { | 1701 void clearPreviousVisualRects() { |
1699 m_layoutObject.clearPreviousVisualRects(); | 1702 m_layoutObject.clearPreviousVisualRects(); |
1700 } | 1703 } |
1701 void setNeedsPaintPropertyUpdate() { | 1704 void setNeedsPaintPropertyUpdate() { |
1702 m_layoutObject.setNeedsPaintPropertyUpdate(); | 1705 m_layoutObject.setNeedsPaintPropertyUpdate(); |
1703 } | 1706 } |
1704 #if DCHECK_IS_ON() | 1707 #if DCHECK_IS_ON() |
1705 // Same as setNeedsPaintPropertyUpdate() but does not mark ancestors as | 1708 // Same as setNeedsPaintPropertyUpdate() but does not mark ancestors as |
1706 // having a descendant needing a paint property update. | 1709 // having a descendant needing a paint property update. |
1707 void setOnlyThisNeedsPaintPropertyUpdateForTesting() { | 1710 void setOnlyThisNeedsPaintPropertyUpdateForTesting() { |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2438 // This stores the visual rect computed by the latest paint invalidation. | 2441 // This stores the visual rect computed by the latest paint invalidation. |
2439 // This rect does *not* account for composited scrolling. See | 2442 // This rect does *not* account for composited scrolling. See |
2440 // adjustVisualRectForCompositedScrolling(). | 2443 // adjustVisualRectForCompositedScrolling(). |
2441 LayoutRect m_previousVisualRect; | 2444 LayoutRect m_previousVisualRect; |
2442 | 2445 |
2443 // This stores the paint offset computed by the latest paint property tree | 2446 // This stores the paint offset computed by the latest paint property tree |
2444 // building. It is relative to the containing transform space. It is the same | 2447 // building. It is relative to the containing transform space. It is the same |
2445 // offset that will be used to paint the object on SPv2. It's used to detect | 2448 // offset that will be used to paint the object on SPv2. It's used to detect |
2446 // paint offset change for paint invalidation on SPv2, and partial paint | 2449 // paint offset change for paint invalidation on SPv2, and partial paint |
2447 // property tree update for SlimmingPaintInvalidation on SPv1 and SPv2. | 2450 // property tree update for SlimmingPaintInvalidation on SPv1 and SPv2. |
2448 LayoutPoint m_previousPaintOffset; | 2451 LayoutPoint m_paintOffset; |
2449 | 2452 |
2450 // For SPv2 only. The ObjectPaintProperties structure holds references to the | 2453 // For SPv2 only. The ObjectPaintProperties structure holds references to the |
2451 // property tree nodes that are created by the layout object for painting. | 2454 // property tree nodes that are created by the layout object for painting. |
2452 std::unique_ptr<ObjectPaintProperties> m_paintProperties; | 2455 std::unique_ptr<ObjectPaintProperties> m_paintProperties; |
2453 }; | 2456 }; |
2454 | 2457 |
2455 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer | 2458 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer |
2456 // hit. | 2459 // hit. |
2457 class DeprecatedDisableModifyLayoutTreeStructureAsserts { | 2460 class DeprecatedDisableModifyLayoutTreeStructureAsserts { |
2458 STACK_ALLOCATED(); | 2461 STACK_ALLOCATED(); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2670 CORE_EXPORT void showLineTree(const blink::LayoutObject*); | 2673 CORE_EXPORT void showLineTree(const blink::LayoutObject*); |
2671 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); | 2674 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); |
2672 // We don't make object2 an optional parameter so that showLayoutTree | 2675 // We don't make object2 an optional parameter so that showLayoutTree |
2673 // can be called from gdb easily. | 2676 // can be called from gdb easily. |
2674 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, | 2677 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, |
2675 const blink::LayoutObject* object2); | 2678 const blink::LayoutObject* object2); |
2676 | 2679 |
2677 #endif | 2680 #endif |
2678 | 2681 |
2679 #endif // LayoutObject_h | 2682 #endif // LayoutObject_h |
OLD | NEW |