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

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

Issue 593873002: Alternate way to track first paint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adjust setShouldDoFullPaintInvalidationWithReason API 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 InvalidationFull, 110 InvalidationFull,
111 InvalidationBorderFitLines, 111 InvalidationBorderFitLines,
112 InvalidationBorderBoxChange, 112 InvalidationBorderBoxChange,
113 InvalidationBoundsChange, 113 InvalidationBoundsChange,
114 InvalidationLocationChange, 114 InvalidationLocationChange,
115 InvalidationBecameVisible, 115 InvalidationBecameVisible,
116 InvalidationBecameInvisible, 116 InvalidationBecameInvisible,
117 InvalidationScroll, 117 InvalidationScroll,
118 InvalidationSelection, 118 InvalidationSelection,
119 InvalidationLayer, 119 InvalidationLayer,
120 InvalidationRendererInsertion,
120 InvalidationRendererRemoval, 121 InvalidationRendererRemoval,
121 InvalidationPaintRectangle 122 InvalidationPaintRectangle
122 }; 123 };
123 124
124 const int caretWidth = 1; 125 const int caretWidth = 1;
125 126
126 struct AnnotatedRegionValue { 127 struct AnnotatedRegionValue {
127 bool operator==(const AnnotatedRegionValue& o) const 128 bool operator==(const AnnotatedRegionValue& o) const
128 { 129 {
129 return draggable == o.draggable && bounds == o.bounds; 130 return draggable == o.draggable && bounds == o.bounds;
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; 827 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const;
827 828
828 struct AppliedTextDecoration { 829 struct AppliedTextDecoration {
829 Color color; 830 Color color;
830 TextDecorationStyle style; 831 TextDecorationStyle style;
831 AppliedTextDecoration() : color(Color::transparent), style(TextDecoratio nStyleSolid) { } 832 AppliedTextDecoration() : color(Color::transparent), style(TextDecoratio nStyleSolid) { }
832 }; 833 };
833 834
834 void getTextDecorations(unsigned decorations, AppliedTextDecoration& underli ne, AppliedTextDecoration& overline, AppliedTextDecoration& linethrough, bool qu irksMode = false, bool firstlineStyle = false); 835 void getTextDecorations(unsigned decorations, AppliedTextDecoration& underli ne, AppliedTextDecoration& overline, AppliedTextDecoration& linethrough, bool qu irksMode = false, bool firstlineStyle = false);
835 836
836 void setHadPaintInvalidation();
837 bool hadPaintInvalidation() const;
838
839 // Return the RenderLayerModelObject in the container chain which is respons ible for painting this object, or 0 837 // Return the RenderLayerModelObject in the container chain which is respons ible for painting this object, or 0
840 // if painting is root-relative. This is the container that should be passed to the 'forPaintInvalidation' 838 // if painting is root-relative. This is the container that should be passed to the 'forPaintInvalidation'
841 // methods. 839 // methods.
842 const RenderLayerModelObject* containerForPaintInvalidation() const; 840 const RenderLayerModelObject* containerForPaintInvalidation() const;
843 const RenderLayerModelObject* adjustCompositedContainerForSpecialAncestors(c onst RenderLayerModelObject* paintInvalidationContainer) const; 841 const RenderLayerModelObject* adjustCompositedContainerForSpecialAncestors(c onst RenderLayerModelObject* paintInvalidationContainer) const;
844 bool isPaintInvalidationContainer() const; 842 bool isPaintInvalidationContainer() const;
845 843
846 LayoutRect computePaintInvalidationRect() 844 LayoutRect computePaintInvalidationRect()
847 { 845 {
848 return computePaintInvalidationRect(containerForPaintInvalidation()); 846 return computePaintInvalidationRect(containerForPaintInvalidation());
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 bool isRelayoutBoundaryForInspector() const; 1006 bool isRelayoutBoundaryForInspector() const;
1009 1007
1010 // The previous paint invalidation rect in the object's previous paint backi ng. 1008 // The previous paint invalidation rect in the object's previous paint backi ng.
1011 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; } 1009 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; }
1012 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; } 1010 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; }
1013 1011
1014 // The previous position of the top-left corner of the object in its previou s paint backing. 1012 // The previous position of the top-left corner of the object in its previou s paint backing.
1015 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re turn m_previousPositionFromPaintInvalidationBacking; } 1013 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re turn m_previousPositionFromPaintInvalidationBacking; }
1016 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki ng = positionFromPaintInvalidationBacking; } 1014 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki ng = positionFromPaintInvalidationBacking; }
1017 1015
1018 bool shouldDoFullPaintInvalidation() const { return m_bitfields.shouldDoFull PaintInvalidation(); } 1016 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != InvalidationNone; }
1019 void setShouldDoFullPaintInvalidation(bool, MarkingBehavior = MarkContaining BlockChain); 1017 void setShouldDoFullPaintInvalidation(bool, MarkingBehavior = MarkContaining BlockChain);
1018 void setShouldDoFullPaintInvalidationWithReason(InvalidationReason, MarkingB ehavior = MarkContainingBlockChain);
1020 1019
1021 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); } 1020 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); }
1022 1021
1023 bool shouldDoFullPaintInvalidationIfSelfPaintingLayer() const { return m_bit fields.shouldDoFullPaintInvalidationIfSelfPaintingLayer(); } 1022 bool shouldDoFullPaintInvalidationIfSelfPaintingLayer() const { return m_bit fields.shouldDoFullPaintInvalidationIfSelfPaintingLayer(); }
1024 void setShouldDoFullPaintInvalidationIfSelfPaintingLayer(bool b) 1023 void setShouldDoFullPaintInvalidationIfSelfPaintingLayer(bool b)
1025 { 1024 {
1026 m_bitfields.setShouldDoFullPaintInvalidationIfSelfPaintingLayer(b); 1025 m_bitfields.setShouldDoFullPaintInvalidationIfSelfPaintingLayer(b);
1027 1026
1028 if (b) 1027 if (b)
1029 markContainingBlockChainForPaintInvalidation(); 1028 markContainingBlockChainForPaintInvalidation();
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 class RenderObjectBitfields { 1190 class RenderObjectBitfields {
1192 enum PositionedState { 1191 enum PositionedState {
1193 IsStaticallyPositioned = 0, 1192 IsStaticallyPositioned = 0,
1194 IsRelativelyPositioned = 1, 1193 IsRelativelyPositioned = 1,
1195 IsOutOfFlowPositioned = 2, 1194 IsOutOfFlowPositioned = 2,
1196 }; 1195 };
1197 1196
1198 public: 1197 public:
1199 RenderObjectBitfields(Node* node) 1198 RenderObjectBitfields(Node* node)
1200 : m_selfNeedsLayout(false) 1199 : m_selfNeedsLayout(false)
1201 , m_shouldDoFullPaintInvalidation(false)
1202 , m_shouldInvalidateOverflowForPaint(false) 1200 , m_shouldInvalidateOverflowForPaint(false)
1203 , m_shouldDoFullPaintInvalidationIfSelfPaintingLayer(false) 1201 , m_shouldDoFullPaintInvalidationIfSelfPaintingLayer(false)
1204 // FIXME: We should remove mayNeedPaintInvalidation once we are able to 1202 // FIXME: We should remove mayNeedPaintInvalidation once we are able to
1205 // use the other layout flags to detect the same cases. crbug.com/37 0118 1203 // use the other layout flags to detect the same cases. crbug.com/37 0118
1206 , m_mayNeedPaintInvalidation(false) 1204 , m_mayNeedPaintInvalidation(false)
1207 , m_onlyNeededPositionedMovementLayout(false) 1205 , m_onlyNeededPositionedMovementLayout(false)
1208 , m_neededLayoutBecauseOfChildren(false) 1206 , m_neededLayoutBecauseOfChildren(false)
1209 , m_needsPositionedMovementLayout(false) 1207 , m_needsPositionedMovementLayout(false)
1210 , m_normalChildNeedsLayout(false) 1208 , m_normalChildNeedsLayout(false)
1211 , m_posChildNeedsLayout(false) 1209 , m_posChildNeedsLayout(false)
(...skipping 18 matching lines...) Expand all
1230 , m_ancestorLineBoxDirty(false) 1228 , m_ancestorLineBoxDirty(false)
1231 , m_layoutDidGetCalled(false) 1229 , m_layoutDidGetCalled(false)
1232 , m_hasPendingResourceUpdate(false) 1230 , m_hasPendingResourceUpdate(false)
1233 , m_childrenInline(false) 1231 , m_childrenInline(false)
1234 , m_hasColumns(false) 1232 , m_hasColumns(false)
1235 , m_alwaysCreateLineBoxesForRenderInline(false) 1233 , m_alwaysCreateLineBoxesForRenderInline(false)
1236 , m_positionedState(IsStaticallyPositioned) 1234 , m_positionedState(IsStaticallyPositioned)
1237 , m_selectionState(SelectionNone) 1235 , m_selectionState(SelectionNone)
1238 , m_flowThreadState(NotInsideFlowThread) 1236 , m_flowThreadState(NotInsideFlowThread)
1239 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) 1237 , m_boxDecorationBackgroundState(NoBoxDecorationBackground)
1238 , m_fullPaintInvalidationReason(InvalidationNone)
1240 { 1239 {
1241 } 1240 }
1242 1241
1243 // 32 bits have been used in the first word, and 11 in the second. 1242 // 32 bits have been used in the first word, and 14 in the second.
1244 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); 1243 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout);
1245 ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidation, ShouldDoFullPaintInv alidation);
1246 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO verflowForPaint); 1244 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO verflowForPaint);
1247 ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, S houldDoFullPaintInvalidationIfSelfPaintingLayer); 1245 ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, S houldDoFullPaintInvalidationIfSelfPaintingLayer);
1248 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation) ; 1246 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation) ;
1249 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit ionedMovementLayout); 1247 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit ionedMovementLayout);
1250 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO fChildren); 1248 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO fChildren);
1251 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout); 1249 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout);
1252 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); 1250 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout);
1253 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); 1251 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout);
1254 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout); 1252 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout);
1255 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty); 1253 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths Dirty);
(...skipping 27 matching lines...) Expand all
1283 ADD_BOOLEAN_BITFIELD(hasColumns, HasColumns); 1281 ADD_BOOLEAN_BITFIELD(hasColumns, HasColumns);
1284 1282
1285 // from RenderInline 1283 // from RenderInline
1286 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForRenderInline, AlwaysCreateL ineBoxesForRenderInline); 1284 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForRenderInline, AlwaysCreateL ineBoxesForRenderInline);
1287 1285
1288 private: 1286 private:
1289 unsigned m_positionedState : 2; // PositionedState 1287 unsigned m_positionedState : 2; // PositionedState
1290 unsigned m_selectionState : 3; // SelectionState 1288 unsigned m_selectionState : 3; // SelectionState
1291 unsigned m_flowThreadState : 2; // FlowThreadState 1289 unsigned m_flowThreadState : 2; // FlowThreadState
1292 unsigned m_boxDecorationBackgroundState : 2; // BoxDecorationBackgroundS tate 1290 unsigned m_boxDecorationBackgroundState : 2; // BoxDecorationBackgroundS tate
1291 unsigned m_fullPaintInvalidationReason : 4; // InvalidationReason
1293 1292
1294 public: 1293 public:
1295 bool isOutOfFlowPositioned() const { return m_positionedState == IsOutOf FlowPositioned; } 1294 bool isOutOfFlowPositioned() const { return m_positionedState == IsOutOf FlowPositioned; }
1296 bool isRelPositioned() const { return m_positionedState == IsRelativelyP ositioned; } 1295 bool isRelPositioned() const { return m_positionedState == IsRelativelyP ositioned; }
1297 bool isPositioned() const { return m_positionedState != IsStaticallyPosi tioned; } 1296 bool isPositioned() const { return m_positionedState != IsStaticallyPosi tioned; }
1298 1297
1299 void setPositionedState(int positionState) 1298 void setPositionedState(int positionState)
1300 { 1299 {
1301 // This mask maps FixedPosition and AbsolutePosition to IsOutOfFlowP ositioned, saving one bit. 1300 // This mask maps FixedPosition and AbsolutePosition to IsOutOfFlowP ositioned, saving one bit.
1302 m_positionedState = static_cast<PositionedState>(positionState & 0x3 ); 1301 m_positionedState = static_cast<PositionedState>(positionState & 0x3 );
1303 } 1302 }
1304 void clearPositionedState() { m_positionedState = StaticPosition; } 1303 void clearPositionedState() { m_positionedState = StaticPosition; }
1305 1304
1306 ALWAYS_INLINE SelectionState selectionState() const { return static_cast <SelectionState>(m_selectionState); } 1305 ALWAYS_INLINE SelectionState selectionState() const { return static_cast <SelectionState>(m_selectionState); }
1307 ALWAYS_INLINE void setSelectionState(SelectionState selectionState) { m_ selectionState = selectionState; } 1306 ALWAYS_INLINE void setSelectionState(SelectionState selectionState) { m_ selectionState = selectionState; }
1308 1307
1309 ALWAYS_INLINE FlowThreadState flowThreadState() const { return static_ca st<FlowThreadState>(m_flowThreadState); } 1308 ALWAYS_INLINE FlowThreadState flowThreadState() const { return static_ca st<FlowThreadState>(m_flowThreadState); }
1310 ALWAYS_INLINE void setFlowThreadState(FlowThreadState flowThreadState) { m_flowThreadState = flowThreadState; } 1309 ALWAYS_INLINE void setFlowThreadState(FlowThreadState flowThreadState) { m_flowThreadState = flowThreadState; }
1311 1310
1312 ALWAYS_INLINE BoxDecorationBackgroundState boxDecorationBackgroundState( ) const { return static_cast<BoxDecorationBackgroundState>(m_boxDecorationBackgr oundState); } 1311 ALWAYS_INLINE BoxDecorationBackgroundState boxDecorationBackgroundState( ) const { return static_cast<BoxDecorationBackgroundState>(m_boxDecorationBackgr oundState); }
1313 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou ndState s) { m_boxDecorationBackgroundState = s; } 1312 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou ndState s) { m_boxDecorationBackgroundState = s; }
1313
1314 InvalidationReason fullPaintInvalidationReason() const { return static_c ast<InvalidationReason>(m_fullPaintInvalidationReason); }
1315 void setFullPaintInvalidationReason(InvalidationReason reason) { m_fullP aintInvalidationReason = reason; }
1314 }; 1316 };
1315 1317
1316 #undef ADD_BOOLEAN_BITFIELD 1318 #undef ADD_BOOLEAN_BITFIELD
1317 1319
1318 RenderObjectBitfields m_bitfields; 1320 RenderObjectBitfields m_bitfields;
1319 1321
1320 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } 1322 void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); }
1321 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition edMovementLayout(b); } 1323 void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPosition edMovementLayout(b); }
1322 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo ut(b); } 1324 void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayo ut(b); }
1323 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); } 1325 void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 void showTree(const blink::RenderObject*); 1557 void showTree(const blink::RenderObject*);
1556 void showLineTree(const blink::RenderObject*); 1558 void showLineTree(const blink::RenderObject*);
1557 void showRenderTree(const blink::RenderObject* object1); 1559 void showRenderTree(const blink::RenderObject* object1);
1558 // We don't make object2 an optional parameter so that showRenderTree 1560 // We don't make object2 an optional parameter so that showRenderTree
1559 // can be called from gdb easily. 1561 // can be called from gdb easily.
1560 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2); 1562 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2);
1561 1563
1562 #endif 1564 #endif
1563 1565
1564 #endif // RenderObject_h 1566 #endif // RenderObject_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698