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

Side by Side Diff: Source/core/rendering/RenderObject.h

Issue 620553009: Move selection invalidations to the invalidation phase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added missing expectation Created 6 years, 2 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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space 856 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space
857 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same 857 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same
858 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing. 858 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing.
859 // If |paintInvalidationContainer| is 0, invalidate paints via the view. 859 // If |paintInvalidationContainer| is 0, invalidate paints via the view.
860 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636 99. 860 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636 99.
861 void invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvali dationContainer, const LayoutRect&, InvalidationReason) const; 861 void invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvali dationContainer, const LayoutRect&, InvalidationReason) const;
862 862
863 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space. 863 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space.
864 void invalidatePaintRectangle(const LayoutRect&) const; 864 void invalidatePaintRectangle(const LayoutRect&) const;
865 865
866 void invalidateSelectionIfNeeded(const RenderLayerModelObject&) const;
867
866 // Walk the tree after layout issuing paint invalidations for renderers that have changed or moved, updating bounds that have changed, and clearing paint in validation state. 868 // Walk the tree after layout issuing paint invalidations for renderers that have changed or moved, updating bounds that have changed, and clearing paint in validation state.
867 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); 869 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&);
868 870
869 virtual void invalidatePaintForOverflow(); 871 virtual void invalidatePaintForOverflow();
870 void invalidatePaintForOverflowIfNeeded(); 872 void invalidatePaintForOverflowIfNeeded();
871 873
872 void invalidatePaintIncludingNonCompositingDescendants(); 874 void invalidatePaintIncludingNonCompositingDescendants();
873 875
874 bool checkForPaintInvalidation() const; 876 bool checkForPaintInvalidation() const;
875 877
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } 1050 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); }
1049 void setMayNeedPaintInvalidation(bool b) 1051 void setMayNeedPaintInvalidation(bool b)
1050 { 1052 {
1051 m_bitfields.setMayNeedPaintInvalidation(b); 1053 m_bitfields.setMayNeedPaintInvalidation(b);
1052 1054
1053 // Make sure our parent is marked as needing invalidation. 1055 // Make sure our parent is marked as needing invalidation.
1054 if (b) 1056 if (b)
1055 markContainingBlockChainForPaintInvalidation(); 1057 markContainingBlockChainForPaintInvalidation();
1056 } 1058 }
1057 1059
1060 bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidate Selection(); }
1061 void setShouldInvalidateSelection()
1062 {
1063 if (!canUpdateSelectionOnRootLineBoxes())
1064 return;
1065
1066 m_bitfields.setShouldInvalidateSelection(true);
1067 markContainingBlockChainForPaintInvalidation();
1068 }
1069 void clearShouldInvalidateSelection() { m_bitfields.setShouldInvalidateSelec tion(false); }
1070
1058 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout BecauseOfChildren(); } 1071 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout BecauseOfChildren(); }
1059 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB ecauseOfChildren(b); } 1072 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB ecauseOfChildren(b); }
1060 1073
1061 bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInva lidationState) 1074 bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInva lidationState) const
1062 { 1075 {
1063 return paintInvalidationState.forceCheckForPaintInvalidation() || should CheckForPaintInvalidationRegardlessOfPaintInvalidationState(); 1076 return paintInvalidationState.forceCheckForPaintInvalidation() || should CheckForPaintInvalidationRegardlessOfPaintInvalidationState();
1064 } 1077 }
1065 1078
1066 bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() 1079 bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() con st
1067 { 1080 {
1068 return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFul lPaintInvalidation() || shouldDoFullPaintInvalidationIfSelfPaintingLayer(); 1081 return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFul lPaintInvalidation() || shouldDoFullPaintInvalidationIfSelfPaintingLayer() || sh ouldInvalidateSelection();
1069 } 1082 }
1070 1083
1071 bool supportsPaintInvalidationStateCachedOffsets() const { return !hasColumn s() && !hasTransform() && !hasReflection() && !style()->isFlippedBlocksWritingMo de(); } 1084 bool supportsPaintInvalidationStateCachedOffsets() const { return !hasColumn s() && !hasTransform() && !hasReflection() && !style()->isFlippedBlocksWritingMo de(); }
1072 1085
1073 void setNeedsOverflowRecalcAfterStyleChange(); 1086 void setNeedsOverflowRecalcAfterStyleChange();
1074 void markContainingBlocksForOverflowRecalc(); 1087 void markContainingBlocksForOverflowRecalc();
1075 1088
1076 virtual LayoutRect viewRect() const; 1089 virtual LayoutRect viewRect() const;
1077 1090
1078 protected: 1091 protected:
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 1130
1118 virtual InvalidationReason getPaintInvalidationReason(const RenderLayerModel Object& paintInvalidationContainer, 1131 virtual InvalidationReason getPaintInvalidationReason(const RenderLayerModel Object& paintInvalidationContainer,
1119 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi onFromPaintInvalidationBacking, 1132 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi onFromPaintInvalidationBacking,
1120 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi onFromPaintInvalidationBacking); 1133 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi onFromPaintInvalidationBacking);
1121 virtual void incrementallyInvalidatePaint(const RenderLayerModelObject& pain tInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds , const LayoutPoint& positionFromPaintInvalidationBacking); 1134 virtual void incrementallyInvalidatePaint(const RenderLayerModelObject& pain tInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds , const LayoutPoint& positionFromPaintInvalidationBacking);
1122 void fullyInvalidatePaint(const RenderLayerModelObject& paintInvalidationCon tainer, InvalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBo unds); 1135 void fullyInvalidatePaint(const RenderLayerModelObject& paintInvalidationCon tainer, InvalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBo unds);
1123 1136
1124 #if ENABLE(ASSERT) 1137 #if ENABLE(ASSERT)
1125 virtual bool paintInvalidationStateIsDirty() const 1138 virtual bool paintInvalidationStateIsDirty() const
1126 { 1139 {
1127 return layoutDidGetCalled() || shouldDoFullPaintInvalidation() || should DoFullPaintInvalidationIfSelfPaintingLayer() 1140 return onlyNeededPositionedMovementLayout() || neededLayoutBecauseOfChil dren() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
1128 || onlyNeededPositionedMovementLayout() || neededLayoutBecauseOfChil dren() || mayNeedPaintInvalidation();
1129 } 1141 }
1130 #endif 1142 #endif
1131 1143
1132 void invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState&); 1144 void invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState&);
1133 virtual InvalidationReason invalidatePaintIfNeeded(const PaintInvalidationSt ate&, const RenderLayerModelObject& paintInvalidationContainer); 1145 virtual InvalidationReason invalidatePaintIfNeeded(const PaintInvalidationSt ate&, const RenderLayerModelObject& paintInvalidationContainer);
1134 1146
1135 private: 1147 private:
1136 void invalidatePaintIncludingNonCompositingDescendantsInternal(const RenderL ayerModelObject* repaintContainer); 1148 void invalidatePaintIncludingNonCompositingDescendantsInternal(const RenderL ayerModelObject* repaintContainer);
1137 1149
1138 const RenderLayerModelObject* enclosingCompositedContainer() const; 1150 const RenderLayerModelObject* enclosingCompositedContainer() const;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 }; 1207 };
1196 1208
1197 public: 1209 public:
1198 RenderObjectBitfields(Node* node) 1210 RenderObjectBitfields(Node* node)
1199 : m_selfNeedsLayout(false) 1211 : m_selfNeedsLayout(false)
1200 , m_shouldInvalidateOverflowForPaint(false) 1212 , m_shouldInvalidateOverflowForPaint(false)
1201 , m_shouldDoFullPaintInvalidationIfSelfPaintingLayer(false) 1213 , m_shouldDoFullPaintInvalidationIfSelfPaintingLayer(false)
1202 // FIXME: We should remove mayNeedPaintInvalidation once we are able to 1214 // FIXME: We should remove mayNeedPaintInvalidation once we are able to
1203 // use the other layout flags to detect the same cases. crbug.com/37 0118 1215 // use the other layout flags to detect the same cases. crbug.com/37 0118
1204 , m_mayNeedPaintInvalidation(false) 1216 , m_mayNeedPaintInvalidation(false)
1217 , m_shouldInvalidateSelection(false)
1205 , m_onlyNeededPositionedMovementLayout(false) 1218 , m_onlyNeededPositionedMovementLayout(false)
1206 , m_neededLayoutBecauseOfChildren(false) 1219 , m_neededLayoutBecauseOfChildren(false)
1207 , m_needsPositionedMovementLayout(false) 1220 , m_needsPositionedMovementLayout(false)
1208 , m_normalChildNeedsLayout(false) 1221 , m_normalChildNeedsLayout(false)
1209 , m_posChildNeedsLayout(false) 1222 , m_posChildNeedsLayout(false)
1210 , m_needsSimplifiedNormalFlowLayout(false) 1223 , m_needsSimplifiedNormalFlowLayout(false)
1211 , m_preferredLogicalWidthsDirty(false) 1224 , m_preferredLogicalWidthsDirty(false)
1212 , m_floating(false) 1225 , m_floating(false)
1213 , m_selfNeedsOverflowRecalcAfterStyleChange(false) 1226 , m_selfNeedsOverflowRecalcAfterStyleChange(false)
1214 , m_childNeedsOverflowRecalcAfterStyleChange(false) 1227 , m_childNeedsOverflowRecalcAfterStyleChange(false)
(...skipping 17 matching lines...) Expand all
1232 , m_hasColumns(false) 1245 , m_hasColumns(false)
1233 , m_alwaysCreateLineBoxesForRenderInline(false) 1246 , m_alwaysCreateLineBoxesForRenderInline(false)
1234 , m_positionedState(IsStaticallyPositioned) 1247 , m_positionedState(IsStaticallyPositioned)
1235 , m_selectionState(SelectionNone) 1248 , m_selectionState(SelectionNone)
1236 , m_flowThreadState(NotInsideFlowThread) 1249 , m_flowThreadState(NotInsideFlowThread)
1237 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) 1250 , m_boxDecorationBackgroundState(NoBoxDecorationBackground)
1238 , m_fullPaintInvalidationReason(InvalidationNone) 1251 , m_fullPaintInvalidationReason(InvalidationNone)
1239 { 1252 {
1240 } 1253 }
1241 1254
1242 // 32 bits have been used in the first word, and 14 in the second. 1255 // 32 bits have been used in the first word, and 14 in the second.
dsinclair 2014/10/01 17:13:32 Does the 14 need to be updated to 15? (Should we j
Julien - ping for review 2014/10/01 18:18:22 This is actually up-to-date and I have updated it
1243 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); 1256 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout);
1244 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO verflowForPaint); 1257 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO verflowForPaint);
1245 ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, S houldDoFullPaintInvalidationIfSelfPaintingLayer); 1258 ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, S houldDoFullPaintInvalidationIfSelfPaintingLayer);
1246 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation) ; 1259 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation) ;
1260 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelectio n);
1247 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit ionedMovementLayout); 1261 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit ionedMovementLayout);
1248 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO fChildren); 1262 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO fChildren);
1249 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout); 1263 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout);
1250 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); 1264 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout);
1251 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); 1265 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout);
1252 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout); 1266 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout);
1253 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty); 1267 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty);
1254 ADD_BOOLEAN_BITFIELD(floating, Floating); 1268 ADD_BOOLEAN_BITFIELD(floating, Floating);
1255 ADD_BOOLEAN_BITFIELD(selfNeedsOverflowRecalcAfterStyleChange, SelfNeedsO verflowRecalcAfterStyleChange); 1269 ADD_BOOLEAN_BITFIELD(selfNeedsOverflowRecalcAfterStyleChange, SelfNeedsO verflowRecalcAfterStyleChange);
1256 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, ChildNeed sOverflowRecalcAfterStyleChange); 1270 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, ChildNeed sOverflowRecalcAfterStyleChange);
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 void showTree(const blink::RenderObject*); 1571 void showTree(const blink::RenderObject*);
1558 void showLineTree(const blink::RenderObject*); 1572 void showLineTree(const blink::RenderObject*);
1559 void showRenderTree(const blink::RenderObject* object1); 1573 void showRenderTree(const blink::RenderObject* object1);
1560 // We don't make object2 an optional parameter so that showRenderTree 1574 // We don't make object2 an optional parameter so that showRenderTree
1561 // can be called from gdb easily. 1575 // can be called from gdb easily.
1562 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2); 1576 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2);
1563 1577
1564 #endif 1578 #endif
1565 1579
1566 #endif // RenderObject_h 1580 #endif // RenderObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698