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

Side by Side Diff: Source/core/layout/LayoutObject.h

Issue 1363613002: Save previous paint offset in LayoutObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months 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 | Annotate | Revision Log
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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 { 1131 {
1132 ASSERT(!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled()); 1132 ASSERT(!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
1133 return m_previousPositionFromPaintInvalidationBacking; 1133 return m_previousPositionFromPaintInvalidationBacking;
1134 } 1134 }
1135 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) 1135 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking)
1136 { 1136 {
1137 ASSERT(!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled()); 1137 ASSERT(!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
1138 m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvali dationBacking; 1138 m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvali dationBacking;
1139 } 1139 }
1140 1140
1141 const bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const
1142 {
1143 ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
1144 return /*m_previousPaintOffset != uninitializedPaintOffset() && */m_prev iousPaintOffset != newPaintOffset;
pdr. 2015/09/23 19:55:47 Oops
Xianzhu 2015/09/23 21:39:44 Done.
1145 }
1146 void setPreviousPaintOffset(const LayoutPoint& paintOffset) const
1147 {
1148 ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
1149 m_previousPaintOffset = paintOffset;
1150 }
1151
1141 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); } 1152 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); }
1142 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; } 1153 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; }
1143 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull); 1154 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull);
1144 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); } 1155 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); }
1145 1156
1146 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); } 1157 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); }
1147 1158
1148 virtual void clearPaintInvalidationState(const PaintInvalidationState&); 1159 virtual void clearPaintInvalidationState(const PaintInvalidationState&);
1149 1160
1150 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } 1161 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); }
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 #if ENABLE(ASSERT) 1400 #if ENABLE(ASSERT)
1390 void checkBlockPositionedObjectsNeedLayout(); 1401 void checkBlockPositionedObjectsNeedLayout();
1391 #endif 1402 #endif
1392 1403
1393 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; } 1404 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; }
1394 1405
1395 static bool isAllowedToModifyLayoutTreeStructure(Document&); 1406 static bool isAllowedToModifyLayoutTreeStructure(Document&);
1396 1407
1397 const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRec t&) const; 1408 const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRec t&) const;
1398 1409
1410 static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUni t::max(), LayoutUnit::max()); }
1411
1399 RefPtr<ComputedStyle> m_style; 1412 RefPtr<ComputedStyle> m_style;
1400 1413
1401 // Oilpan: raw pointer back to the owning Node is considered safe. 1414 // Oilpan: raw pointer back to the owning Node is considered safe.
1402 GC_PLUGIN_IGNORE("http://crbug.com/509911") 1415 GC_PLUGIN_IGNORE("http://crbug.com/509911")
1403 Node* m_node; 1416 Node* m_node;
1404 1417
1405 LayoutObject* m_parent; 1418 LayoutObject* m_parent;
1406 LayoutObject* m_previous; 1419 LayoutObject* m_previous;
1407 LayoutObject* m_next; 1420 LayoutObject* m_next;
1408 1421
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 void setChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildNee dsOverflowRecalcAfterStyleChange(true); } 1644 void setChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildNee dsOverflowRecalcAfterStyleChange(true); }
1632 1645
1633 private: 1646 private:
1634 // Store state between styleWillChange and styleDidChange 1647 // Store state between styleWillChange and styleDidChange
1635 static bool s_affectsParentBlock; 1648 static bool s_affectsParentBlock;
1636 1649
1637 // This stores the paint invalidation rect from the previous frame. This rec t does *not* account for composited scrolling. See 1650 // This stores the paint invalidation rect from the previous frame. This rec t does *not* account for composited scrolling. See
1638 // adjustInvalidationRectForCompositedScrolling(). 1651 // adjustInvalidationRectForCompositedScrolling().
1639 LayoutRect m_previousPaintInvalidationRect; 1652 LayoutRect m_previousPaintInvalidationRect;
1640 1653
1641 // This stores the position in the paint invalidation backing's coordinate. 1654 union {
1642 // It is used to detect layoutObject shifts that forces a full invalidation. 1655 // This stores the position in the paint invalidation backing's coordina te.
1643 // This point does *not* account for composited scrolling. See adjustInvalid ationRectForCompositedScrolling(). 1656 // It is used to detect layoutObject shifts that forces a full invalidat ion.
1644 LayoutPoint m_previousPositionFromPaintInvalidationBacking; 1657 // This point does *not* account for composited scrolling. See adjustInv alidationRectForCompositedScrolling().
1658 // TODO(wangxianzhu): Remove this when we enable slimmingPaintOffsetCach ing.
1659 LayoutPoint m_previousPositionFromPaintInvalidationBacking;
1660 // For slimmingPaintOffsetCaching.
1661 mutable LayoutPoint m_previousPaintOffset;
1662 };
1645 }; 1663 };
1646 1664
1647 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit . 1665 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit .
1648 class DeprecatedDisableModifyLayoutTreeStructureAsserts { 1666 class DeprecatedDisableModifyLayoutTreeStructureAsserts {
1649 STACK_ALLOCATED(); 1667 STACK_ALLOCATED();
1650 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts); 1668 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts);
1651 public: 1669 public:
1652 DeprecatedDisableModifyLayoutTreeStructureAsserts(); 1670 DeprecatedDisableModifyLayoutTreeStructureAsserts();
1653 1671
1654 static bool canModifyLayoutTreeStateInAnyState(); 1672 static bool canModifyLayoutTreeStateInAnyState();
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 void showTree(const blink::LayoutObject*); 1891 void showTree(const blink::LayoutObject*);
1874 void showLineTree(const blink::LayoutObject*); 1892 void showLineTree(const blink::LayoutObject*);
1875 void showLayoutTree(const blink::LayoutObject* object1); 1893 void showLayoutTree(const blink::LayoutObject* object1);
1876 // We don't make object2 an optional parameter so that showLayoutTree 1894 // We don't make object2 an optional parameter so that showLayoutTree
1877 // can be called from gdb easily. 1895 // can be called from gdb easily.
1878 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 1896 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
1879 1897
1880 #endif 1898 #endif
1881 1899
1882 #endif // LayoutObject_h 1900 #endif // LayoutObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698