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 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 // the child. | 1725 // the child. |
1726 virtual void UpdateAnonymousChildStyle(const LayoutObject& anonymous_child, | 1726 virtual void UpdateAnonymousChildStyle(const LayoutObject& anonymous_child, |
1727 ComputedStyle& style) const {} | 1727 ComputedStyle& style) const {} |
1728 | 1728 |
1729 // Returns a rect corresponding to this LayoutObject's bounds for use in | 1729 // Returns a rect corresponding to this LayoutObject's bounds for use in |
1730 // debugging output | 1730 // debugging output |
1731 virtual LayoutRect DebugRect() const; | 1731 virtual LayoutRect DebugRect() const; |
1732 | 1732 |
1733 // Painters can use const methods only, except for these explicitly declared | 1733 // Painters can use const methods only, except for these explicitly declared |
1734 // methods. | 1734 // methods. |
1735 class MutableForPainting { | 1735 class CORE_EXPORT MutableForPainting { |
1736 public: | 1736 public: |
1737 // Convenience mutator that clears paint invalidation flags and this object | 1737 // Convenience mutator that clears paint invalidation flags and this object |
1738 // and its descendants' needs-paint-property-update flags. | 1738 // and its descendants' needs-paint-property-update flags. |
1739 void ClearPaintFlags() { | 1739 void ClearPaintFlags() { |
1740 DCHECK_EQ(layout_object_.GetDocument().Lifecycle().GetState(), | 1740 DCHECK_EQ(layout_object_.GetDocument().Lifecycle().GetState(), |
1741 DocumentLifecycle::kInPrePaint); | 1741 DocumentLifecycle::kInPrePaint); |
1742 layout_object_.ClearPaintInvalidationFlags(); | 1742 layout_object_.ClearPaintInvalidationFlags(); |
1743 layout_object_.bitfields_.SetNeedsPaintPropertyUpdate(false); | 1743 layout_object_.bitfields_.SetNeedsPaintPropertyUpdate(false); |
1744 layout_object_.bitfields_.SetSubtreeNeedsPaintPropertyUpdate(false); | 1744 layout_object_.bitfields_.SetSubtreeNeedsPaintPropertyUpdate(false); |
1745 layout_object_.bitfields_.SetDescendantNeedsPaintPropertyUpdate(false); | 1745 layout_object_.bitfields_.SetDescendantNeedsPaintPropertyUpdate(false); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 void SetOnlyThisNeedsPaintPropertyUpdateForTesting() { | 1795 void SetOnlyThisNeedsPaintPropertyUpdateForTesting() { |
1796 layout_object_.bitfields_.SetNeedsPaintPropertyUpdate(true); | 1796 layout_object_.bitfields_.SetNeedsPaintPropertyUpdate(true); |
1797 } | 1797 } |
1798 void ClearNeedsPaintPropertyUpdateForTesting() { | 1798 void ClearNeedsPaintPropertyUpdateForTesting() { |
1799 layout_object_.bitfields_.SetNeedsPaintPropertyUpdate(false); | 1799 layout_object_.bitfields_.SetNeedsPaintPropertyUpdate(false); |
1800 } | 1800 } |
1801 #endif | 1801 #endif |
1802 | 1802 |
1803 protected: | 1803 protected: |
1804 friend class PaintPropertyTreeBuilder; | 1804 friend class PaintPropertyTreeBuilder; |
| 1805 friend class PrePaintTreeWalk; |
1805 FRIEND_TEST_ALL_PREFIXES(AnimationCompositorAnimationsTest, | 1806 FRIEND_TEST_ALL_PREFIXES(AnimationCompositorAnimationsTest, |
1806 canStartAnimationOnCompositorTransformSPv2); | 1807 canStartAnimationOnCompositorTransformSPv2); |
1807 FRIEND_TEST_ALL_PREFIXES(AnimationCompositorAnimationsTest, | 1808 FRIEND_TEST_ALL_PREFIXES(AnimationCompositorAnimationsTest, |
1808 canStartAnimationOnCompositorEffectSPv2); | 1809 canStartAnimationOnCompositorEffectSPv2); |
| 1810 FRIEND_TEST_ALL_PREFIXES(PrePaintTreeWalkTest, ClipRects); |
1809 | 1811 |
1810 // The following non-const functions for ObjectPaintProperties should only | 1812 // The following non-const functions for ObjectPaintProperties should only |
1811 // be called from PaintPropertyTreeBuilder. | 1813 // be called from PaintPropertyTreeBuilder. |
1812 ObjectPaintProperties& EnsurePaintProperties() { | 1814 ObjectPaintProperties& EnsurePaintProperties() { |
1813 return layout_object_.EnsureRarePaintData() | 1815 return layout_object_.EnsureRarePaintData() |
1814 .EnsureFragment() | 1816 .EnsureFragment() |
1815 .EnsurePaintProperties(); | 1817 .EnsurePaintProperties(); |
1816 } | 1818 } |
1817 ObjectPaintProperties* PaintProperties() { | 1819 ObjectPaintProperties* PaintProperties() { |
1818 if (auto* paint_data = layout_object_.GetRarePaintData()) | 1820 if (auto* paint_data = layout_object_.GetRarePaintData()) |
1819 return paint_data->PaintProperties(); | 1821 return paint_data->PaintProperties(); |
1820 return nullptr; | 1822 return nullptr; |
1821 } | 1823 } |
1822 void ClearPaintProperties() { | 1824 void ClearPaintProperties() { |
1823 if (auto* paint_data = layout_object_.GetRarePaintData()) { | 1825 if (auto* paint_data = layout_object_.GetRarePaintData()) { |
1824 if (auto* fragment = paint_data->Fragment()) | 1826 if (auto* fragment = paint_data->Fragment()) |
1825 fragment->ClearPaintProperties(); | 1827 fragment->ClearPaintProperties(); |
1826 } | 1828 } |
1827 } | 1829 } |
| 1830 // Each LayoutObject has one or more painting fragments (exactly one |
| 1831 // in the absence of multicol/pagination). |
| 1832 // See ../paint/README.md for more on fragments. |
| 1833 FragmentData* FirstFragment(); |
| 1834 FragmentData& EnsureFirstFragment(); |
1828 | 1835 |
1829 // The following non-const functions for local border box properties should | 1836 // The following non-const functions for local border box properties should |
1830 // only be called from PaintPropertyTreeBuilder. | 1837 // only be called from PaintPropertyTreeBuilder. |
1831 void ClearLocalBorderBoxProperties() { | 1838 void ClearLocalBorderBoxProperties() { |
1832 if (auto* paint_data = layout_object_.GetRarePaintData()) | 1839 if (auto* paint_data = layout_object_.GetRarePaintData()) |
1833 paint_data->ClearLocalBorderBoxProperties(); | 1840 paint_data->ClearLocalBorderBoxProperties(); |
1834 } | 1841 } |
1835 void SetLocalBorderBoxProperties(PropertyTreeState& local_border_box) { | 1842 void SetLocalBorderBoxProperties(PropertyTreeState& local_border_box) { |
1836 return layout_object_.EnsureRarePaintData().SetLocalBorderBoxProperties( | 1843 return layout_object_.EnsureRarePaintData().SetLocalBorderBoxProperties( |
1837 local_border_box); | 1844 local_border_box); |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2818 CORE_EXPORT void showLineTree(const blink::LayoutObject*); | 2825 CORE_EXPORT void showLineTree(const blink::LayoutObject*); |
2819 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); | 2826 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); |
2820 // We don't make object2 an optional parameter so that showLayoutTree | 2827 // We don't make object2 an optional parameter so that showLayoutTree |
2821 // can be called from gdb easily. | 2828 // can be called from gdb easily. |
2822 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, | 2829 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, |
2823 const blink::LayoutObject* object2); | 2830 const blink::LayoutObject* object2); |
2824 | 2831 |
2825 #endif | 2832 #endif |
2826 | 2833 |
2827 #endif // LayoutObject_h | 2834 #endif // LayoutObject_h |
OLD | NEW |