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

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

Issue 14863002: Only update composited-scrolling state once after layout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: subtreeHasOutOfFlowPositionedDescendant -> subtreeContainsOutOfFlowPositionedLayer Created 7 years, 7 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) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 bool hasVisibleBoxDecorations() const; 547 bool hasVisibleBoxDecorations() const;
548 // Returns true if this layer has visible content (ignoring any child layers ). 548 // Returns true if this layer has visible content (ignoring any child layers ).
549 bool isVisuallyNonEmpty() const; 549 bool isVisuallyNonEmpty() const;
550 // True if this layer container renderers that paint. 550 // True if this layer container renderers that paint.
551 bool hasNonEmptyChildRenderers() const; 551 bool hasNonEmptyChildRenderers() const;
552 552
553 // FIXME: We should ASSERT(!m_hasSelfPaintingLayerDescendantDirty); here but we hit the same bugs as visible content above. 553 // FIXME: We should ASSERT(!m_hasSelfPaintingLayerDescendantDirty); here but we hit the same bugs as visible content above.
554 // Part of the issue is with subtree relayout: we don't check if our ancesto rs have some descendant flags dirty, missing some updates. 554 // Part of the issue is with subtree relayout: we don't check if our ancesto rs have some descendant flags dirty, missing some updates.
555 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerD escendant; } 555 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerD escendant; }
556 556
557 // This returns true if we have an out of flow positioned descendant whose 557 // FIXME: We should ASSERT(!m_hasOutOfFlowPositionedDescendantDirty) here. S ee above.
558 // containing block is not a descendant of ours. If this is true, we cannot
559 // automatically opt into composited scrolling since this out of flow
560 // positioned descendant would become clipped by us, possibly altering the
561 // rendering of the page.
562 // FIXME: We should ASSERT(!m_hasOutOfFlowPositionedDescendantDirty); here b ut we may hit the same bugs as visible content above.
563 bool hasOutOfFlowPositionedDescendant() const { return m_hasOutOfFlowPositio nedDescendant; } 558 bool hasOutOfFlowPositionedDescendant() const { return m_hasOutOfFlowPositio nedDescendant; }
564 559
560 void setHasOutOfFlowPositionedDescendant(bool hasDescendant) { m_hasOutOfFlo wPositionedDescendant = hasDescendant; }
561 void setHasOutOfFlowPositionedDescendantDirty(bool dirty) { m_hasOutOfFlowPo sitionedDescendantDirty = dirty; }
562
563 bool hasUnclippedDescendant() const { return m_hasUnclippedDescendant; }
564 void setHasUnclippedDescendant(bool hasDescendant) { m_hasUnclippedDescendan t = hasDescendant; }
565 void updateHasUnclippedDescendant();
566
565 // Gets the nearest enclosing positioned ancestor layer (also includes 567 // Gets the nearest enclosing positioned ancestor layer (also includes
566 // the <html> layer and the root layer). 568 // the <html> layer and the root layer).
567 RenderLayer* enclosingPositionedAncestor() const; 569 RenderLayer* enclosingPositionedAncestor() const;
568 570
569 // Returns the nearest enclosing layer that is scrollable. 571 // Returns the nearest enclosing layer that is scrollable.
570 RenderLayer* enclosingScrollableLayer() const; 572 RenderLayer* enclosingScrollableLayer() const;
571 573
572 // The layer relative to which clipping rects for this layer are computed. 574 // The layer relative to which clipping rects for this layer are computed.
573 RenderLayer* clippingRootForPainting() const; 575 RenderLayer* clippingRootForPainting() const;
574 576
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 847
846 void updateNormalFlowList(); 848 void updateNormalFlowList();
847 849
848 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); } 850 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); }
849 851
850 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); } 852 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); }
851 853
852 void setAncestorChainHasSelfPaintingLayerDescendant(); 854 void setAncestorChainHasSelfPaintingLayerDescendant();
853 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 855 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
854 856
857 void setAncestorChainHasOutOfFlowPositionedDescendant();
858 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
859
855 bool acceleratedCompositingForOverflowScrollEnabled() const; 860 bool acceleratedCompositingForOverflowScrollEnabled() const;
856 void updateDescendantsAreContiguousInStackingOrder(); 861 void updateDescendantsAreContiguousInStackingOrder();
857 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration); 862 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration);
858 void collectBeforePromotionZOrderList(RenderLayer* ancestorStackingContext, OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote, OwnPtr<Vector<RenderL ayer*> >& negZOrderListBeforePromote); 863 void collectBeforePromotionZOrderList(RenderLayer* ancestorStackingContext, OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote, OwnPtr<Vector<RenderL ayer*> >& negZOrderListBeforePromote);
859 void collectAfterPromotionZOrderList(RenderLayer* ancestorStackingContext, O wnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote, OwnPtr<Vector<RenderLay er*> >& negZOrderListAfterPromote); 864 void collectAfterPromotionZOrderList(RenderLayer* ancestorStackingContext, O wnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote, OwnPtr<Vector<RenderLay er*> >& negZOrderListAfterPromote);
860 865
861 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0); 866 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0);
862 void computeRepaintRectsIncludingDescendants(); 867 void computeRepaintRectsIncludingDescendants();
863 void clearRepaintRects(); 868 void clearRepaintRects();
864 869
865 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&, 870 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&,
866 BorderRadiusClippingRule = IncludeSelfForBorderRadius); 871 BorderRadiusClippingRule = IncludeSelfForBorderRadius);
867 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); 872 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&);
868 873
869 bool shouldRepaintAfterLayout() const; 874 bool shouldRepaintAfterLayout() const;
870 875
871 void updateSelfPaintingLayer(); 876 void updateSelfPaintingLayer();
872 void updateIsNormalFlowOnly(); 877 void updateIsNormalFlowOnly();
873 void updateVisibilityAfterStyleChange(const RenderStyle* oldStyle); 878 void updateVisibilityAfterStyleChange(const RenderStyle* oldStyle);
874 void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle); 879 void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle);
875 880
876 void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle); 881 void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle);
877 void updateScrollbarsAfterLayout(); 882 void updateScrollbarsAfterLayout();
878 883
879 void setAncestorChainHasOutOfFlowPositionedDescendant(RenderObject* containi ngBlock);
880 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
881 void updateOutOfFlowPositioned(const RenderStyle* oldStyle); 884 void updateOutOfFlowPositioned(const RenderStyle* oldStyle);
882 885
883 void updateNeedsCompositedScrolling(); 886 virtual void updateNeedsCompositedScrolling() OVERRIDE;
887 void setNeedsCompositedScrolling(bool);
884 void didUpdateNeedsCompositedScrolling(); 888 void didUpdateNeedsCompositedScrolling();
885 889
886 // Returns true if the position changed. 890 // Returns true if the position changed.
887 bool updateLayerPosition(); 891 bool updateLayerPosition();
888 892
889 void updateLayerPositions(RenderGeometryMap* = 0, UpdateLayerPositionsFlags = defaultFlags); 893 void updateLayerPositions(RenderGeometryMap* = 0, UpdateLayerPositionsFlags = defaultFlags);
890 894
891 enum UpdateLayerPositionsAfterScrollFlag { 895 enum UpdateLayerPositionsAfterScrollFlag {
892 NoFlag = 0, 896 NoFlag = 0,
893 IsOverflowScroll = 1 << 0, 897 IsOverflowScroll = 1 << 0,
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 void updateCompositingLayersAfterScroll(); 1044 void updateCompositingLayersAfterScroll();
1041 1045
1042 IntSize scrollbarOffset(const Scrollbar*) const; 1046 IntSize scrollbarOffset(const Scrollbar*) const;
1043 1047
1044 void updateResizerAreaSet(); 1048 void updateResizerAreaSet();
1045 void updateScrollableAreaSet(bool hasOverflow); 1049 void updateScrollableAreaSet(bool hasOverflow);
1046 1050
1047 void dirtyAncestorChainVisibleDescendantStatus(); 1051 void dirtyAncestorChainVisibleDescendantStatus();
1048 void setAncestorChainHasVisibleDescendant(); 1052 void setAncestorChainHasVisibleDescendant();
1049 1053
1050 void updateDescendantDependentFlags(HashSet<const RenderObject*>* outOfFlowD escendantContainingBlocks = 0); 1054 void updateDescendantDependentFlags();
1051 1055
1052 // This flag is computed by RenderLayerCompositor, which knows more about 3d hierarchies than we do. 1056 // This flag is computed by RenderLayerCompositor, which knows more about 3d hierarchies than we do.
1053 void setHas3DTransformedDescendant(bool b) { m_has3DTransformedDescendant = b; } 1057 void setHas3DTransformedDescendant(bool b) { m_has3DTransformedDescendant = b; }
1054 bool has3DTransformedDescendant() const { return m_has3DTransformedDescendan t; } 1058 bool has3DTransformedDescendant() const { return m_has3DTransformedDescendan t; }
1055 1059
1056 void dirty3DTransformedDescendantStatus(); 1060 void dirty3DTransformedDescendantStatus();
1057 // Both updates the status, and returns true if descendants of this have 3d. 1061 // Both updates the status, and returns true if descendants of this have 3d.
1058 bool update3DTransformedDescendantStatus(); 1062 bool update3DTransformedDescendantStatus();
1059 1063
1060 void createReflection(); 1064 void createReflection();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 bool m_normalFlowListDirty: 1; 1143 bool m_normalFlowListDirty: 1;
1140 bool m_isNormalFlowOnly : 1; 1144 bool m_isNormalFlowOnly : 1;
1141 1145
1142 bool m_isSelfPaintingLayer : 1; 1146 bool m_isSelfPaintingLayer : 1;
1143 1147
1144 // If have no self-painting descendants, we don't have to walk our children during painting. This can lead to 1148 // If have no self-painting descendants, we don't have to walk our children during painting. This can lead to
1145 // significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells). 1149 // significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells).
1146 bool m_hasSelfPaintingLayerDescendant : 1; 1150 bool m_hasSelfPaintingLayerDescendant : 1;
1147 bool m_hasSelfPaintingLayerDescendantDirty : 1; 1151 bool m_hasSelfPaintingLayerDescendantDirty : 1;
1148 1152
1149 // If we have no out of flow positioned descendants and no non-descendant
1150 // appears between our descendants in stacking order, then we may become a
1151 // stacking context.
1152 bool m_hasOutOfFlowPositionedDescendant : 1; 1153 bool m_hasOutOfFlowPositionedDescendant : 1;
1153 bool m_hasOutOfFlowPositionedDescendantDirty : 1; 1154 bool m_hasOutOfFlowPositionedDescendantDirty : 1;
1154 1155
1156 // This is true if we have an out-of-flow positioned descendant whose
1157 // containing block is our ancestor. If this is the case, the descendant
1158 // may fall outside of our clip preventing things like opting into
1159 // composited scrolling (which causes clipping of all descendants).
1160 bool m_hasUnclippedDescendant : 1;
1161
1155 bool m_needsCompositedScrolling : 1; 1162 bool m_needsCompositedScrolling : 1;
1156 1163
1157 // If this is true, then no non-descendant appears between any of our 1164 // If this is true, then no non-descendant appears between any of our
1158 // descendants in stacking order. This is one of the requirements of being 1165 // descendants in stacking order. This is one of the requirements of being
1159 // able to safely become a stacking context. 1166 // able to safely become a stacking context.
1160 bool m_descendantsAreContiguousInStackingOrder : 1; 1167 bool m_descendantsAreContiguousInStackingOrder : 1;
1161 bool m_descendantsAreContiguousInStackingOrderDirty : 1; 1168 bool m_descendantsAreContiguousInStackingOrderDirty : 1;
1162 1169
1163 const bool m_isRootLayer : 1; 1170 const bool m_isRootLayer : 1;
1164 1171
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 1342
1336 } // namespace WebCore 1343 } // namespace WebCore
1337 1344
1338 #ifndef NDEBUG 1345 #ifndef NDEBUG
1339 // Outside the WebCore namespace for ease of invocation from gdb. 1346 // Outside the WebCore namespace for ease of invocation from gdb.
1340 void showLayerTree(const WebCore::RenderLayer*); 1347 void showLayerTree(const WebCore::RenderLayer*);
1341 void showLayerTree(const WebCore::RenderObject*); 1348 void showLayerTree(const WebCore::RenderObject*);
1342 #endif 1349 #endif
1343 1350
1344 #endif // RenderLayer_h 1351 #endif // RenderLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698