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. 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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 // Called when the previous paint invalidation rect(s) is no longer valid. | 1306 // Called when the previous paint invalidation rect(s) is no longer valid. |
1307 virtual void clearPreviousPaintInvalidationRects(); | 1307 virtual void clearPreviousPaintInvalidationRects(); |
1308 | 1308 |
1309 // Only adjusts if the paint invalidation container is not a composited scro
ller. | 1309 // Only adjusts if the paint invalidation container is not a composited scro
ller. |
1310 void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scro
llDelta); | 1310 void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scro
llDelta); |
1311 | 1311 |
1312 // The previous position of the top-left corner of the object in its previou
s paint backing. | 1312 // The previous position of the top-left corner of the object in its previou
s paint backing. |
1313 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re
turn m_previousPositionFromPaintInvalidationBacking; } | 1313 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re
turn m_previousPositionFromPaintInvalidationBacking; } |
1314 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi
tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki
ng = positionFromPaintInvalidationBacking; } | 1314 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi
tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki
ng = positionFromPaintInvalidationBacking; } |
1315 | 1315 |
1316 bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const | |
1317 { | |
1318 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | |
1319 return m_previousPositionFromPaintInvalidationBacking != uninitializedPa
intOffset() && m_previousPositionFromPaintInvalidationBacking != newPaintOffset; | |
1320 } | |
1321 void setPreviousPaintOffset(const LayoutPoint& paintOffset) | |
1322 { | |
1323 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | |
1324 m_previousPositionFromPaintInvalidationBacking = paintOffset; | |
1325 } | |
1326 | |
1327 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi
elds.fullPaintInvalidationReason(); } | 1316 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi
elds.fullPaintInvalidationReason(); } |
1328 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv
alidationReason() != PaintInvalidationNone; } | 1317 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv
alidationReason() != PaintInvalidationNone; } |
1329 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid
ationFull); | 1318 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid
ationFull); |
1330 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida
tionReason(PaintInvalidationNone); } | 1319 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida
tionReason(PaintInvalidationNone); } |
1331 | 1320 |
1332 virtual void clearPaintInvalidationFlags(); | 1321 virtual void clearPaintInvalidationFlags(); |
1333 | 1322 |
1334 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval
idation(); } | 1323 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval
idation(); } |
1335 void setMayNeedPaintInvalidation(); | 1324 void setMayNeedPaintInvalidation(); |
1336 | 1325 |
(...skipping 30 matching lines...) Expand all Loading... |
1367 virtual void invalidateDisplayItemClients(PaintInvalidationReason) const; | 1356 virtual void invalidateDisplayItemClients(PaintInvalidationReason) const; |
1368 | 1357 |
1369 virtual bool hasNonCompositedScrollbars() const { return false; } | 1358 virtual bool hasNonCompositedScrollbars() const { return false; } |
1370 | 1359 |
1371 // Called before anonymousChild.setStyle(). Override to set custom styles fo
r the child. | 1360 // Called before anonymousChild.setStyle(). Override to set custom styles fo
r the child. |
1372 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C
omputedStyle& style) const { } | 1361 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C
omputedStyle& style) const { } |
1373 | 1362 |
1374 // Painters can use const methods only, except for these explicitly declared
methods. | 1363 // Painters can use const methods only, except for these explicitly declared
methods. |
1375 class MutableForPainting { | 1364 class MutableForPainting { |
1376 public: | 1365 public: |
1377 void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutOb
ject.setPreviousPaintOffset(paintOffset); } | |
1378 void clearPaintInvalidationFlags() { m_layoutObject.clearPaintInvalidati
onFlags(); } | 1366 void clearPaintInvalidationFlags() { m_layoutObject.clearPaintInvalidati
onFlags(); } |
1379 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) {
m_layoutObject.setShouldDoFullPaintInvalidation(reason); } | 1367 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) {
m_layoutObject.setShouldDoFullPaintInvalidation(reason); } |
1380 void ensureIsReadyForPaintInvalidation() { m_layoutObject.ensureIsReadyF
orPaintInvalidation(); } | 1368 void ensureIsReadyForPaintInvalidation() { m_layoutObject.ensureIsReadyF
orPaintInvalidation(); } |
1381 | 1369 |
1382 void setPreviousPaintInvalidationRect(const LayoutRect& r) { m_layoutObj
ect.setPreviousPaintInvalidationRect(r); } | 1370 void setPreviousPaintInvalidationRect(const LayoutRect& r) { m_layoutObj
ect.setPreviousPaintInvalidationRect(r); } |
1383 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint&
p) { m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p); } | 1371 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint&
p) { m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p); } |
1384 void setPreviousBackgroundObscured(bool b) { m_layoutObject.setPreviousB
ackgroundObscured(b); } | 1372 void setPreviousBackgroundObscured(bool b) { m_layoutObject.setPreviousB
ackgroundObscured(b); } |
1385 void clearPreviousPaintInvalidationRects() { m_layoutObject.clearPreviou
sPaintInvalidationRects(); } | 1373 void clearPreviousPaintInvalidationRects() { m_layoutObject.clearPreviou
sPaintInvalidationRects(); } |
1386 | 1374 |
1387 protected: | 1375 protected: |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot())
; } | 1617 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot())
; } |
1630 | 1618 |
1631 static bool isAllowedToModifyLayoutTreeStructure(Document&); | 1619 static bool isAllowedToModifyLayoutTreeStructure(Document&); |
1632 | 1620 |
1633 // Returns the parent for paint invalidation. | 1621 // Returns the parent for paint invalidation. |
1634 // - For LayoutView, returns the owner layout object in the containing frame
if any or nullptr; | 1622 // - For LayoutView, returns the owner layout object in the containing frame
if any or nullptr; |
1635 // - For multi-column spanner, returns the spanner placeholder; | 1623 // - For multi-column spanner, returns the spanner placeholder; |
1636 // - Otherwise returns parent(). | 1624 // - Otherwise returns parent(). |
1637 LayoutObject* paintInvalidationParent() const; | 1625 LayoutObject* paintInvalidationParent() const; |
1638 | 1626 |
1639 static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUni
t::max(), LayoutUnit::max()); } | |
1640 | |
1641 RefPtr<ComputedStyle> m_style; | 1627 RefPtr<ComputedStyle> m_style; |
1642 | 1628 |
1643 // Oilpan: This untraced pointer to the owning Node is considered safe. | 1629 // Oilpan: This untraced pointer to the owning Node is considered safe. |
1644 UntracedMember<Node> m_node; | 1630 UntracedMember<Node> m_node; |
1645 | 1631 |
1646 LayoutObject* m_parent; | 1632 LayoutObject* m_parent; |
1647 LayoutObject* m_previous; | 1633 LayoutObject* m_previous; |
1648 LayoutObject* m_next; | 1634 LayoutObject* m_next; |
1649 | 1635 |
1650 #if ENABLE(ASSERT) | 1636 #if ENABLE(ASSERT) |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 // Store state between styleWillChange and styleDidChange | 1908 // Store state between styleWillChange and styleDidChange |
1923 static bool s_affectsParentBlock; | 1909 static bool s_affectsParentBlock; |
1924 | 1910 |
1925 // This stores the paint invalidation rect from the previous frame. This rec
t does *not* account for composited scrolling. See | 1911 // This stores the paint invalidation rect from the previous frame. This rec
t does *not* account for composited scrolling. See |
1926 // adjustInvalidationRectForCompositedScrolling(). | 1912 // adjustInvalidationRectForCompositedScrolling(). |
1927 LayoutRect m_previousPaintInvalidationRect; | 1913 LayoutRect m_previousPaintInvalidationRect; |
1928 | 1914 |
1929 // This stores the position in the paint invalidation backing's coordinate. | 1915 // This stores the position in the paint invalidation backing's coordinate. |
1930 // It is used to detect layoutObject shifts that forces a full invalidation. | 1916 // It is used to detect layoutObject shifts that forces a full invalidation. |
1931 // This point does *not* account for composited scrolling. See adjustInvalid
ationRectForCompositedScrolling(). | 1917 // This point does *not* account for composited scrolling. See adjustInvalid
ationRectForCompositedScrolling(). |
1932 // For slimmingPaintInvalidation, this stores the previous paint offset. | |
1933 // TODO(wangxianzhu): Rename this to m_previousPaintOffset when we enable sl
immingPaintInvalidation. | |
1934 LayoutPoint m_previousPositionFromPaintInvalidationBacking; | 1918 LayoutPoint m_previousPositionFromPaintInvalidationBacking; |
1935 }; | 1919 }; |
1936 | 1920 |
1937 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit
. | 1921 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit
. |
1938 class DeprecatedDisableModifyLayoutTreeStructureAsserts { | 1922 class DeprecatedDisableModifyLayoutTreeStructureAsserts { |
1939 STACK_ALLOCATED(); | 1923 STACK_ALLOCATED(); |
1940 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts); | 1924 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts); |
1941 public: | 1925 public: |
1942 DeprecatedDisableModifyLayoutTreeStructureAsserts(); | 1926 DeprecatedDisableModifyLayoutTreeStructureAsserts(); |
1943 | 1927 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2143 void showTree(const blink::LayoutObject*); | 2127 void showTree(const blink::LayoutObject*); |
2144 void showLineTree(const blink::LayoutObject*); | 2128 void showLineTree(const blink::LayoutObject*); |
2145 void showLayoutTree(const blink::LayoutObject* object1); | 2129 void showLayoutTree(const blink::LayoutObject* object1); |
2146 // We don't make object2 an optional parameter so that showLayoutTree | 2130 // We don't make object2 an optional parameter so that showLayoutTree |
2147 // can be called from gdb easily. | 2131 // can be called from gdb easily. |
2148 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); | 2132 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); |
2149 | 2133 |
2150 #endif | 2134 #endif |
2151 | 2135 |
2152 #endif // LayoutObject_h | 2136 #endif // LayoutObject_h |
OLD | NEW |